/* Tasclass v2 - base styles */

:root {
    --tc-primary: #2563eb;
    --tc-primary-hover: #1d4ed8;
    --tc-primary-light: #eff6ff;
    --tc-primary-border: #bfdbfe;
    --tc-primary-ring: rgba(37, 99, 235, 0.4);

    --tc-sidebar-bg: #0f172a;
    --tc-sidebar-border: #1e293b;
    --tc-sidebar-hover: rgba(255, 255, 255, 0.05);
    --tc-sidebar-active: rgba(255, 255, 255, 0.08);
    --tc-sidebar-text: #94a3b8;
    --tc-sidebar-text-bright: #e2e8f0;

    --tc-secondary: #475569;

    --tc-page-bg: #f1f5f9;
    --tc-surface: #fff;
    --tc-border: #e2e8f0;
    --tc-text: #1e293b;
    --tc-text-secondary: #64748b;
    --tc-text-muted: #94a3b8;

    --tc-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --tc-radius: 0.75rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body.tc-body {
    margin: 0;
    font-family: var(--tc-font);
    background: var(--tc-page-bg);
    color: var(--tc-text);
    direction: rtl;
}

/* =============================================
   App Shell – sidebar + content layout
   ============================================= */
.tc-shell {
    display: flex;
    max-width: 1280px;
    margin: 0.75rem auto;
    border: 1px solid var(--tc-border);
    border-radius: 0.75rem;
    background: var(--tc-surface);
    overflow: hidden;
    min-height: calc(100vh - 1.5rem);
}

/* =============================================
   Sidebar
   ============================================= */
.tc-sidebar {
    width: 220px;
    background: var(--tc-sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.2s ease;
    overflow-x: hidden;
    border-left: 1px solid var(--tc-sidebar-border);
}

.tc-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--tc-sidebar-border);
    min-height: 3.25rem;
    gap: 0;
}

.tc-sidebar-brand-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.tc-sidebar-logo-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 6px;
    object-fit: contain;
}

.tc-sidebar-logo-icon-fallback {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 6px;
    background: var(--tc-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.tc-sidebar-school-name {
    color: var(--tc-sidebar-text-bright);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-sidebar-logo-text {
    color: var(--tc-sidebar-text-bright);
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
}

.tc-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--tc-sidebar-text);
    padding: 0;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.tc-sidebar-toggle:hover {
    color: var(--tc-sidebar-text-bright);
    background: var(--tc-sidebar-hover);
}

.tc-sidebar-icn-expand { display: none; }
.tc-sidebar-icn-collapse { display: block; }

.tc-sidebar-nav {
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.tc-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
    color: var(--tc-sidebar-text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    min-width: 0;
    position: relative;
}

.tc-sidebar-link svg {
    flex-shrink: 0;
    stroke: var(--tc-sidebar-text);
    transition: stroke 0.15s;
}

.tc-sidebar-link:hover {
    background: var(--tc-sidebar-hover);
    color: var(--tc-sidebar-text-bright);
}

.tc-sidebar-link:hover svg {
    stroke: var(--tc-sidebar-text-bright);
}

.tc-sidebar-link.is-active {
    background: var(--tc-sidebar-active);
    color: #fff;
    font-weight: 600;
}

.tc-sidebar-link.is-active::before {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    right: 0;
    width: 3px;
    border-radius: 3px;
    background: var(--tc-primary);
}

.tc-sidebar-link.is-active svg {
    stroke: var(--tc-primary);
}

.tc-sidebar-footer {
    margin-top: auto;
    padding: 0.75rem;
    border-top: 1px solid var(--tc-sidebar-border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tc-sidebar-version {
    font-size: 0.7rem;
    color: var(--tc-sidebar-text);
    white-space: nowrap;
}

.tc-sidebar-powered {
    font-size: 0.65rem;
    color: var(--tc-sidebar-text);
    white-space: nowrap;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.tc-sidebar-powered svg {
    flex-shrink: 0;
}

.tc-sidebar-footer-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.45rem 0.5rem;
    background: transparent;
    border: none;
    color: var(--tc-sidebar-text);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.tc-sidebar-footer-btn svg {
    flex-shrink: 0;
    stroke: var(--tc-sidebar-text);
}

.tc-sidebar-footer-btn:hover {
    background: var(--tc-sidebar-hover);
    color: #f87171;
}

.tc-sidebar-footer-btn:hover svg {
    stroke: #f87171;
}

/* --- Collapsed sidebar --- */
.tc-sidebar.is-collapsed {
    width: 56px;
}

.tc-sidebar.is-collapsed .tc-sidebar-txt,
.tc-sidebar.is-collapsed .tc-sidebar-version {
    display: none !important;
}

.tc-sidebar.is-collapsed .tc-sidebar-brand-info {
    display: none !important;
}

.tc-sidebar.is-collapsed .tc-sidebar-brand {
    justify-content: center;
    padding: 0.6rem 0;
}

.tc-sidebar.is-collapsed .tc-sidebar-link {
    justify-content: center;
    padding: 0.55rem;
    min-height: 40px;
}

.tc-sidebar.is-collapsed .tc-sidebar-nav {
    padding: 0.75rem 0;
    align-items: center;
}

.tc-sidebar.is-collapsed .tc-sidebar-footer {
    padding: 0.75rem 0.25rem;
    align-items: center;
}

.tc-sidebar.is-collapsed .tc-sidebar-footer-btn {
    justify-content: center;
    padding: 0.45rem;
}

.tc-sidebar.is-collapsed .tc-sidebar-icn-expand { display: block; }
.tc-sidebar.is-collapsed .tc-sidebar-icn-collapse { display: none; }

.tc-sidebar.is-collapsed .tc-sidebar-powered {
    display: none !important;
}

/* =============================================
   Content Area + Top Bar
   ============================================= */
.tc-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.tc-topbar {
    height: 3.25rem;
    min-height: 3.25rem;
    border-bottom: 1px solid var(--tc-border);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
    background: var(--tc-surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.25rem;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.tc-topbar-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tc-topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--tc-text);
    padding-right: 0.75rem;
    border-right: 3px solid var(--tc-primary);
}

/* Couch Mode: כותרת מסך + רענון בשורה (כמו מיני־אפ מורה) — עמודה ימנית = רענון (RTL) */
.tc-topbar-title-wrap .tc-topbar-title-row--cm {
    flex: 1 1 auto;
    min-width: 0;
}

.tc-topbar-title-row--cm {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
}

.tc-topbar-title-row--cm .tc-topbar-title {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 1.05rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: -0.02em;
}

.tc-topbar-title--couch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
    min-width: 0;
    max-width: 100%;
}

.tc-topbar-title-couch-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--tc-primary);
}

.tc-topbar-title--couch .tc-topbar-title-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-topbar-title-spacer {
    display: block;
    width: 100%;
    min-height: 1px;
    visibility: hidden;
    pointer-events: none;
}

.tc-topbar-inline-refresh.cm-hero-refresh {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    box-sizing: border-box;
    justify-self: center;
    align-self: center;
}

.tc-topbar-inline-refresh.cm-hero-refresh .cm-refresh-icon {
    width: 15px;
    height: 15px;
}

.tc-mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    color: #374151;
    padding: 0;
    border-radius: 6px;
}

.tc-mobile-menu-btn:hover {
    background: #f3f4f6;
}

.tc-topbar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.tc-topbar-user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
}

.tc-topbar-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #4b5563;
    padding: 0;
}

.tc-topbar-bell:hover {
    background: #f3f4f6;
}

.tc-topbar-bell-icon {
    font-size: 18px;
    line-height: 1;
}

.tc-topbar-bell-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tc-topbar-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}

.tc-notifications-panel {
    position: fixed;
    max-height: 420px;
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    border: 1px solid #e5e7eb;
    z-index: 1200;
    display: none;
    overflow: hidden;
}

.tc-notifications-panel.is-open {
    display: block;
}

.tc-notif-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tc-notif-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
}

.tc-notif-markall-btn {
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.1rem 0.25rem;
}

.tc-notif-markall-btn:hover {
    color: #111827;
}

.tc-notif-body {
    max-height: 360px;
    overflow-y: auto;
}

.tc-notif-empty {
    padding: 1rem;
    font-size: 0.85rem;
    color: #6b7280;
}

.tc-notif-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid #f3f4f6;
}

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

.tc-notif-item.unread {
    background: #f1f5f9;
}

.tc-notif-main {
    flex: 1 1 auto;
    min-width: 0;
}

.tc-notif-title-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.15rem;
}

.tc-notif-body-text {
    font-size: 0.8rem;
    color: #4b5563;
    margin-bottom: 0.15rem;
}

.tc-notif-meta {
    font-size: 0.75rem;
    color: #9ca3af;
}

.tc-notif-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tc-notif-btn {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: none;
    background: #e5e7eb;
    color: #374151;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    padding: 0;
}

.tc-notif-btn:hover {
    background: #d1d5db;
}

.tc-notif-btn.is-active {
    background: #fee2e2;
    color: #b91c1c;
}

.tc-notif-btn .tc-tma-icon {
    width: 15px;
    height: 15px;
    display: block;
}

.tc-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 998;
}

.tc-sidebar-overlay.is-visible {
    display: block;
}

.tc-main {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    transition: opacity 0.15s ease;
}

/* =============================================
   Sidebar responsive – mobile
   ============================================= */
@media (max-width: 768px) {
    .tc-shell {
        margin: 0;
        border: none;
        border-radius: 0;
        min-height: 100vh;
    }

    .tc-sidebar {
        position: fixed;
        top: 0;
        right: -280px;
        width: 250px;
        height: 100vh;
        z-index: 999;
        transition: right 0.3s ease;
        border-left: none;
        border-radius: 0;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
    }

    .tc-sidebar.is-collapsed {
        width: 250px;
        right: -280px;
    }

    .tc-sidebar.is-open {
        right: 0;
    }

    .tc-sidebar.is-open .tc-sidebar-txt,
    .tc-sidebar.is-open .tc-sidebar-version,
    .tc-sidebar.is-open .tc-sidebar-brand-info {
        display: flex !important;
    }

    .tc-sidebar.is-open .tc-sidebar-link {
        justify-content: flex-start;
    }

    .tc-sidebar.is-open .tc-sidebar-icn-collapse { display: block; }
    .tc-sidebar.is-open .tc-sidebar-icn-expand { display: none; }

    .tc-mobile-menu-btn {
        display: inline-flex;
    }

    .tc-topbar-user-name {
        display: none;
    }

    /* רכזת עם דוק: סרגל עליון בסגנון מיני־אפ — בלי המבורגר; תפריט נשאר מ־«עוד» */
    /* חשוב: ביטול height הקבוע של .tc-topbar — אחרת הרקע לא מכסה אווטאר/פעמון/גלגל */
    body.tc-couch-dock-on .tc-topbar--web-mini {
        flex-wrap: wrap;
        align-items: center;
        align-content: center;
        row-gap: 0.28rem;
        column-gap: 0.45rem;
        height: auto;
        min-height: unset;
        padding-top: 0.36rem;
        padding-bottom: 0.3rem;
        /* יישור ל־.tc-tma-main במיני־אפ: 0.85rem */
        padding-left: calc(0.85rem + env(safe-area-inset-left, 0px));
        padding-right: calc(0.85rem + env(safe-area-inset-right, 0px));
        font-family: "Heebo", var(--tc-font), system-ui, -apple-system, "Segoe UI", sans-serif;
        background: linear-gradient(165deg, #e8f0fe 0%, #f2f6fe 100%);
        border-bottom: 1px solid rgba(37, 99, 235, 0.35);
        box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
        box-sizing: border-box;
    }

    body.tc-couch-dock-on .tc-topbar--web-mini .tc-mobile-menu-btn {
        display: none !important;
    }

    body.tc-couch-dock-on .tc-topbar--web-mini .tc-web-mini-start {
        display: flex !important;
        align-items: center;
        gap: 0.45rem;
        flex: 1 1 auto;
        min-width: 0;
        order: 1;
        padding-bottom: 0.04rem;
    }

    body.tc-couch-dock-on .tc-topbar--web-mini .tc-topbar-user {
        order: 2;
        flex-shrink: 0;
        gap: 0.4rem;
        align-items: center;
        align-self: center;
        padding-bottom: 0.04rem;
    }

    body.tc-couch-dock-on .tc-topbar--web-mini .tc-web-mini-avatar.tc-avatar {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1rem;
    }

    body.tc-couch-dock-on .tc-topbar--web-mini .tc-web-mini-logo-img {
        height: 2.1rem;
        max-width: 2.75rem;
    }

    body.tc-couch-dock-on .tc-topbar--web-mini .tc-web-mini-greeting {
        font-size: 0.88rem;
    }

    body.tc-couch-dock-on .tc-topbar--web-mini .tc-topbar-title-wrap {
        order: 3;
        flex: 1 1 100%;
        justify-content: center;
        padding-top: 0.14rem;
        margin-top: 0;
        border-top: 1px solid rgba(15, 23, 42, 0.07);
    }

    body.tc-couch-dock-on .tc-topbar--web-mini .tc-topbar-title {
        border-right: none;
        padding-right: 0;
        font-size: 1rem;
        color: #0f172a;
    }

    body.tc-couch-dock-on .tc-topbar--web-mini .tc-topbar-title-row--cm .tc-topbar-title {
        font-size: 1.02rem;
        font-weight: 800;
    }

    body.tc-couch-dock-on .tc-topbar--web-mini .tc-web-mini-logo {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    body.tc-couch-dock-on .tc-topbar--web-mini .tc-topbar-user .tc-topbar-avatar {
        display: none !important;
    }

    body.tc-couch-dock-on .tc-topbar--web-mini .tc-topbar-bell {
        width: 2.4rem;
        height: 2.4rem;
        border-radius: 50%;
        border: 1px solid rgba(15, 23, 42, 0.1);
        background: rgba(255, 255, 255, 0.85);
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    }

    body.tc-couch-dock-on .tc-topbar--web-mini .tc-topbar-bell:hover {
        background: #fff;
    }
}

@media (min-width: 769px) {
    .tc-topbar--web-mini .tc-web-mini-start,
    .tc-topbar--web-mini .tc-web-mini-logo {
        display: none !important;
    }
}

.tc-web-mini-start {
    align-items: center;
    gap: 0.45rem;
}

.tc-web-mini-avatar-link {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 50%;
    -webkit-tap-highlight-color: transparent;
}

.tc-web-mini-avatar-link:focus-visible {
    outline: 2px solid var(--tc-primary);
    outline-offset: 2px;
}

.tc-web-mini-avatar.tc-avatar {
    width: 3.1rem;
    height: 3.1rem;
    font-size: 1.1rem;
}

.tc-web-mini-gear {
    position: absolute;
    bottom: -0.05rem;
    inset-inline-start: -0.05rem;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    background: var(--tc-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.15);
    pointer-events: none;
}

.tc-web-mini-gear svg {
    display: block;
}

.tc-web-mini-greeting {
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.tc-web-mini-greeting-prefix,
.tc-web-mini-greeting-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-web-mini-greeting-comma {
    flex-shrink: 0;
}

.tc-web-mini-logo {
    align-items: center;
    justify-content: center;
}

.tc-web-mini-logo-img {
    display: block;
    width: auto;
    height: 2.35rem;
    max-width: 3.1rem;
    object-fit: contain;
    border-radius: 0.35rem;
}

.tc-panel {
    background: var(--tc-surface);
    border-radius: var(--tc-radius);
    padding: 1.25rem 1.25rem 1.5rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.tc-panel-title {
    margin: 0 0 0.35rem;
    font-size: 1.3rem;
}

.tc-panel-subtitle {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: #4b5563;
}

.tc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.tc-card {
    border-radius: var(--tc-radius);
    border: 1px solid var(--tc-border);
    padding: 1rem;
    background: #f9fafb;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.tc-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.tc-card:hover {
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
    border-color: #d1d5db;
}

.tc-card-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}

.tc-card-text {
    margin: 0;
    font-size: 0.9rem;
    color: #4b5563;
}

/* Dashboard - coordinator weekly activity */
.tc-dash-week-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}
.tc-dash-week-label {
    font-weight: 600;
    color: var(--tc-text);
}
.tc-dash-week-dates {
    font-size: 0.95rem;
    color: var(--tc-text-secondary);
}
.tc-dash-tasks-card {
    margin-bottom: 1rem;
}
.tc-dash-tasks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tc-dash-tasks-link {
    font-size: 0.875rem;
    color: var(--tc-primary);
    text-decoration: none;
}
.tc-dash-tasks-link:hover {
    text-decoration: underline;
}
.tc-dash-tasks-total {
    margin-bottom: 0.75rem;
}
.tc-dash-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.tc-dash-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border-radius: 0.5rem;
    background: var(--tc-page-bg);
    border: 1px solid var(--tc-border);
}
.tc-dash-stat-num {
    font-weight: 700;
    font-size: 1.1rem;
}
.tc-dash-stat-label {
    font-size: 0.85rem;
    color: var(--tc-text-secondary);
}
.tc-dash-stat-pending .tc-dash-stat-num { color: #b45309; }
.tc-dash-stat-progress .tc-dash-stat-num { color: var(--tc-primary); }
.tc-dash-stat-done .tc-dash-stat-num { color: #059669; }
.tc-dash-stat-overdue {
    border-color: #fca5a5;
    background: #fef2f2;
}
.tc-dash-stat-overdue .tc-dash-stat-num { color: #dc2626; }
.tc-dash-events-card {
    margin-bottom: 1rem;
}
.tc-dash-events-main-title {
    margin-bottom: 1rem;
}
.tc-dash-events-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 560px) {
    .tc-dash-events-columns {
        grid-template-columns: 1fr;
    }
}
.tc-dash-events-col {
    background: var(--tc-surface);
    border-radius: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--tc-border);
}
.tc-dash-events-col-title {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tc-text-muted);
}
.tc-dash-events-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.tc-dash-event-item {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--tc-border);
}
.tc-dash-event-item:last-child {
    border-bottom: none;
}
.tc-dash-event-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}
.tc-dash-event-link:hover .tc-dash-event-title {
    text-decoration: underline;
}
.tc-dash-event-badge {
    flex-shrink: 0;
    min-width: 2.5rem;
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--tc-primary-light, #eff6ff);
    color: var(--tc-primary);
    border-radius: 0.35rem;
    text-align: center;
}
.tc-dash-event-title {
    font-size: 0.9rem;
    color: var(--tc-text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tc-dash-events-empty {
    margin: 0;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--tc-text-muted);
    font-style: italic;
}

.tc-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
}

.tc-auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem 1.25rem 1.75rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.tc-auth-title {
    margin: 0 0 0.35rem;
    font-size: 1.4rem;
}

.tc-auth-subtitle {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.tc-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tc-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.tc-field-label {
    color: #374151;
}

.tc-input {
    border-radius: 0.55rem;
    border: 1px solid #d1d5db;
    padding: 0.55rem 0.6rem;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tc-input:focus {
    border-color: var(--tc-primary);
    box-shadow: 0 0 0 1px var(--tc-primary-ring);
}

.tc-password-wrapper {
    display: flex;
    align-items: center;
    border-radius: 0.55rem;
    border: 1px solid #d1d5db;
    background: #fff;
}

.tc-input-password {
    border: none;
    flex: 1;
    box-shadow: none;
}

.tc-input-password:focus {
    outline: none;
}

.tc-password-toggle {
    border: none;
    background: transparent;
    padding: 0 0.5rem;
    cursor: pointer;
    font-size: 1rem;
}

.tc-auth-actions {
    margin-top: 0.75rem;
}

.tc-btn {
    border-radius: 999px;
    border: none;
    padding: 0.55rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.tc-btn-block {
    width: 100%;
}

.tc-btn-primary {
    background: var(--tc-primary);
    color: #fff;
}

.tc-btn-primary:hover {
    background: var(--tc-primary-hover);
}

.tc-btn-secondary {
    background: var(--tc-secondary, #475569);
    color: #fff;
}

.tc-btn-secondary:hover {
    background: color-mix(in srgb, var(--tc-secondary, #475569), #000 12%);
}

.tc-btn-ghost {
    background: transparent;
    color: #e5e7eb;
    border: 1px solid rgba(249, 250, 251, 0.3);
}

.tc-btn-ghost:hover {
    background: rgba(17, 24, 39, 0.4);
}

.tc-alert {
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.tc-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.tc-alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: var(--tc-primary-hover);
}

.tc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.tc-modal {
    background: #fff;
    border-radius: 0.9rem;
    padding: 1rem 1.1rem 1.2rem;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.5);
}

.tc-modal-wide {
    max-width: 760px;
}

.tc-modal-title {
    margin: 0 0 0.6rem;
    font-size: 1.1rem;
}

.tc-modal-text {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: #4b5563;
    white-space: pre-wrap;
}

.tc-modal-actions {
    margin-top: 0.9rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Event hero accordion inside modal */
.tc-hero-accordion-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0;
    border: none;
    background: none;
    cursor: pointer;
}
.tc-hero-accordion-icon {
    font-size: 0.85rem;
    color: var(--tc-text-muted);
    transition: transform 0.2s;
}
.tc-hero-accordion.is-open .tc-hero-accordion-icon {
    transform: rotate(180deg);
}
.tc-hero-accordion-body {
    margin-top: 0.35rem;
    display: none;
}
.tc-hero-accordion.is-open .tc-hero-accordion-body {
    display: block;
}

.tc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

.tc-tab-link {
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    color: #374151;
    background: #f9fafb;
}

.tc-tab-link.is-active {
    background: var(--tc-primary);
    border-color: var(--tc-primary);
    color: #fff;
}

.tc-settings-content {
    margin-top: 0.5rem;
    transition: opacity 0.15s ease;
}

.tc-user-modal-grid {
    display: grid;
    grid-template-columns: minmax(0, 180px) minmax(0, 1fr);
    gap: 1rem;
    margin-top: 0.5rem;
}

.tc-user-modal-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.tc-user-modal-right {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.tc-field-row {
    display: flex;
    gap: 0.75rem;
}

.tc-field-row .tc-field {
    flex: 1;
}

.tc-field-row-name-phone .tc-field:first-child {
    flex: 0.6;
}

.tc-field-row-name-phone .tc-field:last-child {
    flex: 0.4;
    min-width: 120px;
}

/* Limit width of file inputs inside modals so they do not span entire card */
.tc-field input[type="file"] {
    max-width: 260px;
}

.tc-form-horizontal {
    margin-top: 0.5rem;
}

.tc-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem 1rem;
}

.tc-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.9rem;
    margin-top: 0.75rem;
}

.tc-user-card {
    border-radius: 0.85rem;
    border: 1px solid #e5e7eb;
    padding: 0.8rem 0.75rem;
    background: #f9fafb;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out, border-color 0.1s ease-out;
}

.tc-user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #93c5fd;
}

.tc-user-card:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.tc-user-lock-wrap:hover .tc-user-lock-tooltip {
    opacity: 1;
}

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

.tc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #60a5fa, #fb7185);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.tc-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tc-avatar-initials {
    padding: 0.15rem;
}

.tc-avatar-large {
    width: 80px;
    height: 80px;
    font-size: 1.2rem;
}

.tc-avatar-small {
    width: 32px;
    height: 32px;
}

.tc-user-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.tc-user-name {
    margin: 0;
    font-size: 0.95rem;
}

.tc-user-meta {
    margin: 0;
    font-size: 0.8rem;
    color: #6b7280;
}

.tc-user-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-top: 0.25rem;
}

.tc-chip {
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid #e5e7eb;
}

.tc-chip-role {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
}

/* מורה מקצועי – שורה נפרדת עם תג מקצוע + תגי שכבות */
.tc-user-educator-block {
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.tc-user-educator-line {
    font-size: 0.85rem;
    color: #4b5563;
}
.tc-user-subject-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #4b5563;
}
.tc-user-subject-label {
    font-weight: 500;
    margin-left: 0.15rem;
}
.tc-user-subject-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
}
.tc-user-grade-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}
.tc-user-grade-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

/* =============================================
   Staff groups (green cards only)
   ============================================= */
.tc-groups-wrapper {
    margin-top: 0.5rem;
}

.tc-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.9rem;
    margin-top: 0.75rem;
}

.tc-group-card {
    border-radius: 0.85rem;
    border: 1px solid #e5e7eb;
    padding: 0.8rem 0.75rem;
    background: #f9fafb;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out, border-color 0.1s ease-out;
}

.tc-group-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #93c5fd;
}

.tc-group-card:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.tc-group-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tc-group-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tc-group-icon svg {
    width: 22px;
    height: 22px;
}

.tc-group-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.tc-group-name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.tc-group-desc {
    margin: 0;
    font-size: 0.8rem;
    color: #6b7280;
}

.tc-group-members-chip {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.2rem;
    position: relative;
}

.tc-group-members-tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.35rem;
    padding: 0.5rem 0.6rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    min-width: 160px;
    max-width: 280px;
    display: none;
}

.tc-group-members-chip:hover .tc-group-members-tooltip {
    display: block;
}

.tc-group-members-tooltip-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    direction: rtl;
}

.tc-group-members-tooltip-row:not(:last-child) {
    border-bottom: 1px solid #e5e7eb;
}

.tc-group-members-tooltip-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #60a5fa, #fb7185);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}

.tc-group-members-tooltip-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tc-group-members-tooltip-name {
    font-size: 0.85rem;
    color: #374151;
}

.tc-group-icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tc-group-icon-opt {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 0.5rem;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.tc-group-icon-opt:hover {
    border-color: #10b981;
    background: #ecfdf5;
    color: #059669;
}

.tc-group-icon-opt.is-selected {
    border-color: #10b981;
    background: #d1fae5;
    color: #047857;
}

.tc-group-member-picker {
    position: relative;
}

.tc-group-member-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    margin-top: 0.25rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 50;
    max-height: 180px;
    overflow-y: auto;
}

.tc-group-member-list {
    padding: 0.25rem 0;
}

.tc-group-member-list button {
    width: 100%;
    padding: 0.4rem 0.75rem;
    text-align: right;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.tc-group-member-list button:hover {
    background: #f3f4f6;
}

.tc-group-selected-members {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.tc-group-selected-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #047857;
}

.tc-group-selected-chip button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #047857;
    font-size: 1rem;
    line-height: 1;
}

.tc-group-selected-chip button:hover {
    color: #b91c1c;
}

.tc-table-wrapper {
    overflow-x: auto;
}

.tc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.tc-table th,
.tc-table td {
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: right;
}

.tc-table th {
    background: #f9fafb;
    font-weight: 600;
}

.tc-table tr:hover {
    background: #f3f4f6;
}

.tc-teacher-tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #111827;
}

.tc-teacher-tag.c1 { background: #fee2e2; }
.tc-teacher-tag.c2 { background: #ffedd5; }
.tc-teacher-tag.c3 { background: #fef9c3; }
.tc-teacher-tag.c4 { background: #dcfce7; }
.tc-teacher-tag.c5 { background: #dbeafe; }
.tc-teacher-tag.c6 { background: #f3e8ff; }

.tc-icon-btn {
    border-radius: 999px;
    border: none;
    padding: 0.2rem 0.45rem;
    font-size: 0.85rem;
    cursor: pointer;
    margin-inline-start: 0.15rem;
}

.tc-icon-btn-edit {
    background: #dbeafe;
    color: var(--tc-primary-hover);
}

.tc-icon-btn-duplicate {
    background: #ede9fe;
    color: #5b21b6;
}

.tc-icon-btn-delete {
    background: #fee2e2;
    color: #b91c1c;
}

.tc-icon-btn-save {
    background: #22c55e;
    color: #fff;
}

/* Inline edit like folder rename – full text visible, minimal styling */
.tc-task-title-cell {
    vertical-align: top;
}

.tc-task-title-view-main {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--tc-text);
}

.tc-task-desc-view {
    margin-top: 0.1rem;
    font-size: 0.8rem;
    color: var(--tc-text-muted);
}

.tc-task-title-cell .tc-task-edit-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    width: 100%;
}

.tc-task-title-cell .tc-task-edit-main,
.tc-task-title-cell .tc-task-edit-desc {
    width: 100%;
}

.tc-task-title-cell .tc-inline-edit {
    width: 100%;
    min-width: 0;
    border: 1px solid #93c5fd;
    border-radius: 0.25rem;
    padding: 0.2rem 0.4rem;
    font-size: 0.9rem;
    font-family: inherit;
}

.tc-task-title-cell .tc-inline-edit-desc {
    resize: vertical;
    min-height: 2.2rem;
}

.tc-task-title-cell .tc-inline-edit:focus {
    outline: none;
    border-color: var(--tc-primary);
    box-shadow: 0 0 0 1px var(--tc-primary-ring);
}

.tc-scroll-highlight {
    animation: tc-scroll-flash 1.5s ease-out;
}

@keyframes tc-scroll-flash {
    0% { background-color: #fef08a; }
    50% { background-color: #fef08a; }
    100% { background-color: transparent; }
}

/* Grades & classes */
.tc-classes-table .tc-col-grade {
    width: 48px;
    text-align: center;
}

.tc-grade-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.4rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.8rem;
    font-weight: 600;
}

.tc-class-teacher {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.tc-class-teacher-name {
    font-size: 0.85rem;
    color: var(--tc-text);
}

.tc-class-no-teacher {
    font-size: 0.8rem;
    color: var(--tc-text-muted);
}

/* Grades & classes: collapsible "ניהול שכבות" panel + horizontal grade list */
.tc-grades-details {
    margin-bottom: 1rem;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    background: var(--tc-surface);
    overflow: hidden;
}

.tc-grades-summary {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--tc-text);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    user-select: none;
}

.tc-grades-summary::-webkit-details-marker {
    display: none;
}

.tc-grades-summary::before {
    content: '▶';
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.tc-grades-details[open] .tc-grades-summary::before {
    transform: rotate(90deg);
}

.tc-grades-summary:hover {
    background: #f8fafc;
}

.tc-grades-body {
    padding: 0 0.75rem 0.75rem;
    border-top: 1px solid var(--tc-border);
}

.tc-grades-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem 0.75rem;
}

.tc-grades-add {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.tc-grades-list {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.4rem 0.6rem;
}

.tc-grade-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.tc-grade-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    background: #eef2ff;
    color: #4338ca;
    border-radius: 0.4rem;
}

.tc-grade-item form {
    margin: 0;
}

.tc-grade-item .tc-icon-btn-delete {
    padding: 0.2rem 0.35rem;
}

/* Subject teachers (מקצועות לימוד) */
.tc-subjects-details {
    margin-bottom: 1rem;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    background: var(--tc-surface);
    overflow: hidden;
}

.tc-subjects-summary {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--tc-text);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    user-select: none;
}

.tc-subjects-summary::-webkit-details-marker {
    display: none;
}

.tc-subjects-summary::before {
    content: '▶';
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.tc-subjects-details[open] .tc-subjects-summary::before {
    transform: rotate(90deg);
}

.tc-subjects-summary:hover {
    background: #f8fafc;
}

.tc-subjects-body {
    padding: 0 0.75rem 0.75rem;
    border-top: 1px solid var(--tc-border);
}

.tc-subjects-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.tc-subjects-add {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.tc-subject-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.tc-subject-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 0.4rem;
}

.tc-subject-teachers-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--tc-border);
}

.tc-subject-teachers-filters label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.tc-subject-teachers-filters input[type="checkbox"] {
    margin: 0;
}

.tc-subject-chip {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
}

.tc-grade-chip {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
    margin-left: 0.15rem;
}

.tc-grade-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.tc-subject-teacher-cell {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Tag color popover + arc */
.tc-field-tag-color {
    position: relative;
}
.tc-tag-color-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
}
.tc-tag-color-trigger:hover {
    opacity: 0.9;
}
.tc-tag-color-popover {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.35rem;
    padding: 0.6rem;
    padding-top: 0.9rem;
    background: #ffffff;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 50;
}
.tc-tag-color-popover .tc-btn-ghost.tc-btn-sm {
    background: #ffffff;
    border-color: var(--tc-border);
    color: var(--tc-text);
    font-weight: 500;
}
.tc-tag-color-arc {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-end;
    gap: 0.25rem;
    min-height: 2.5rem;
}
.tc-tag-color-arc .tc-tag-color-swatch {
    flex-shrink: 0;
    outline: none;
}
.tc-tag-color-arc .tc-tag-color-swatch:hover {
    border-color: var(--tc-text-muted) !important;
    box-shadow: 0 0 0 1px var(--tc-text-muted);
}

/* =============================================
   Couch Mode v2 – mobile-first coordinator dashboard
   ============================================= */

.cm {
    max-width: 720px;
    margin: 0 auto;
    padding: 0.35rem 0.35rem 2rem;
    border-radius: 0;
    background: linear-gradient(180deg, #e8effe 0%, #f1f5f9 42%);
    font-family: "Heebo", var(--tc-font), system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* כרטיס גיבור כחול + טבעת (יישור למיני־אפ רכזת) */
.cm-hero-wrap {
    margin-bottom: 0.85rem;
}

.cm-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.15rem 1rem 1.15rem 1.1rem;
    border-radius: 1.35rem;
    /* ללא color-mix — גרדיאנט שלם נפסל ב-WebView/Safari ישן; coordinator_couch.css משלים */
    background: linear-gradient(125deg, #3b82f6 0%, var(--tc-primary) 52%, #1d4ed8 100%);
    color: #fff;
    box-shadow:
        0 12px 36px rgba(37, 99, 235, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    overflow: hidden;
}

.cm-hero::after {
    content: "";
    position: absolute;
    top: -45%;
    inset-inline-start: -15%;
    width: 55%;
    height: 160%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.22) 0%, transparent 65%);
    pointer-events: none;
}

.cm-hero--empty {
    background: linear-gradient(125deg, #64748b 0%, #475569 100%);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.cm-hero-text {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

.cm-hero-kicker {
    margin: 0 0 0.2rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.92;
}

.cm-hero-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.cm-hero-sub {
    margin: 0.4rem 0 0;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.45;
    opacity: 0.94;
}

/* טקסט Hero + מונה: לבן מפורש כמו teacher_mini — אם רקע הגרדיאנט נופל בדפדפן ישן, לא נשאר "לבן על לבן" */
.cm-hero .cm-hero-kicker,
.cm-hero .cm-hero-title,
.cm-hero .cm-hero-sub {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.cm-hero .cm-hero-kicker,
.cm-hero .cm-hero-sub {
    opacity: 1;
}

.cm-hero .cm-progress-total {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 12px rgba(0, 0, 0, 0.25);
}

.cm-hero-cta {
    margin-top: 0.75rem;
    padding: 0.48rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.98);
    color: var(--tc-primary);
    font-weight: 800;
    font-size: 0.82rem;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.cm-hero-cta:active {
    transform: scale(0.98);
}

.cm-hero-ring-wrap {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.cm-progress-ring {
    --tma-progress: 0;
    position: relative;
    width: 5.25rem;
    height: 5.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.cm-progress-ring--couch {
    --couch-p-overdue: 0;
    --couch-p-noconf: 0;
    background: conic-gradient(
        #ea580c 0turn calc(var(--couch-p-overdue) * 1turn),
        #dc2626 calc(var(--couch-p-overdue) * 1turn) calc((var(--couch-p-overdue) + var(--couch-p-noconf)) * 1turn),
        #16a34a calc((var(--couch-p-overdue) + var(--couch-p-noconf)) * 1turn) 1turn
    );
}

.cm-progress-ring--couch.cm-progress-ring--couch-empty {
    background: conic-gradient(#94a3b8 0turn 1turn);
}

.cm-progress-ring--couch::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 3.95rem;
    height: 3.95rem;
    margin: -1.975rem 0 0 -1.975rem;
    border-radius: 50%;
    background: #1e51c0;
}

.cm-hero--empty .cm-progress-ring--couch::after {
    background: #334155;
}

.cm-progress-total {
    position: relative;
    z-index: 2;
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

.cm-hero-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid rgba(37, 99, 235, 0.55);
    background: #e8f0fe;
    color: var(--tc-primary);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.cm-hero-refresh:hover {
    background: #dbeafe;
    border-color: rgba(37, 99, 235, 0.75);
}

.cm-hero-refresh:active {
    transform: scale(0.94);
}

.cm-hero-refresh .cm-refresh-icon {
    transition: transform 0.5s ease;
}

@keyframes cm-spin {
    to {
        transform: rotate(360deg);
    }
}

.cm-hero-refresh.is-refreshing .cm-refresh-icon {
    animation: cm-spin 0.7s linear infinite;
}

.cm-hero-refresh.is-refreshing {
    pointer-events: none;
    opacity: 0.75;
}

/* =============================================
   Shared inline refresh button (reusable)
   ============================================= */

.tc-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.tc-title-row h1,
.tc-title-row h2 {
    margin: 0;
}

.tc-refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid #d1d5db;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.tc-refresh-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    color: #374151;
}

.tc-refresh-btn:active {
    transform: scale(0.9);
}

.tc-refresh-btn .tc-refresh-icon {
    transition: transform 0.5s ease;
}

@keyframes tc-spin {
    to { transform: rotate(360deg); }
}

.tc-refresh-btn.is-refreshing .tc-refresh-icon {
    animation: tc-spin 0.7s linear infinite;
}

.tc-refresh-btn.is-refreshing {
    pointer-events: none;
    opacity: 0.6;
}

/* Stats bar */
.cm-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem;
    margin-bottom: 0.9rem;
}

.cm-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.12rem;
    padding: 0.65rem 0.3rem;
    border-radius: 1rem;
    border: 1px solid #c7d9f8;
    background: #f0f7ff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.cm-stat:active {
    transform: scale(0.96);
}

.cm-stat.is-active {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
}

.cm-stat-red             { border-color: #fecaca; background: #fef2f2; }
.cm-stat-red .cm-stat-num   { color: #dc2626; }
.cm-stat-red.is-active   { border-color: #dc2626; background: #fef2f2; }

.cm-stat-orange          { border-color: #fed7aa; background: #fff7ed; }
.cm-stat-orange .cm-stat-num { color: #ea580c; }
.cm-stat-orange.is-active { border-color: #ea580c; background: #fff7ed; }

.cm-stat-blue            { border-color: #bfdbfe; background: #eff6ff; }
.cm-stat-blue .cm-stat-num  { color: var(--tc-primary); }
.cm-stat-blue.is-active  { border-color: var(--tc-primary); background: var(--tc-primary-light); }

.cm-stat-gray            { border-color: #e5e7eb; background: #f8fafc; }
.cm-stat-gray .cm-stat-num  { color: #6b7280; }
.cm-stat-gray.is-active  { border-color: #6b7280; background: #f3f4f6; }

.cm-stat-zero {
    opacity: 0.45;
    pointer-events: none;
}

.cm-stat-num {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.cm-stat-label {
    font-size: 0.66rem;
    font-weight: 700;
    color: #64748b;
    text-align: center;
    line-height: 1.2;
}

/* Active filter bar */
.cm-active-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 0.6rem;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    font-size: 0.8rem;
    color: #4338ca;
}

.cm-active-filter-clear {
    background: none;
    border: none;
    color: #4338ca;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.1rem 0.3rem;
    border-radius: 0.3rem;
}

.cm-active-filter-clear:hover {
    background: #c7d2fe;
}

/* Event groups */
.cm-groups {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cm-group {
    border-radius: 1.15rem;
    background: #fff;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    border: 1px solid #e0efff;
}

.cm-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.8rem 1rem;
    border: none;
    background: linear-gradient(to left, #f0f7ff 0%, #f8fafc 100%);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
}

.cm-group-header:hover {
    background: linear-gradient(to left, #e8f0fe 0%, #f1f5f9 100%);
}

.cm-group-info {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.6rem;
}

.cm-group-title {
    font-weight: 800;
    font-size: 0.95rem;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.cm-group-count {
    font-size: 0.75rem;
    color: #64748b;
    background: #e2e8f0;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
}

.cm-group-date {
    font-size: 0.75rem;
    color: #94a3b8;
}

.cm-group-chevron {
    font-size: 0.7rem;
    color: #64748b;
    transition: transform 0.3s ease;
}

.cm-group.is-collapsed .cm-group-chevron {
    transform: rotate(-90deg);
}

/* Group body */
.cm-group-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.6rem 0.7rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.25s ease;
}

.cm-group-body.is-open {
    max-height: 5000px;
    padding: 0.6rem 0.7rem 0.75rem;
}

/* Task cards */
.cm-card {
    border-radius: 0.85rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 0.85rem 0.9rem;
    position: relative;
    transition: opacity 0.3s, transform 0.3s, box-shadow 0.2s;
    border-right: 4px solid #e2e8f0;
}

.cm-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    transition: box-shadow 0.25s;
}

.cm-card:hover::before {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
}

.cm-card-critical {
    border-right-color: #dc2626;
    background: linear-gradient(to left, #fff, #fef2f2);
}

.cm-card-warning {
    border-right-color: #f97316;
    background: linear-gradient(to left, #fff, #fff7ed);
}

.cm-card-alert {
    border-right-color: #eab308;
    background: linear-gradient(to left, #fff, #fefce8);
}

.cm-card-info {
    border-right-color: #3b82f6;
    background: linear-gradient(to left, #fff, #eff6ff);
}

.cm-card.cm-card-hidden {
    display: none;
}

/* Card content */
.cm-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.cm-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.cm-card-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.3;
}

.cm-priority {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}

.cm-priority-high {
    background: #dc2626;
    color: #fff;
}

/* Teacher row */
.cm-card-teacher {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cm-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #818cf8, #c084fc);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.cm-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cm-teacher-name {
    font-size: 0.85rem;
    color: #475569;
    font-weight: 500;
}

/* Tags */
.cm-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.1rem;
}

.cm-tag {
    border-radius: 999px;
    padding: 0.12rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

.cm-tag-overdue {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.cm-tag-due-today {
    background: #eff6ff;
    color: var(--tc-primary-hover);
    border: 1px solid #bfdbfe;
}

.cm-tag-not-confirmed {
    background: #fefce8;
    color: #a16207;
    border: 1px solid #fde68a;
}

.cm-tag-new {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.cm-tag-status-pending {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.cm-tag-status-progress {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

.cm-tag-pinged {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* Message history – collapsible block */
.cm-history-wrap {
    margin-top: 0.4rem;
}
.cm-history-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.35rem 0;
    background: none;
    border: none;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    text-align: right;
    direction: rtl;
}
.cm-history-toggle:hover {
    color: #475569;
}
.cm-history-chevron {
    margin-left: 0.3rem;
    font-size: 0.65rem;
    color: #94a3b8;
    transition: transform 0.2s;
}
.cm-history-wrap.is-open .cm-history-chevron {
    transform: rotate(180deg);
}
.cm-history-wrap .cm-message-history {
    display: none;
    margin-top: 0.25rem;
}
.cm-history-wrap.is-open .cm-message-history {
    display: block;
}

/* Message history list (pings + quick messages) */
.cm-message-history {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.75rem;
    color: #64748b;
}
.cm-message-history li + li {
    margin-top: 0.25rem;
}
.cm-msg-time {
    color: #94a3b8;
    margin-left: 0.35rem;
}
.cm-msg-type {
    font-weight: 500;
}
.cm-msg-item.cm-msg-has-content .cm-msg-head {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.cm-msg-preview {
    display: block;
    margin-top: 0.15rem;
    padding-right: 0.3rem;
    color: #64748b;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: rtl;
}
.cm-msg-full {
    display: none;
    margin-top: 0.25rem;
    padding: 0.4rem 0.5rem;
    background: #f8fafc;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid #e2e8f0;
    direction: rtl;
    text-align: right;
}
.cm-msg-item.is-expanded .cm-msg-full {
    display: block;
}
.cm-msg-item.cm-msg-expandable .cm-msg-head::after {
    content: ' ▼';
    font-size: 0.65rem;
    color: #94a3b8;
}
.cm-msg-item.cm-msg-expandable.is-expanded .cm-msg-head::after {
    content: ' ▲';
}

/* Card actions */
.cm-card-actions {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.cm-card-actions-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.cm-quick-msg-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.cm-quick-msg-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #334155;
}

.cm-quick-msg-icon {
    flex-shrink: 0;
}

/* Quick message modal */
.cm-quick-msg-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}

.cm-quick-msg-modal-inner {
    background: #fff;
    border-radius: 1rem;
    padding: 1.25rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.cm-quick-msg-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.cm-quick-msg-context {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: #64748b;
}

.cm-quick-msg-modal label {
    display: block;
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.cm-quick-msg-modal textarea {
    margin-bottom: 0.75rem;
    width: 100%;
}

.cm-quick-msg-channels {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cm-channel-cb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.cm-channel-cb input {
    width: 1rem;
    height: 1rem;
}

.cm-quick-msg-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.cm-quick-msg-modal [data-quick-msg-close] {
    background: #f1f5f9;
    border: 1.5px solid #94a3b8;
    color: #334155;
}

.cm-quick-msg-modal [data-quick-msg-close]:hover {
    background: #e2e8f0;
    border-color: #64748b;
    color: #0f172a;
}

.cm-ping-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #0f172a;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.cm-ping-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.cm-ping-btn:active {
    transform: scale(0.96);
}

.cm-ping-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.cm-ping-icon-svg,
.cm-ping-svg {
    flex-shrink: 0;
}

.cm-ping-done {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #16a34a;
    font-weight: 500;
}

.cm-ping-icon {
    font-size: 0.9rem;
}

/* Sending animation */
@keyframes cm-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.cm-ping-btn.is-sending {
    animation: cm-pulse 1s ease-in-out infinite;
    pointer-events: none;
}

/* Empty state */
.cm-empty {
    text-align: center;
    padding: 3rem 1rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.cm-empty-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.cm-empty-title {
    margin: 0 0 0.3rem;
    font-size: 1.25rem;
    color: #0f172a;
}

.cm-empty-text {
    margin: 0;
    font-size: 0.9rem;
    color: #64748b;
}

/* Old tags kept for backward compat elsewhere */
.tc-tag {
    border-radius: 999px;
    background: #e5e7eb;
    color: #374151;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
}

.tc-tag-warning {
    background: #fef3c7;
    color: #92400e;
}

/* ========================
   Couch Mode – responsive
   ======================== */

@media (max-width: 480px) {
    .cm {
        padding-bottom: 1.5rem;
    }

    .cm-header {
        border-radius: 0;
        margin: -1rem -1rem 0.75rem;
        padding: 1rem;
    }

    .cm-title {
        font-size: 1.2rem;
    }

    .cm-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.35rem;
    }

    .cm-stat {
        padding: 0.55rem 0.2rem;
        border-radius: 0.7rem;
    }

    .cm-stat-num {
        font-size: 1.25rem;
    }

    .cm-stat-label {
        font-size: 0.6rem;
    }

    .cm-group {
        border-radius: 0.75rem;
    }

    .cm-group-header {
        padding: 0.65rem 0.75rem;
    }

    .cm-card {
        padding: 0.7rem 0.75rem;
        border-radius: 0.7rem;
    }

    .cm-card-actions {
        justify-content: stretch;
    }

    .cm-card-actions-inner {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .cm-ping-btn,
    .cm-quick-msg-btn {
        flex: 1;
        justify-content: center;
        padding: 0.55rem;
    }

    .cm-ping-done {
        flex: 1;
        justify-content: center;
    }
}

.tc-empty-state {
    text-align: center;
    padding: 1.5rem 0.5rem;
}

.tc-empty-state h2 {
    margin: 0 0 0.25rem;
}

.tc-empty-state p {
    margin: 0;
    color: #6b7280;
}

.tc-logout-form {
    margin: 0;
}

/* Event details */
.tc-event-header {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

.tc-event-main {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tc-event-title {
    margin: 0;
    font-size: 1.2rem;
}

.tc-event-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.2rem;
}

.tc-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.8rem;
    background: #eff6ff;
    color: var(--tc-primary-hover);
}

.tc-pill-muted {
    background: #f3f4f6;
    color: #4b5563;
}

.tc-event-description {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    color: #374151;
}

.tc-event-hero {
    border-radius: 0.9rem;
    background: radial-gradient(circle at top left, #fbbf24, #f97316, #f97316);
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tc-event-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: #111827;
}

.tc-event-hero-icon {
    font-size: 2.1rem;
}

.tc-event-hero-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.tc-event-hero::before {
    content: "";
    position: absolute;
    inset: 12% 10%;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Hero customization picker */
.tc-hero-picker {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tc-hero-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tc-hero-icon-opt {
    cursor: pointer;
    margin: 0;
}

.tc-hero-icon-opt input {
    display: none;
}

.tc-hero-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.25rem;
    border-radius: 0.5rem;
    border: 2px solid #e5e7eb;
    background: #f9fafb;
    transition: border-color 0.15s, background 0.15s;
}

.tc-hero-icon-opt input:checked + .tc-hero-icon-btn {
    border-color: var(--tc-primary);
    background: var(--tc-primary-light);
}

.tc-hero-icon-opt:hover .tc-hero-icon-btn {
    border-color: #93c5fd;
}

.tc-hero-color-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tc-hero-color-input {
    width: 2.5rem;
    height: 2rem;
    padding: 0.15rem;
    border-radius: 0.35rem;
    border: 1px solid #d1d5db;
    cursor: pointer;
}

/* Event tasks grid */
.tc-event-tasks-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.tc-event-task-card {
    flex: 1 1 280px;
    min-width: 0;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.85rem;
    background: #f9fafb;
}

.tc-event-task-cat {
    font-weight: 600;
    font-size: 0.9rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.tc-event-task-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.tc-event-task-item:last-child {
    border-bottom: none;
}

.tc-event-task-title {
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.tc-event-task-period {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.tc-event-task-teachers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.2rem;
}

.tc-event-task-status {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* Event dates: larger font, no time, dd/mm/yyyy */
.tc-event-date-pill {
    font-size: 1.05rem;
}

.tc-event-dates .tc-pill {
    padding: 0.35rem 0.75rem;
}

/* Event tasks table toolbar */
.tc-event-tasks-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.tc-event-tasks-table-wrap .tc-table-wrapper {
    overflow-x: auto;
}

.tc-event-task-row.is-highlighted {
    animation: tc-task-highlight 2.5s ease-out 1;
    box-shadow: 0 0 0 2px #f97316 inset;
}

@keyframes tc-task-highlight {
    0% { background-color: #fffbeb; }
    40% { background-color: #fffbeb; }
    100% { background-color: transparent; }
}

.tc-event-pool-card {
    margin-bottom: 0.75rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    cursor: pointer;
    transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.tc-event-pool-card:hover {
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
}

.tc-event-pool-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #1f2937;
}

.tc-event-pool-title {
    font-weight: 600;
}

.tc-event-pool-counts {
    color: #374151;
}

.tc-event-pool-panel {
    display: none;
    margin-top: 0.4rem;
}

.tc-event-pool-card.is-open .tc-event-pool-panel {
    display: block;
}

.tc-event-pool-panel .tc-table-wrapper {
    max-height: 340px;
    overflow-y: auto;
}

.tc-event-pool-assign-row[data-assigned="1"] {
    opacity: 0.45;
}

.tc-pool-filter-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    margin-right: 0.25rem;
    color: #111827;
}

.tc-pool-filter-btn:hover {
    color: var(--tc-primary-hover);
}

.tc-event-pool-status-menu {
    position: absolute;
    z-index: 60;
    background: #fff;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 20px rgba(15,23,42,0.15);
    padding: 0.25rem 0;
    min-width: 170px;
}

.tc-event-pool-status-menu button {
    display: block;
    width: 100%;
    text-align: right;
    padding: 0.3rem 0.75rem;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    cursor: pointer;
}

.tc-event-pool-status-menu button:hover {
    background: #f3f4f6;
}

.tc-event-pool-table td,
.tc-event-pool-table th {
    font-size: 0.9rem;
}

.tc-bulk-tasks-actions {
    margin-top: 0.4rem;
}

.tc-btn-danger.tc-btn-xs {
    background: #fee2e2;
    color: #b91c1c;
    padding: 0.1rem 0.5rem;
    font-size: 0.8rem;
}

/* Overdue task row in event table */
.tc-task-overdue {
    background: #fef2f2 !important;
    border-right: 3px solid #dc2626;
}

.tc-task-overdue td {
    color: #991b1b;
}

.tc-task-overdue:hover {
    background: #fee2e2 !important;
}

.tc-event-tasks-table th[data-sort] {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.tc-event-tasks-table th[data-sort]:hover {
    background: #f3f4f6;
}

.tc-sort-icon {
    opacity: 0.5;
    font-size: 0.85em;
}

/* Event task list with zebra (legacy) */
.tc-event-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tc-event-task-row {
    padding: 0.75rem 0.85rem;
    border-radius: 0.5rem;
}

.tc-event-task-row-odd {
    background: #f9fafb;
}

.tc-event-task-row-even {
    background: #fff;
    border: 1px solid #f3f4f6;
}

.tc-event-task-row-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.tc-event-task-actions {
    margin-right: auto;
}

.tc-event-task-edit-title {
    margin: 0;
    font-weight: 500;
}

/* Task select per-task fields */
.tc-task-select-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.tc-task-select-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.tc-task-config-panel {
    display: none;
}

.tc-add-tasks-step {
    min-height: 100px;
}

.tc-task-select-only {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0;
    cursor: pointer;
    font-size: 0.9rem;
}

.tc-task-config-block {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.tc-task-config-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.tc-task-config-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.tc-task-config-fields .tc-field-row {
    margin: 0;
}

/* AirTable-style team picker */
.tc-team-picker-wrap .tc-field-label {
    display: block;
    margin-bottom: 0.25rem;
}

.tc-team-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.25rem;
    min-width: 160px;
    padding: 0.35rem 0.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    position: relative;
}

.tc-team-picker:focus-within {
    border-color: #3b82f6;
    outline: 2px solid rgba(59, 130, 246, 0.2);
}

.tc-team-picker-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tc-team-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.4rem;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 0.35rem;
    font-size: 0.85rem;
}

.tc-team-chip-remove {
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: #0369a1;
    opacity: 0.8;
}

.tc-team-chip-remove:hover {
    opacity: 1;
}

.tc-team-picker-trigger {
    padding: 0.2rem 0.5rem;
    font-size: 0.85rem;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
}

.tc-team-picker-trigger:hover {
    color: #3b82f6;
}

.tc-team-picker-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    margin-top: 0.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 10;
    display: none;
}

.tc-team-picker-dropdown.is-open {
    display: block;
}

.tc-team-picker-options {
    max-height: 180px;
    overflow-y: auto;
}

.tc-team-picker-opt {
    display: block;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.tc-team-picker-opt:hover {
    background: #f1f5f9;
}

.tc-team-picker-opt input {
    margin-left: 0.35rem;
}

.tc-task-select-fields .tc-field-label {
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.tc-select-multi {
    min-width: 120px;
}

.tc-input-sm {
    width: 8rem;
}

/* Task selection modal */
.tc-modal-wide {
    max-width: 480px;
}

.tc-task-select-cat {
    margin-bottom: 1rem;
}

.tc-task-select-all {
    display: block;
    margin-bottom: 0.35rem;
    cursor: pointer;
}

.tc-task-select-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-right: 0.5rem;
}

.tc-task-select-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    font-size: 0.9rem;
}

@media (max-width: 720px) {
    .tc-event-header {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Tasks section – page layout */
.tc-tasks-section {
    --tc-tasks-card-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    --tc-tasks-card-shadow-hover: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.tc-tasks-section .tc-panel-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.tc-tasks-section .tc-panel-subtitle {
    font-size: 0.9rem;
    color: var(--tc-text-secondary);
}

/* Top actions bar */
.tc-tasks-actions-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tc-tasks-actions-bar .tc-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Accordion for task categories – card-based, modern */
.tc-accordion {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tc-accordion-item {
    border-radius: var(--tc-radius);
    border: 1px solid var(--tc-border);
    overflow: hidden;
    background: var(--tc-surface);
    box-shadow: var(--tc-tasks-card-shadow);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.tc-accordion-item:hover {
    box-shadow: var(--tc-tasks-card-shadow-hover);
}

.tc-accordion-item.is-open {
    border-color: color-mix(in srgb, var(--tc-primary) 25%, transparent);
}

.tc-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    cursor: pointer;
    background: linear-gradient(to bottom, #fafbfc, #f5f6f8);
    border-bottom: 1px solid transparent;
    transition: background 0.2s ease;
}

.tc-accordion-header:hover {
    background: linear-gradient(to bottom, #f5f6f8, #eef1f4);
}

.tc-accordion-item.is-open .tc-accordion-header {
    border-bottom-color: var(--tc-border);
    background: var(--tc-surface);
}

.tc-accordion-header-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.tc-accordion-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tc-accordion-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--tc-text);
}

.tc-accordion-subtitle {
    font-size: 0.8rem;
    color: var(--tc-text-muted);
}

.tc-accordion-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.25rem;
    padding: 0 0.4rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--tc-text-muted);
    background: rgba(0, 0, 0, 0.06);
    border-radius: 999px;
}

.tc-accordion-chevron {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--tc-text-muted);
    transition: transform 0.25s ease, color 0.2s ease;
}

.tc-accordion-header:hover .tc-accordion-chevron {
    color: var(--tc-text);
}

.tc-accordion-item.is-open .tc-accordion-chevron {
    transform: rotate(180deg);
}

.tc-accordion-body {
    max-height: 0;
    overflow: hidden;
    padding: 0 1rem;
    background: var(--tc-surface);
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.tc-accordion-item.is-open .tc-accordion-body {
    max-height: 4000px;
    padding: 1rem;
}

/* Task list inside accordion – list style, not table */
.tc-task-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tc-task-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    transition: background 0.15s ease;
}

.tc-task-row:hover {
    background: var(--tc-page-bg);
}

.tc-task-row .tc-task-title {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    color: var(--tc-text);
}

.tc-task-row .tc-task-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

/* Task table (fallback when coordinator uses table layout) */
.tc-tasks-section .tc-table-wrapper {
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--tc-border);
}

.tc-tasks-section .tc-table {
    border-collapse: collapse;
}

.tc-tasks-section .tc-table th {
    background: #f8fafc;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--tc-text-secondary);
    padding: 0.55rem 0.85rem;
    border-bottom: 1px solid var(--tc-border);
}

.tc-tasks-section .tc-table td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid #f1f5f9;
}

.tc-tasks-section .tc-table tbody tr:last-child td {
    border-bottom: none;
}

.tc-tasks-section .tc-table tbody tr:hover {
    background: #fafbfc;
}

/* Task action icons – minimal, monochrome */
.tc-tasks-section .tc-icon-btn {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0.4rem;
    color: var(--tc-text-muted);
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.tc-tasks-section .tc-icon-btn:hover {
    background: #f1f5f9;
    color: var(--tc-text);
}

.tc-tasks-section .tc-icon-btn svg {
    width: 1rem;
    height: 1rem;
}

.tc-tasks-section .tc-icon-btn-edit:hover {
    background: var(--tc-primary-light);
    color: var(--tc-primary);
}

.tc-tasks-section .tc-icon-btn-duplicate:hover {
    background: #f3e8ff;
    color: #7c3aed;
}

.tc-tasks-section .tc-icon-btn-delete:hover {
    background: #fef2f2;
    color: #dc2626;
}

.tc-tasks-section .tc-icon-btn-save {
    background: #22c55e;
    color: #fff;
}

.tc-tasks-section .tc-icon-btn-save:hover {
    background: #16a34a;
}

/* Bulk delete button */
.tc-tasks-section .tc-bulk-tasks-actions {
    margin-top: 0.6rem;
}

.tc-tasks-section .tc-bulk-tasks-actions .tc-btn-danger {
    font-size: 0.85rem;
}

/* Category new task button */
.tc-tasks-section .tc-cat-new-task-wrap {
    margin-bottom: 0.75rem;
}

.tc-tasks-section .tc-cat-new-task-wrap .tc-btn-secondary {
    font-size: 0.85rem;
}

/* Empty state */
.tc-tasks-section .tc-task-empty {
    font-size: 0.9rem;
    color: var(--tc-text-muted);
    padding: 1.5rem 0.75rem;
    text-align: center;
}

/* New category / CSV buttons in tasks page */
.tc-tasks-section .tc-btn-primary,
.tc-tasks-section .tc-btn-secondary {
    font-weight: 500;
}

/* Confirm modal (reusable) */
.tc-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.tc-confirm-overlay .tc-confirm-modal {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.tc-confirm-overlay .tc-confirm-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: #111827;
}

.tc-confirm-overlay .tc-confirm-message {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: #4b5563;
}

.tc-confirm-overlay .tc-confirm-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* FullCalendar overrides */
#tc-fullcalendar {
    margin-top: 0.75rem;
}

.fc {
    font-family: inherit;
    font-size: 0.9rem;
}

.fc .fc-toolbar-title {
    font-size: 1.15rem;
    font-weight: 600;
}

.fc .fc-button {
    border-radius: 999px;
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    font-weight: 500;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
    box-shadow: none;
    text-transform: none;
}

.fc .fc-button:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
    color: #1f2937;
}

.fc .fc-button-active,
.fc .fc-button:active {
    background: var(--tc-primary) !important;
    border-color: var(--tc-primary) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.fc .fc-button-primary:disabled {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #9ca3af;
}

.fc .fc-col-header-cell {
    background: #f9fafb;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 0.4rem 0;
}

.fc .fc-daygrid-day-number {
    font-weight: 600;
    font-size: 0.82rem;
    padding: 0.3rem 0.4rem;
}

.fc .fc-daygrid-day.fc-day-other .fc-daygrid-day-number {
    color: #9ca3af;
}

.fc .fc-daygrid-day.fc-day-today {
    background: #eff6ff;
}

.fc .fc-daygrid-event {
    border-radius: 999px;
    padding: 0.05rem 0.4rem;
    font-size: 0.8rem;
    border: none;
}

.fc .fc-event.tc-fc-system {
    background: var(--tc-primary);
    color: #fff;
    cursor: pointer;
}

.fc .fc-event.tc-fc-holiday {
    background: var(--tc-primary);
    color: #fff;
    cursor: default;
}

.fc .fc-timegrid-event {
    border-radius: 0.5rem;
    border: none;
}

.fc .fc-list-event-dot {
    border-color: var(--tc-primary);
}

.fc .fc-event.tc-fc-holiday .fc-list-event-dot {
    border-color: #3b82f6;
}

.fc td, .fc th {
    border-color: #e5e7eb;
}

.fc .fc-scrollgrid {
    border-radius: 0.75rem;
    overflow: hidden;
    border-color: #e5e7eb;
}

.fc .fc-more-link {
    color: var(--tc-primary);
    font-size: 0.78rem;
    font-weight: 500;
}

.fc .fc-daygrid-day:not(.fc-day-disabled) {
    cursor: pointer;
}

.fc .fc-daygrid-day:not(.fc-day-disabled):hover {
    background: #f0f5ff;
}

@media (max-width: 640px) {
    .fc .fc-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .fc .fc-toolbar-title {
        font-size: 1rem;
    }

    .fc .fc-button {
        font-size: 0.8rem;
        padding: 0.3rem 0.55rem;
    }

    .fc .fc-daygrid-event {
        font-size: 0.75rem;
    }
}

@media (max-width: 600px) {
    .cm-group-body {
        padding: 0.4rem 0.45rem;
    }

    .cm-group-body.is-open {
        padding: 0.4rem 0.45rem 0.55rem;
    }
}

/* =============================================
   Settings General – theme customizer styles
   ============================================= */
.tc-settings-section {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--tc-border);
}

.tc-settings-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.tc-settings-section-title {
    margin: 0 0 0.2rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--tc-text);
}

.tc-settings-section-desc {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: var(--tc-text-secondary);
}

.tc-settings-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
}

.tc-color-picker-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tc-color-input {
    width: 2.5rem;
    height: 2rem;
    border: 1px solid var(--tc-border);
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.tc-color-hex {
    width: 6.5rem !important;
    font-family: monospace !important;
    font-size: 0.85rem !important;
}

.tc-settings-reset-colors {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid var(--tc-border);
}

.tc-settings-reset-colors:hover {
    background: #e5e7eb;
}

.tc-radius-preview {
    margin-top: 0.5rem;
}

.tc-radius-preview-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    background: var(--tc-primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--tc-radius);
    transition: border-radius 0.2s ease;
}

/* =============================================
   Telegram Mini App (TMA) – design system
   Reference-inspired: soft gradient bg, hero card, chips, dock+FAB.
   Accent = --tc-primary (Telegram theme / school); swap globally by changing primary.
   ============================================= */

.tc-tma-body {
    /* Core scale – קריאות טובה יותר במסכים קטנים */
    --tma-font-base: 1.1875rem;
    --tma-font-sm: 1.02rem;
    --tma-font-md: 1.125rem;
    --tma-font-lg: 1.28rem;
    --tma-font-xl: 1.42rem;
    --tma-font-2xl: 1.65rem;
    --tma-r: 1.1rem;
    --tma-r-lg: 1.35rem;
    --tma-border-soft: color-mix(in srgb, var(--tc-border), transparent 35%);
    --tma-elev: 0 1px 0 rgba(255, 255, 255, 0.75) inset, 0 8px 28px rgba(91, 33, 182, 0.07);
    --tma-elev-hover: 0 10px 32px rgba(91, 33, 182, 0.11);
    --tma-accent: var(--tc-primary);
    --tma-accent-glow: color-mix(in srgb, var(--tc-primary), transparent 55%);
    /* כפתורים: משני = מלא-משני (לא "שקוף"), ראשי = מלא ראשי */
    --tma-btn-primary-bg: var(--tma-accent);
    --tma-btn-primary-fg: #fff;
    --tma-btn-primary-shadow: 0 4px 16px var(--tma-accent-glow);
    /* משני: ~28% צבע מותג — נראה כמו כפתור מלא, לא כמעט לבן */
    --tma-btn-ghost-bg: color-mix(in srgb, var(--tma-accent), #fff 72%);
    --tma-btn-ghost-fg: color-mix(in srgb, var(--tma-accent), #0c1222 24%);
    --tma-btn-ghost-border: color-mix(in srgb, var(--tma-accent), #fff 38%);
    --tma-btn-ghost-inset: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    --tma-btn-ghost-shadow: var(--tma-btn-ghost-inset), 0 1px 3px rgba(15, 23, 42, 0.1);
    min-height: 100vh;
    font-family: 'Heebo', var(--tc-font), system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: var(--tma-font-base);
    font-weight: 500;
    line-height: 1.52;
    letter-spacing: 0.012em;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* Airy app background (independent of accent; works in light Telegram themes) */
    background: linear-gradient(
        165deg,
        color-mix(in srgb, var(--tc-primary), #fff 94%) 0%,
        #f8fafc 38%,
        color-mix(in srgb, #e0e7ff, #faf5ff 50%) 100%
    );
    background-attachment: fixed;
}

/* אייקוני SVG (ללא אימוג'י) — stroke ב-currentColor */
.tc-tma-body .tc-tma-icon {
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    color: inherit;
}

.tc-tma-bell .tc-tma-bell-svg.tc-tma-icon {
    width: 22px;
    height: 22px;
    display: block;
}

.tc-tma-task-time-ic.tc-tma-icon {
    width: 1em;
    height: 1em;
    opacity: 0.9;
}

.tc-tma-task-meta-ic.tc-tma-icon,
.tc-tma-event-meta-ic.tc-tma-icon {
    width: 1.05em;
    height: 1.05em;
}

.tc-tma-event-meta-line {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.tc-tma-cm-meta-ic.tc-tma-icon {
    width: 1em;
    height: 1em;
    vertical-align: middle;
}

.tc-tma-body .tc-empty-state {
    padding: 1.1rem 1rem;
    border-radius: var(--tma-r-lg);
    border: 1px dashed var(--tma-border-soft);
    background: color-mix(in srgb, var(--tc-surface), var(--tc-page-bg));
}

.tc-tma-body .tc-empty-state h2 {
    font-size: var(--tma-font-lg);
    font-weight: 800;
    color: var(--tc-text);
}

.tc-tma-body .tc-empty-state p {
    font-size: var(--tma-font-md);
    line-height: 1.55;
    color: var(--tc-text-secondary);
}

/* Unlinked Telegram → Tasclass account */
.tc-tma-connect-card.tc-empty-state {
    text-align: right;
    border-style: solid;
    border-color: color-mix(in srgb, var(--tma-accent), transparent 65%);
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--tma-accent), #fff 94%) 0%,
        var(--tc-surface) 100%
    );
    padding: 1.15rem 1.1rem 1.2rem;
}

.tc-tma-connect-card .tc-tma-connect-lead {
    margin-top: 0.35rem;
    margin-bottom: 0.85rem;
    color: var(--tc-text);
    font-weight: 600;
}

.tc-tma-connect-bot-btn {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1rem;
    font-size: var(--tma-font-md);
    font-weight: 800;
    cursor: pointer;
    background: linear-gradient(180deg, color-mix(in srgb, var(--tma-accent), #fff 18%), var(--tma-accent));
    color: #fff;
    box-shadow: 0 6px 20px var(--tma-accent-glow);
    -webkit-tap-highlight-color: transparent;
}

.tc-tma-connect-bot-btn:active {
    transform: scale(0.99);
}

.tc-tma-connect-hint {
    margin: 0.85rem 0 0 !important;
    font-size: var(--tma-font-sm) !important;
    color: var(--tc-text-secondary) !important;
    line-height: 1.5 !important;
}

.tc-tma-fetch-error.tc-empty-state {
    border-color: #fecaca;
    background: #fef2f2;
}
.tc-tma-fetch-error-detail {
    font-size: var(--tma-font-sm);
    color: #991b1b;
    word-break: break-word;
}

.tc-tma-shell {
    max-width: 720px;
    margin: 0 auto;
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
}

.tc-tma-main {
    padding: 0.2rem 0.85rem calc(5.5rem + env(safe-area-inset-bottom, 0));
    max-width: 100%;
}

/* --- Top bar: שורה 1 = אווטאר | ברכה+שם (אותו גודל גופן) | פעמון · שורה 2 = כותרת מסך --- */
.tc-tma-topbar {
    margin-bottom: 0.35rem;
}

.tc-tma-topbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.tc-tma-topbar-row .tc-tma-greeting-line {
    flex: 1;
    min-width: 0;
}

/* כותרת מיני־אפ רכזת: ימין — אווטאר+ברכה; שמאל — לוגו (מימין לפעמון) + פעמון */
.tc-tma-topbar-row--split {
    align-items: center;
}

.tc-tma-topbar-start {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
}

.tc-tma-topbar-row--split .tc-tma-topbar-start .tc-tma-greeting-line {
    flex: 0 1 auto;
    min-width: 0;
}

.tc-tma-topbar-end {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}

.tc-tma-school-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tc-tma-school-logo-img {
    display: block;
    width: auto;
    height: 2.4rem;
    max-width: 3.25rem;
    object-fit: contain;
    border-radius: 0.35rem;
}

.tc-tma-greeting-line.tc-tma-greeting-tight,
.tc-tma-greeting-line.tc-tmt-greeting-tight {
    gap: 0;
    flex-wrap: nowrap;
    justify-content: center;
}

.tc-tma-greeting-line.tc-tma-greeting-tight .tc-tma-greeting-comma,
.tc-tma-greeting-line.tc-tmt-greeting-tight .tc-tma-greeting-comma {
    font-size: var(--tma-font-lg);
    font-weight: 700;
    line-height: 1.25;
    color: var(--tc-text);
    letter-spacing: -0.02em;
}

.tc-tma-screen-heading {
    margin: 0;
    padding: 0 0.25rem;
    font-size: var(--tma-font-2xl);
    font-weight: 800;
    line-height: 1.2;
    color: var(--tc-text);
    letter-spacing: -0.03em;
    text-align: center;
}

.tc-tma-avatar.tc-tma-avatar--topbar {
    width: 3.35rem;
    height: 3.35rem;
    font-size: 1.22rem;
}

.tc-tma-greeting-line {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* ברכה ושם — אותו גודל ואותו משקל (כמו במוקאפ) */
.tc-tma-greeting-line .tc-tma-greeting-text {
    font-size: var(--tma-font-lg);
    font-weight: 700;
    line-height: 1.25;
    color: var(--tc-text);
    letter-spacing: -0.02em;
}

.tc-tma-userbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.tc-tma-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, color-mix(in srgb, var(--tma-accent), #fff 25%), var(--tma-accent));
    color: #fff;
    font-weight: 800;
    font-size: 1.15rem;
    box-shadow: 0 6px 20px var(--tma-accent-glow);
}

.tc-tma-avatar-initials {
    line-height: 1;
}

.tc-tma-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.tc-tma-avatar.tc-tma-avatar--has-photo,
.tc-tma-avatar:has(.tc-tma-avatar-img) {
    background: transparent;
    padding: 0;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.tc-tma-userbar-text {
    flex: 1;
    min-width: 0;
}

.tc-tma-hello {
    font-size: var(--tma-font-sm);
    color: var(--tc-text-secondary);
    font-weight: 600;
}

.tc-tma-user-name {
    font-size: var(--tma-font-xl);
    font-weight: 800;
    color: var(--tc-text);
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-tma-bell {
    position: relative;
    flex-shrink: 0;
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 50%;
    border: 1px solid var(--tma-border-soft);
    background: color-mix(in srgb, var(--tc-surface), transparent 0%);
    color: var(--tc-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 1;
}

.tc-tma-bell-dot {
    position: absolute;
    top: 4px;
    left: 4px;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid var(--tc-surface);
    box-sizing: border-box;
}

.tc-tma-screen-title {
    margin: 0;
    font-size: var(--tma-font-2xl);
    font-weight: 800;
    line-height: 1.2;
    color: var(--tc-text);
    letter-spacing: -0.03em;
}

.tc-tma-version-pill {
    margin: 0.35rem 0 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--tc-text-muted);
}

.tc-tma-version-num {
    font-variant-numeric: tabular-nums;
}

/* Legacy header classes (kept if referenced elsewhere) */
.tc-tma-header {
    padding: 1rem 1.05rem 1.05rem;
    margin-bottom: 0.85rem;
    background: linear-gradient(
        155deg,
        color-mix(in srgb, var(--tc-primary), #fff 86%) 0%,
        var(--tc-surface) 52%
    );
    border: 1px solid var(--tma-border-soft);
    border-radius: var(--tma-r-lg);
    box-shadow: var(--tma-elev);
}

.tc-tma-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.tc-tma-title-row .tc-tma-version-pill {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.tc-tma-title {
    margin: 0 0 0.35rem;
    font-size: var(--tma-font-2xl);
    font-weight: 800;
    line-height: 1.25;
    color: var(--tc-text);
    letter-spacing: -0.02em;
}

.tc-tma-greeting {
    margin-top: 0.15rem;
    font-size: var(--tma-font-md);
    color: var(--tc-text-secondary);
    font-weight: 600;
}

.tc-tma-small-muted {
    font-size: var(--tma-font-sm);
    color: var(--tc-text-muted);
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tc-page-bg), var(--tc-surface));
    border: 1px solid var(--tma-border-soft);
    white-space: nowrap;
}

/* --- Hero card (progress ring) --- */
.tc-tma-hero-wrap {
    margin-top: 0.15rem;
    margin-bottom: 0.75rem;
}

.tc-tma-version-foot {
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--tc-text-muted);
    margin: 0.4rem 0 0.15rem;
    padding: 0 0.5rem;
}

.tc-tma-version-foot .tc-tma-version-num {
    font-variant-numeric: tabular-nums;
}

.tc-tma-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.15rem 1.2rem;
    border-radius: var(--tma-r-lg);
    background: linear-gradient(
        125deg,
        color-mix(in srgb, var(--tma-accent), #fff 8%) 0%,
        color-mix(in srgb, var(--tma-accent), #312e81 0%) 55%,
        color-mix(in srgb, var(--tma-accent), #000 18%) 100%
    );
    color: #fff;
    box-shadow: var(--tma-elev), 0 0 0 1px color-mix(in srgb, #fff, transparent 88%) inset;
    position: relative;
    overflow: hidden;
}

.tc-tma-hero::after {
    content: "";
    position: absolute;
    top: -40%;
    left: -20%;
    width: 55%;
    height: 160%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.22) 0%, transparent 65%);
    pointer-events: none;
}

.tc-tma-hero-text {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

.tc-tma-hero-kicker {
    margin: 0 0 0.2rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.92;
}

.tc-tma-hero-title {
    margin: 0;
    font-size: var(--tma-font-xl);
    font-weight: 800;
    line-height: 1.25;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.tc-tma-hero-sub {
    margin: 0.35rem 0 0;
    font-size: var(--tma-font-sm);
    font-weight: 600;
    opacity: 0.92;
    line-height: 1.4;
}

.tc-tma-hero-cta {
    margin-top: 0.75rem;
    padding: 0.5rem 1.1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.96);
    color: var(--tma-accent);
    font-weight: 800;
    font-size: var(--tma-font-sm);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    -webkit-tap-highlight-color: transparent;
}

.tc-tma-hero-cta:active {
    transform: scale(0.98);
}

.tc-tma-hero-ring-wrap {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.tc-tma-progress-ring {
    --tma-progress: 0;
    position: relative;
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(
        #fff calc(var(--tma-progress) * 1%),
        rgba(255, 255, 255, 0.22) 0
    );
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tc-tma-progress-ring::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4.15rem;
    height: 4.15rem;
    margin: -2.075rem 0 0 -2.075rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--tma-accent), #000 14%);
}

.tc-tma-progress-pct {
    position: relative;
    z-index: 2;
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* מצב כורסה: טבעת עם 3 פרוסות — באיחור · טרם אושרה (בלי באיחור) · תקין */
.tc-tma-progress-ring.tc-tma-progress-ring--couch {
    --couch-p-overdue: 0;
    --couch-p-noconf: 0;
    background: conic-gradient(
        #ea580c 0turn calc(var(--couch-p-overdue) * 1turn),
        #dc2626 calc(var(--couch-p-overdue) * 1turn) calc((var(--couch-p-overdue) + var(--couch-p-noconf)) * 1turn),
        #16a34a calc((var(--couch-p-overdue) + var(--couch-p-noconf)) * 1turn) 1turn
    );
}

.tc-tma-progress-ring.tc-tma-progress-ring--couch.tc-tma-progress-ring--couch-empty {
    background: conic-gradient(#94a3b8 0turn 1turn);
}

.tc-tma-progress-ring--couch .tc-tma-progress-pct--couch-total {
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* --- Filter chips (shown via JS in teacher mode) --- */
.tc-tma-filters {
    display: none;
    flex-wrap: nowrap;
    gap: 0.45rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0.85rem;
    padding-bottom: 0.15rem;
    scrollbar-width: none;
}

.tc-tma-filters::-webkit-scrollbar {
    display: none;
}

.tc-tma-filter-chip {
    flex: 0 0 auto;
    border: 1px solid var(--tma-btn-ghost-border);
    border-radius: 999px;
    padding: 0.42rem 1rem;
    font-size: var(--tma-font-sm);
    font-weight: 800;
    cursor: pointer;
    background: var(--tma-btn-ghost-bg);
    color: var(--tma-btn-ghost-fg);
    box-shadow: var(--tma-btn-ghost-shadow);
    transition: background 0.15s, color 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.tc-tma-filter-chip.is-active {
    border-color: transparent;
    background: var(--tma-btn-primary-bg);
    color: var(--tma-btn-primary-fg);
    box-shadow: var(--tma-btn-primary-shadow);
}

.tc-tma-filter-chip {
    -webkit-tap-highlight-color: transparent;
}

/* --- Bottom dock + FAB --- */
.tc-tma-dock {
    position: fixed;
    max-width: 720px;
    margin: 0 auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.15rem;
    padding: 0.35rem 0.65rem calc(0.5rem + env(safe-area-inset-bottom, 0));
    background: linear-gradient(to top, color-mix(in srgb, var(--tc-surface), var(--tc-page-bg) 20%) 60%, rgba(255, 255, 255, 0));
    border-radius: 1.5rem 1.5rem 0 0;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.08);
    border: 1px solid var(--tma-border-soft);
    border-bottom: none;
}

.tc-tma-dock-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.12rem;
    padding: 0.35rem 0.15rem;
    border: none;
    background: transparent;
    color: var(--tc-text-muted);
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 0.75rem;
    transition: color 0.15s, background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.tc-tma-dock-item svg {
    opacity: 0.85;
}

.tc-tma-dock-item.is-active {
    color: var(--tma-accent);
}

.tc-tma-dock-item--muted {
    opacity: 0.75;
}

.tc-tma-dock-item:active {
    transform: scale(0.97);
}

.tc-tma-dock-fab-wrap {
    position: relative;
    width: 3.25rem;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.tc-tma-fab {
    pointer-events: auto;
    position: relative;
    top: -1.1rem;
    width: 3.35rem;
    height: 3.35rem;
    border-radius: 50%;
    border: none;
    background: linear-gradient(145deg, color-mix(in srgb, var(--tma-accent), #fff 12%), var(--tma-accent));
    color: #fff;
    cursor: pointer;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.25) inset,
        0 6px 22px var(--tma-accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.tc-tma-fab-icon {
    font-size: 1.65rem;
    font-weight: 300;
    line-height: 1;
}

.tc-tma-fab:active {
    transform: scale(0.96);
}

body.tc-tma-task-detail-open .tc-tma-dock {
    display: none;
}

.tc-tma-section {
    margin-top: 1.15rem;
    padding-top: 0.15rem;
}

.tc-tma-section-title {
    margin: 0 0 0.7rem;
    padding-bottom: 0.45rem;
    font-size: var(--tma-font-lg);
    font-weight: 800;
    color: var(--tc-text);
    border-bottom: 2px solid color-mix(in srgb, var(--tc-primary), transparent 78%);
}

.tc-tma-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.tc-tma-task {
    border: 1px solid var(--tma-border-soft);
    background: var(--tc-surface);
    border-radius: var(--tma-r-lg);
    padding: 0.9rem 1rem;
    box-shadow: var(--tma-elev);
    transition: box-shadow 0.18s ease, transform 0.12s ease;
}

.tc-tma-task-card {
    position: relative;
    padding: 0.95rem 1.05rem 0.85rem;
}

.tc-tma-task-card.tc-tma-task-hidden {
    display: none !important;
}

.tc-tma-task-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.tc-tma-task-cat {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--tc-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-tma-task-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: color-mix(in srgb, var(--tma-accent), #fff 88%);
    flex-shrink: 0;
}

.tc-tma-task-title {
    font-size: var(--tma-font-lg);
    font-weight: 800;
    color: var(--tc-text);
    margin: 0 0 0.55rem;
    line-height: 1.35;
}

.tc-tma-task-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tc-tma-task-time {
    font-size: var(--tma-font-md);
    font-weight: 800;
    color: var(--tma-accent);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.tc-tma-task-time--muted {
    color: var(--tc-text-muted);
    font-weight: 600;
}

.tc-tma-task-badge {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.tc-tma-task-badge--pending {
    background: color-mix(in srgb, #93c5fd, #fff 70%);
    color: #1d4ed8;
}

.tc-tma-task-badge--progress {
    background: color-mix(in srgb, #fdba74, #fff 55%);
    color: #c2410c;
}

.tc-tma-task-status {
    margin-bottom: 0.4rem;
}

.tc-tma-task-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    font-size: var(--tma-font-md);
    font-weight: 800;
    border: 1px solid color-mix(in srgb, var(--tc-primary), transparent 65%);
    background: color-mix(in srgb, var(--tc-primary), transparent 88%);
    color: var(--tc-primary);
}

.tc-tma-task-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    font-size: var(--tma-font-md);
    color: var(--tc-text-secondary);
    margin-top: 0.3rem;
}

.tc-tma-events-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tc-tma-event {
    border: 1px solid var(--tma-border-soft);
    background: var(--tc-surface);
    border-radius: var(--tma-r-lg);
    padding: 0.85rem 1rem;
    box-shadow: var(--tma-elev);
    position: relative;
    overflow: hidden;
}

.tc-tma-event::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--tma-accent), color-mix(in srgb, var(--tma-accent), #fff 40%));
    opacity: 0.65;
    border-radius: 0 0.85rem 0.85rem 0;
}

.tc-tma-event-title {
    font-size: var(--tma-font-lg);
    font-weight: 800;
    color: var(--tc-text);
    margin-bottom: 0.3rem;
    line-height: 1.35;
}

.tc-tma-event-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    font-size: var(--tma-font-md);
    color: var(--tc-text-secondary);
}

.tc-tma-bottom-spacer {
    height: 0.25rem;
}

.tc-tma-task--clickable {
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.15s ease;
}

.tc-tma-task--clickable:hover {
    box-shadow: var(--tma-elev-hover);
}

.tc-tma-task--clickable:active {
    transform: scale(0.992);
}

.tc-tma-task--clickable:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--tc-primary), transparent 45%);
    outline-offset: 2px;
}

.tc-tma-nav-actions {
    position: relative;
    z-index: 42;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: center;
    margin-top: 1rem;
    margin-bottom: 0.35rem;
    padding: 0.5rem 0 0.25rem;
    background: transparent;
}

.tc-tma-nav-btn {
    border: none;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--tc-primary), #fff 14%) 0%,
        var(--tc-primary) 100%
    );
    color: #fff;
    font-weight: 800;
    font-size: var(--tma-font-md);
    padding: 0.65rem 1.2rem;
    min-height: 2.85rem;
    border-radius: 999px;
    cursor: pointer;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.2) inset,
        0 6px 18px color-mix(in srgb, var(--tc-primary), transparent 52%);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

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

body.tc-tma-task-detail-open {
    overflow: hidden;
}

.tc-tma-task-detail {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    background: rgba(15, 23, 42, 0.45);
}

.tc-tma-task-detail-backdrop {
    position: absolute;
    inset: 0;
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: pointer;
}

.tc-tma-task-detail-inner {
    position: relative;
    z-index: 1;
    max-height: min(92vh, 720px);
    display: flex;
    flex-direction: column;
    background: var(--tc-surface);
    border-radius: 1.2rem 1.2rem 0 0;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.2);
    border: 1px solid var(--tma-border-soft);
    border-bottom: none;
}

.tc-tma-task-detail-toolbar {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--tma-border-soft);
    flex-shrink: 0;
    background: color-mix(in srgb, var(--tc-page-bg), var(--tc-surface));
}

.tc-tma-task-detail-back {
    border: 1px solid var(--tma-btn-ghost-border);
    background: var(--tma-btn-ghost-bg);
    color: var(--tma-btn-ghost-fg);
    font-weight: 800;
    font-size: var(--tma-font-md);
    padding: 0.5rem 0.85rem;
    border-radius: 0.75rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: var(--tma-btn-ghost-shadow);
}

.tc-tma-task-detail-back:active {
    transform: scale(0.98);
}

.tc-tma-task-detail-body {
    padding: 1rem 1.05rem 1.1rem;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    min-height: 0;
}

.tc-tma-task-detail-title {
    margin: 0 0 0.65rem;
    font-size: var(--tma-font-xl);
    font-weight: 800;
    line-height: 1.35;
    color: var(--tc-text);
}

.tc-tma-task-detail-status {
    margin-bottom: 0.75rem;
}

.tc-tma-task-detail-status .tc-tma-task-status-pill {
    font-size: var(--tma-font-md);
}

.tc-tma-task-detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    margin-bottom: 0.5rem;
    font-size: var(--tma-font-md);
    line-height: 1.45;
}

.tc-tma-task-detail-label {
    font-weight: 800;
    color: var(--tc-text-secondary);
}

.tc-tma-task-detail-value {
    color: var(--tc-text);
    flex: 1;
    min-width: 60%;
}

.tc-tma-task-detail-desc {
    margin-top: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: var(--tma-r);
    background: color-mix(in srgb, var(--tc-page-bg), var(--tc-surface));
    border: 1px solid var(--tma-border-soft);
    font-size: var(--tma-font-md);
    line-height: 1.52;
    color: var(--tc-text);
    white-space: pre-wrap;
    word-break: break-word;
}

.tc-tma-task-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.65rem;
}

.tc-tma-task-detail-tag {
    font-size: var(--tma-font-sm);
    font-weight: 700;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tc-primary), transparent 90%);
    color: var(--tc-primary);
}

.tc-tma-task-detail-footer {
    padding: 0.75rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0));
    border-top: 1px solid var(--tma-border-soft);
    flex-shrink: 0;
    text-align: center;
    background: color-mix(in srgb, var(--tc-page-bg), var(--tc-surface));
}

.tc-tma-task-detail-web-link {
    font-size: var(--tma-font-md);
    font-weight: 800;
    color: var(--tc-primary);
    text-decoration: underline;
    cursor: pointer;
}

/* Couch-style layout inside Mini App */
.tc-tma-cm-hero {
    border-radius: var(--tma-r-lg);
    padding: 1.05rem 1.15rem;
    margin-bottom: 0.85rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--tc-primary), #fff 84%) 0%, var(--tc-surface) 100%);
    border: 1px solid var(--tma-border-soft);
    box-shadow: var(--tma-elev);
}

.tc-tma-cm-hero-kicker {
    font-size: var(--tma-font-sm);
    font-weight: 800;
    color: var(--tc-primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tc-tma-cm-hero-title {
    margin: 0.25rem 0 0;
    font-size: var(--tma-font-2xl);
    font-weight: 800;
    color: var(--tc-text);
    line-height: 1.2;
}

.tc-tma-cm-hero-sub {
    margin: 0.4rem 0 0;
    font-size: var(--tma-font-md);
    color: var(--tc-text-secondary);
}

.tc-tma-cm-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

@media (min-width: 420px) {
    .tc-tma-cm-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.tc-tma-cm-stat {
    border: 1px solid var(--tma-btn-ghost-border);
    border-radius: 0.75rem;
    padding: 0.5rem 0.45rem;
    background: var(--tma-btn-ghost-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease, background 0.15s ease;
    box-shadow: var(--tma-btn-ghost-shadow);
}

.tc-tma-cm-stat:active {
    transform: scale(0.98);
}

.tc-tma-cm-stat.is-active {
    border-color: var(--tc-primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc-primary), transparent 70%);
}

.tc-tma-cm-stat-zero {
    opacity: 0.45;
}

.tc-tma-cm-stat-num {
    font-size: var(--tma-font-xl);
    font-weight: 800;
    color: var(--tc-text);
}

.tc-tma-cm-stat-lbl {
    font-size: var(--tma-font-sm);
    font-weight: 700;
    color: var(--tc-text-secondary);
    text-align: center;
    line-height: 1.25;
}

.tc-tma-cm-stat--red .tc-tma-cm-stat-num { color: #dc2626; }
.tc-tma-cm-stat--orange .tc-tma-cm-stat-num { color: #ea580c; }
.tc-tma-cm-stat--blue .tc-tma-cm-stat-num { color: #2563eb; }
.tc-tma-cm-stat--muted .tc-tma-cm-stat-num { color: #64748b; }

.tc-tma-cm-filter-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--tma-r);
    border: 1px dashed var(--tma-border-soft);
    background: color-mix(in srgb, var(--tc-surface), var(--tc-page-bg) 35%);
    font-size: var(--tma-font-md);
    font-weight: 700;
    color: var(--tc-text-secondary);
    margin-bottom: 0.4rem;
}

.tc-tma-cm-filter-clear {
    border: none;
    background: transparent;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: var(--tc-text-muted);
}

.tc-tma-cm-groups {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.tc-tma-cm-group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.tc-tma-cm-group-title {
    font-weight: 800;
    font-size: var(--tma-font-lg);
    color: var(--tc-text);
}

.tc-tma-cm-group-count {
    font-size: var(--tma-font-sm);
    font-weight: 700;
    color: var(--tc-text-muted);
}

.tc-tma-cm-cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tc-tma-cm-card {
    border: 1px solid var(--tma-border-soft);
    background: var(--tc-surface);
    border-radius: var(--tma-r-lg);
    padding: 0.8rem 0.9rem;
    box-shadow: var(--tma-elev);
}

.tc-tma-cm-card.tc-tma-cm-card-hidden {
    display: none;
}

.tc-tma-cm-card-title {
    font-weight: 800;
    font-size: var(--tma-font-lg);
    color: var(--tc-text);
    margin-bottom: 0.3rem;
    line-height: 1.35;
}

.tc-tma-cm-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-size: var(--tma-font-md);
    color: var(--tc-text-secondary);
    margin-bottom: 0.38rem;
}

.tc-tma-cm-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.tc-tma-cm-tag {
    font-size: var(--tma-font-sm);
    font-weight: 700;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    border: 1px solid transparent;
}

/* תגיות — צבעי טקסט/מסגרת כמו קוביות המונים (אדום / כתום / כחול / כהה) */
.tc-tma-cm-tag--red {
    color: #dc2626;
    background: color-mix(in srgb, #dc2626 14%, transparent);
    border-color: color-mix(in srgb, #dc2626 40%, transparent);
}

.tc-tma-cm-tag--orange {
    color: #ea580c;
    background: color-mix(in srgb, #ea580c 14%, transparent);
    border-color: color-mix(in srgb, #ea580c 40%, transparent);
}

.tc-tma-cm-tag--blue {
    color: #2563eb;
    background: color-mix(in srgb, #2563eb 14%, transparent);
    border-color: color-mix(in srgb, #2563eb 40%, transparent);
}

.tc-tma-cm-tag--dark {
    color: #0f172a;
    background: color-mix(in srgb, #0f172a 10%, transparent);
    border-color: color-mix(in srgb, #64748b 45%, transparent);
}

.tc-tma-cm-tag--neutral {
    color: #475569;
    background: color-mix(in srgb, #64748b 12%, transparent);
    border-color: color-mix(in srgb, #64748b 35%, transparent);
}

/* פעולות מורה + כורסה בפרטי משימה — אותה שפה: משני = ghost, ראשי = solid */
.tc-tma-task-detail-teacher-actions,
.tc-tma-task-detail-couch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--tma-border-soft);
}

.tc-tma-status-btn,
.tc-tma-couch-ping-btn,
.tc-tma-couch-qm-btn {
    flex: 1;
    min-width: 6.5rem;
    min-height: 2.85rem;
    padding: 0.55rem 0.85rem;
    border-radius: 0.75rem;
    font-size: var(--tma-font-md);
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.tc-tma-status-btn:active,
.tc-tma-couch-ping-btn:active,
.tc-tma-couch-qm-btn:active {
    transform: scale(0.98);
}

/* משני: רקע צבעוני ברור + מסגרת — לא "שקוף" על גבי לבן */
.tc-tma-status-btn--in_progress {
    border: 1px solid var(--tma-btn-ghost-border);
    background: var(--tma-btn-ghost-bg);
    color: var(--tma-btn-ghost-fg);
    box-shadow: var(--tma-btn-ghost-shadow);
}

/* ראשי: מלא (כמו "סיימתי") */
.tc-tma-status-btn--done {
    border: 1px solid transparent;
    background: var(--tma-btn-primary-bg);
    color: var(--tma-btn-primary-fg);
    box-shadow: var(--tma-btn-primary-shadow);
}

/*
 * כורסה — פינג / הודעה מהירה: אותה שפה כמו "התחל" + "סיימתי" במורה (תמונת "טוב")
 * סדר ב־DOM: פינג ראשון = משני (רקע מלא רך), הודעה שנייה = ראשי (מלא מותג)
 */
.tc-tma-couch-ping-btn {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid var(--tma-btn-ghost-border);
    background-color: var(--tma-btn-ghost-bg);
    background-image: none;
    color: var(--tma-btn-ghost-fg);
    box-shadow: var(--tma-btn-ghost-shadow);
    border-radius: 1.25rem;
}

.tc-tma-couch-ping-btn .tc-tma-couch-ping-ic.tc-tma-icon {
    width: 1.35rem;
    height: 1.35rem;
}

.tc-tma-couch-qm-btn {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid transparent;
    background-color: var(--tma-btn-primary-bg);
    background-image: none;
    color: var(--tma-btn-primary-fg);
    box-shadow: var(--tma-btn-primary-shadow);
    border-radius: 1.25rem;
}

.tc-tma-couch-ping-note {
    font-size: var(--tma-font-sm);
    color: var(--tc-text-secondary);
    width: 100%;
}

/* מודל הודעה מהירה */
.tc-tma-qm-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.tc-tma-qm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}

.tc-tma-qm-modal-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 26rem);
    max-height: min(85vh, 32rem);
    overflow: auto;
    padding: 1.1rem 1.15rem;
    border-radius: var(--tma-r-lg);
    background: var(--tc-surface);
    border: 1px solid var(--tma-border-soft);
    box-shadow: var(--tma-elev);
}

.tc-tma-qm-title {
    margin: 0 0 0.35rem;
    font-size: var(--tma-font-lg);
    font-weight: 800;
}

.tc-tma-qm-context {
    font-size: var(--tma-font-sm);
    color: var(--tc-text-secondary);
    margin: 0 0 0.65rem;
    line-height: 1.4;
}

.tc-tma-qm-text {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.65rem;
    border-radius: var(--tma-r);
    border: 1px solid var(--tma-border-soft);
    font-size: var(--tma-font-md);
    font-family: inherit;
    margin-bottom: 0.65rem;
}

.tc-tma-qm-channels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    margin-bottom: 0.85rem;
    font-size: var(--tma-font-sm);
}

.tc-tma-qm-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
}

.tc-tma-qm-cancel {
    min-height: 2.65rem;
    padding: 0.45rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--tma-btn-ghost-border);
    background: var(--tma-btn-ghost-bg);
    color: var(--tma-btn-ghost-fg);
    font-weight: 800;
    font-size: var(--tma-font-md);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    box-shadow: var(--tma-btn-ghost-shadow);
}

.tc-tma-qm-cancel:active {
    transform: scale(0.98);
}

.tc-tma-qm-send {
    min-height: 2.65rem;
    padding: 0.45rem 1.15rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    background: var(--tma-btn-primary-bg);
    color: var(--tma-btn-primary-fg);
    font-weight: 800;
    font-size: var(--tma-font-md);
    cursor: pointer;
    box-shadow: var(--tma-btn-primary-shadow);
    -webkit-tap-highlight-color: transparent;
}

.tc-tma-qm-send:active {
    transform: scale(0.98);
}

/* TMA: תפריט ⋮ + פאנל התראות */
.tc-tma-menu-panel {
    position: fixed;
    z-index: 1350;
    display: none;
    max-height: min(70vh, 420px);
    overflow: auto;
    background: var(--tc-surface);
    border-radius: var(--tma-r-lg);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    border: 1px solid var(--tma-border-soft);
}

.tc-tma-menu-panel.is-open {
    display: block;
}

.tc-tma-menu-panel-inner {
    padding: 0.85rem 1rem;
}

.tc-tma-menu-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.85rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--tma-border-soft);
}

.tc-tma-menu-avatar .tc-tma-avatar {
    width: 3rem;
    height: 3rem;
    font-size: 1.1rem;
}

.tc-tma-menu-name {
    font-weight: 800;
    font-size: var(--tma-font-md);
    color: var(--tc-text);
}

.tc-tma-menu-email {
    font-size: var(--tma-font-sm);
    color: var(--tc-text-secondary);
    word-break: break-all;
}

.tc-tma-menu-about-title {
    font-weight: 800;
    font-size: var(--tma-font-md);
    color: var(--tc-text);
}

.tc-tma-menu-version {
    font-size: var(--tma-font-sm);
    color: var(--tc-text-muted);
    margin-top: 0.25rem;
}

.tc-tma-notifications-panel {
    position: fixed;
    z-index: 1360;
    display: none;
    max-height: 420px;
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.tc-tma-notifications-panel.is-open {
    display: block;
}

/* =============================================
   ווב רכזת — דוק תחתון (מראה מיני־אפ)
   רק במצב צר / מובייל (≤768px); בדסקטופ נשאר הסיידבר בלבד
   ============================================= */
.tc-couch-dock {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 max(0.35rem, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(0.35rem, env(safe-area-inset-left, 0px));
    pointer-events: none;
}

.tc-couch-dock-inner {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    pointer-events: auto;
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr 1fr;
    align-items: end;
    justify-items: center;
    min-height: 3.2rem;
    gap: 0.1rem 0.12rem;
    padding: 0.4rem 0.15rem 0.45rem;
    background: #ffffff;
    border-radius: 1.35rem 1.35rem 0 0;
    box-shadow:
        0 -10px 32px rgba(15, 23, 42, 0.1),
        0 -1px 0 rgba(37, 99, 235, 0.12) inset;
}

/* ריווח סביב ה־FAB; צמידות יותר בית↔לוח ראשי ואירועים↔עוד */
.tc-couch-dock-inner > .tc-couch-dock-item:nth-child(2) {
    margin-inline-end: 0.5rem;
    margin-inline-start: -0.14rem;
}

.tc-couch-dock-inner > a.tc-couch-dock-item:nth-child(4) {
    margin-inline-start: 0.5rem;
    margin-inline-end: -0.14rem;
}

.tc-couch-dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.08rem;
    min-width: 0;
    width: fit-content;
    max-width: 100%;
    padding: 0.2rem 0.38rem 0.08rem;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.62rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 0.65rem;
    text-decoration: none;
    font-family: inherit;
    transition: color 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

a.tc-couch-dock-item {
    color: #64748b;
}

.tc-couch-dock-item svg {
    flex-shrink: 0;
    opacity: 0.92;
}

.tc-couch-dock-item.is-active {
    color: var(--tc-primary);
    background: rgba(37, 99, 235, 0.1);
}

.tc-couch-dock-item.is-active svg {
    opacity: 1;
}

.tc-couch-dock-item:active {
    transform: scale(0.97);
}

.tc-couch-dock-fab-slot {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    height: 0;
    z-index: 2;
    justify-self: center;
    margin-inline: 0.12rem;
}

.tc-couch-fab {
    pointer-events: auto;
    position: absolute;
    bottom: 0;
    /* גובה דומה למיני־אפ ירוק: מורם יותר מעל שפת הדוק */
    transform: translateY(-38%);
    /* היה 3.55rem — הקטנה ~30% */
    width: calc(3.55rem * 0.7);
    height: calc(3.55rem * 0.7);
    border-radius: 50%;
    border: 2px solid #1e293b;
    background: linear-gradient(155deg, #4f8ff7 0%, var(--tc-primary) 45%, #1e3a8a 100%);
    color: #fff;
    cursor: pointer;
    /* הילה צמודה לכפתור — לא ענקית */
    box-shadow:
        0 5px 14px rgba(37, 99, 235, 0.58),
        0 2px 6px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.tc-couch-fab:focus-visible {
    outline: 2px solid #1e40af;
    outline-offset: 3px;
}

.tc-couch-fab-icon {
    font-size: calc(1.5rem * 0.7);
    font-weight: 300;
    line-height: 1;
}

.tc-couch-fab:active {
    transform: translateY(-38%) scale(0.96);
}

@media (max-width: 768px) {
    body.tc-couch-dock-on .tc-couch-dock {
        display: block;
    }

    /* רקע תכלת עד קצה המסך; שוליים כמו TMA — 0.85rem בתוך .cm */
    body.tc-couch-dock-on .tc-main {
        padding-top: 0.12rem;
        padding-bottom: calc(5.85rem + env(safe-area-inset-bottom, 0px));
        padding-left: 0;
        padding-right: 0;
    }

    body.tc-couch-dock-on .cm {
        max-width: none;
        margin-left: 0;
        margin-right: 0;
        padding-top: 0;
        padding-bottom: 1.75rem;
        /* כמו .tc-tma-main במיני־אפ טלגרם */
        padding-left: calc(0.85rem + env(safe-area-inset-left, 0px));
        padding-right: calc(0.85rem + env(safe-area-inset-right, 0px));
    }

    body.tc-page-couch-mode.tc-couch-dock-on .cm-hero-wrap {
        margin-top: -0.15rem;
        margin-bottom: 0.55rem;
    }

    body.tc-couch-dock-on .cm-hero {
        padding: 1rem 0.72rem 1rem 0.78rem;
        border-radius: 1.1rem;
    }
}

