/* =========================================================================
   app.css — פאנל ניהול עמוד הקהילה
   עיצוב בהשראת synagogue_system: סרגל צד כהה + טבלה אחידה לשימוש חוזר.
   ========================================================================= */

:root {
    --rs-bg: #F8F9FB;
    --rs-surface: #FFFFFF;
    --rs-border: #E5E7EB;
    --rs-text: #1F2937;
    --rs-text-muted: #6B7280;
    --rs-sidebar-1: #1A2332;
    --rs-sidebar-2: #2C3E5C;
    --rs-brand: #1E5BA8;
    --rs-brand-dark: #164680;
    --rs-brand-light: #3B7DD8;
    --rs-gold: #C9A961;
    --rs-gold-dark: #A88A47;
    --rs-success: #198754;
    --rs-danger: #DC3545;
    --sidebar-width: 280px;
}

* {
    font-family: 'Assistant', Arial, sans-serif;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--rs-bg);
    color: var(--rs-text);
    height: 100vh;
    overflow: hidden;
}

/* ----------------------------- Sidebar ----------------------------- */
.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--rs-sidebar-1) 0%, var(--rs-sidebar-2) 100%);
    color: #fff;
    box-shadow: -3px 0 20px rgba(0, 0, 0, 0.18);
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 22px 16px 18px;
    text-align: center;
    background: rgba(0, 0, 0, 0.08);
    border-bottom: 2px solid rgba(255, 255, 255, 0.12);
}

.brand-logo {
    width: 96px;
    height: 96px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.brand-name {
    font-family: 'Frank Ruhl Libre', 'Assistant', serif;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.brand-sub {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 2px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.su-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}

.su-user i {
    color: var(--rs-gold);
}

.su-name {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.su-logout {
    padding: 0;
    width: 32px;
    justify-content: center;
    background: rgba(220, 53, 69, 0.85);
    border-color: rgba(220, 53, 69, 0.95);
}

.su-logout:hover {
    background: var(--rs-danger);
    color: #fff;
}

.sidebar-menu {
    padding: 18px 0;
    flex: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    color: #fff;
    text-decoration: none;
    transition: all 0.25s;
    border-right: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-right-color: var(--rs-brand-light);
    color: #fff;
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.15);
    border-right-color: #fff;
    font-weight: 700;
}

.menu-item i {
    width: 22px;
    text-align: center;
}

/* --------------------------- Main content --------------------------- */
.main-content {
    margin-right: var(--sidebar-width);
    padding: 28px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-right 0.3s ease;
    animation: pageEnter 0.34s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

/* יציאה חלקה לפני מעבר ללשונית אחרת */
.main-content.is-leaving {
    animation: pageLeave 0.18s ease forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes pageLeave {
    from {
        opacity: 1;
        transform: none;
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

.main-container {
    background: var(--rs-surface);
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(26, 35, 50, 0.06);
    border: 1px solid var(--rs-border);
    padding: 24px 28px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.page-header {
    color: var(--rs-text);
    border-bottom: 2px solid var(--rs-gold);
    padding-bottom: 14px;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.page-header h1 {
    font-family: 'Frank Ruhl Libre', 'Assistant', serif;
    font-size: 1.7rem;
    font-weight: 700;
    margin: 0;
}

.badge-soft {
    background: #EFF4FB;
    color: var(--rs-brand-dark);
    border: 1px solid #D8E5F5;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Mobile toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1100;
    background: var(--rs-brand);
    color: #fff;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    cursor: pointer;
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
        padding-top: 64px;
    }

    .sidebar-toggle {
        display: block;
    }
}

/* ------------------------- Reusable table -------------------------- */
.sys-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.sys-table-search {
    position: relative;
    flex: 1;
    max-width: 360px;
}

.sys-table-search i {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: var(--rs-text-muted);
}

.sys-table-search input {
    width: 100%;
    padding: 9px 36px 9px 14px;
    border: 1px solid var(--rs-border);
    border-radius: 9px;
    font-size: 0.95rem;
    outline: none;
}

.sys-table-search input:focus {
    border-color: var(--rs-brand-light);
    box-shadow: 0 0 0 3px rgba(59, 125, 216, 0.12);
}

.sys-table-count {
    color: var(--rs-text-muted);
    font-size: 0.85rem;
}

.sys-table-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.sys-table-pager {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sys-pg-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #E3E8F0;
    background: #fff;
    color: #4A5568;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    transition: all 0.18s ease;
}

.sys-pg-btn:hover:not(:disabled):not(.active) {
    border-color: var(--rs-brand-light);
    color: var(--rs-brand);
    transform: translateY(-1px);
    box-shadow: 0 3px 9px rgba(30, 91, 168, 0.14);
}

.sys-pg-btn.active {
    background: linear-gradient(135deg, var(--rs-brand), var(--rs-brand-light));
    border-color: var(--rs-brand);
    color: #fff;
    box-shadow: 0 3px 11px rgba(30, 91, 168, 0.30);
    cursor: default;
}

.sys-pg-btn.disabled,
.sys-pg-btn:disabled {
    opacity: 0.4;
    cursor: default;
    box-shadow: none;
}

.sys-pg-gap {
    padding: 0 2px;
    color: var(--rs-text-muted);
    letter-spacing: 1px;
}

#recordsTable,
#voicesTable,
#rcTable {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.sys-table-wrap {
    overflow: auto;
    border: 1px solid var(--rs-border);
    border-radius: 12px;
    flex: 1 1 auto;
    min-height: 0;
}

table.sys-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    direction: rtl;
}

table.sys-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #F3F6FB;
    color: var(--rs-brand-dark);
    font-weight: 700;
    text-align: center;
    padding: 13px 12px;
    white-space: nowrap;
    border-bottom: 2px solid var(--rs-border);
}

table.sys-table tbody td {
    padding: 12px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid var(--rs-border);
}

table.sys-table tbody tr:nth-child(even) {
    background: #FAFBFC;
}

table.sys-table tbody tr:hover {
    background: rgba(30, 91, 168, 0.05);
}

/* אנימציית מעבר עדינה בדפדוף / חיפוש */
table.sys-table tbody.sys-fade {
    animation: sysBodyFade 0.28s ease;
}

@keyframes sysBodyFade {
    from {
        opacity: 0.15;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .main-content,
    .main-content.is-leaving,
    table.sys-table tbody.sys-fade {
        animation: none !important;
    }
}

.sys-table-empty {
    text-align: center;
    color: var(--rs-text-muted);
    padding: 40px 10px;
}

/* תא של עמודת שפה בעמוד הקלטות */
.voice-name-cell {
    text-align: right;
}

.voice-name-cell .vn-title {
    font-weight: 700;
}

.voice-name-cell .vn-title.vn-empty {
    font-weight: 500;
    color: #AEB4BE;
    font-style: italic;
}

.voice-name-cell .vn-key {
    font-size: 0.78rem;
    color: var(--rs-text-muted);
    direction: ltr;
    text-align: right;
}

.lang-cell {
    min-width: 220px;
}

.rec-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.rec-status.has {
    color: var(--rs-success);
}

.rec-status.tts {
    color: var(--rs-text-muted);
}

.rec-tts-text {
    display: block;
    font-size: 0.78rem;
    color: var(--rs-text-muted);
    margin-bottom: 8px;
    max-width: 240px;
    margin-inline: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rec-actions {
    display: inline-flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.rec-actions .btn {
    --bs-btn-padding-y: 4px;
    --bs-btn-padding-x: 9px;
    --bs-btn-font-size: 0.8rem;
}

/* כפתורי-שורה מוצגים רק בריחוף — ארכיון (טבלה + עץ הודעות + נושאים) + הקלטות עתידיות.
   הקלטות מערכת (#voicesTable) מוחרגות — שם הכפתורים מוצגים תמיד.
   שומרים על המקום (opacity) כדי שגובה השורה לא יקפוץ, ו-focus-within לנגישות מקלדת. */
#recordsTable table.sys-table tbody tr .rec-actions,
table.sys-table tbody tr .msg-rec-actions,
.msg-rec-line .msg-rec-actions,
.msg-subject-row .msg-subject-actions {
    opacity: 0;
    transition: opacity 0.15s ease;
}

#recordsTable table.sys-table tbody tr:hover .rec-actions,
#recordsTable table.sys-table tbody tr:focus-within .rec-actions,
table.sys-table tbody tr:hover .msg-rec-actions,
table.sys-table tbody tr:focus-within .msg-rec-actions,
.msg-rec-line:hover .msg-rec-actions,
.msg-rec-line:focus-within .msg-rec-actions,
.msg-subject-row:hover .msg-subject-actions,
.msg-subject-row:focus-within .msg-subject-actions {
    opacity: 1;
}

/* ---------------------- Future recordings table --------------------- */
.rec-subject-title {
    font-weight: 700;
    color: var(--rs-text);
    line-height: 1.35;
}

.rec-subject-path {
    font-size: 0.78rem;
    color: var(--rs-text-muted);
    margin-top: 2px;
    direction: rtl;
}

.rec-subject-tags {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.rec-subject-tags .badge {
    font-weight: 600;
    font-size: 0.7rem;
}

.rec-date-cell {
    white-space: nowrap;
    direction: ltr;
    text-align: right;
}

.rec-keep-cell {
    text-align: center;
}

/* Record details modal */
.record-details .dt-row {
    display: flex;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid #EEF1F5;
}

.record-details .dt-row:last-child {
    border-bottom: none;
}

.record-details .dt-label {
    flex: 0 0 38%;
    color: var(--rs-text-muted);
    font-weight: 600;
    font-size: 0.85rem;
}

.record-details .dt-value {
    flex: 1;
    color: var(--rs-text);
    word-break: break-word;
}

.lang-cell.empty {
    color: #C7CCD4;
}

/* ----------------------------- Dashboard ---------------------------- */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.dash-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid var(--rs-border);
    background: var(--rs-surface);
    text-decoration: none;
    color: var(--rs-text);
    transition: all 0.2s;
}

.dash-card:hover {
    border-color: var(--rs-brand-light);
    box-shadow: 0 6px 22px rgba(30, 91, 168, 0.12);
    transform: translateY(-2px);
    color: var(--rs-text);
}

.dash-card-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    background: linear-gradient(135deg, var(--rs-brand), var(--rs-brand-light));
}

.dash-card-body {
    flex: 1;
}

.dash-card-title {
    font-weight: 700;
    font-size: 1.05rem;
}

.dash-card-sub {
    font-size: 0.85rem;
    color: var(--rs-text-muted);
}

.dash-card-arrow {
    color: var(--rs-text-muted);
}

/* ------------------------------- Login ------------------------------ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--rs-sidebar-1) 0%, var(--rs-sidebar-2) 100%);
}

.login-wrap {
    width: 100%;
    max-width: 460px;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 18px;
    padding: 34px 30px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.login-brand {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo {
    width: 124px;
    height: 124px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 22px rgba(26, 35, 50, 0.28));
}

.login-brand h1 {
    font-family: 'Frank Ruhl Libre', 'Assistant', serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.login-brand p {
    color: var(--rs-text-muted);
    margin: 2px 0 0;
}

.login-form .form-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.input-icon {
    position: relative;
}

.input-icon > i {
    position: absolute;
    top: 50%;
    right: 13px;
    transform: translateY(-50%);
    color: var(--rs-text-muted);
}

.input-icon .form-control {
    padding-right: 38px;
}

.btn-login {
    background: linear-gradient(135deg, var(--rs-brand), var(--rs-brand-light));
    border: none;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.2px;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(30, 91, 168, 0.28);
}

.btn-login:hover {
    background: linear-gradient(135deg, var(--rs-brand-dark), var(--rs-brand));
    color: #fff;
}

.btn-login:active {
    transform: translateY(1px);
}

.login-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    margin-top: 18px;
    line-height: 1.6;
}

.login-footer a {
    color: var(--rs-gold);
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-footer-sep {
    margin: 0 4px;
    opacity: 0.55;
}

/* ----------------------- Login animations ----------------------- */
@keyframes loginCardIn {
    from {
        opacity: 0;
        transform: translateY(22px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes loginLogoIn {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.8);
    }

    60% {
        transform: translateY(0) scale(1.04);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes loginFieldIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loginFooterIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 0.6;
    }
}

.login-page .login-card {
    animation: loginCardIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-page .login-logo {
    animation: loginLogoIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: 0.1s;
}

.login-page .login-brand p {
    animation: loginFieldIn 0.5s ease both;
    animation-delay: 0.25s;
}

.login-page .login-form>* {
    animation: loginFieldIn 0.5s ease both;
}

.login-page .login-form>*:nth-child(1) {
    animation-delay: 0.28s;
}

.login-page .login-form>*:nth-child(2) {
    animation-delay: 0.36s;
}

.login-page .login-form>*:nth-child(3) {
    animation-delay: 0.44s;
}

.login-page .login-form>*:nth-child(4) {
    animation-delay: 0.52s;
}

.login-page .login-form>*:nth-child(5) {
    animation-delay: 0.6s;
}

.login-page .login-links {
    animation: loginFieldIn 0.5s ease both;
    animation-delay: 0.62s;
}

.login-page .login-footer {
    animation: loginFooterIn 0.8s ease both;
    animation-delay: 0.7s;
}

.login-page .btn-login {
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.login-page .btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(30, 91, 168, 0.35);
}

.login-page .input-icon .form-control {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {

    .login-page .login-card,
    .login-page .login-logo,
    .login-page .login-brand p,
    .login-page .login-form>*,
    .login-page .login-links,
    .login-page .login-footer {
        animation: none;
    }
}

/* Logo idle float + hover glow (login only) */
@keyframes loginLogoFloat {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }

    100% {
        transform: translateY(0);
    }
}

.login-page .login-logo img {
    transition: filter 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    animation: loginLogoFloat 4.5s ease-in-out 1s infinite;
    cursor: pointer;
}

.login-page .login-logo img:hover {
    filter: drop-shadow(0 12px 28px rgba(201, 169, 97, 0.55)) brightness(1.12) saturate(1.08);
    transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
    .login-page .login-logo img {
        animation: none;
    }
}

/* ===================== Inline edit + recording cell ===================== */
.lang-block {
    display: flex;
    flex-direction: column;
    gap: 9px;
    text-align: center;
}

.desc-cell,
.tts-col {
    text-align: right;
    vertical-align: top;
}

.desc-cell {
    min-width: 200px;
}

.tts-col {
    min-width: 260px;
}

.inline-edit {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--rs-border);
    border-radius: 9px;
    padding: 7px 10px;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--rs-text);
    background: #FBFCFE;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    direction: rtl;
    font-family: inherit;
}

.inline-edit::placeholder {
    color: #AEB4BE;
}

.inline-edit:hover {
    background: #fff;
    border-color: #CBD5E3;
}

.inline-edit:focus {
    background: #fff;
    border-color: var(--rs-brand-light);
    box-shadow: 0 0 0 3px rgba(59, 125, 216, 0.12);
}

.inline-edit.saving {
    border-color: var(--rs-gold);
    background: #FFFDF6;
}

.inline-edit.saved {
    border-color: var(--rs-success);
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.12);
}

.inline-edit.error {
    border-color: var(--rs-danger);
}

.field-description {
    font-weight: 600;
}

.rec-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rec-duration {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--rs-brand-dark);
    background: #EFF4FB;
    border: 1px solid #D8E5F5;
    border-radius: 999px;
    padding: 3px 10px;
    direction: ltr;
}

.rec-duration.rec-duration-na {
    color: var(--rs-text-muted);
    background: #F1F3F7;
    border-color: #E2E6EC;
    font-weight: 600;
    font-size: 0.66rem;
    direction: rtl;
    white-space: nowrap;
}

/* ============================ Notifications ============================ */
.nfy-toast-host {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4000;
    width: min(440px, calc(100vw - 28px));
    pointer-events: none;
}

.nfy-toast {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--rs-border);
    border-radius: 13px;
    padding: 13px 15px;
    box-shadow: 0 14px 40px rgba(26, 35, 50, 0.22);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-18px) scale(0.97);
    transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    border-right: 5px solid var(--rs-brand);
}

.nfy-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.nfy-toast.hide {
    opacity: 0;
    transform: translateY(-18px) scale(0.97);
}

.nfy-toast-icon {
    font-size: 1.35rem;
    flex-shrink: 0;
}

.nfy-toast-body {
    flex: 1;
    min-width: 0;
}

.nfy-toast-title {
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 2px;
}

.nfy-toast-msg {
    font-size: 0.88rem;
    color: var(--rs-text);
    line-height: 1.45;
    word-break: break-word;
}

.nfy-toast-btn {
    flex-shrink: 0;
    border: 1px solid var(--rs-border);
    background: #F5F7FA;
    color: var(--rs-text);
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.nfy-toast-btn:hover {
    background: #E9EDF3;
    border-color: #CBD5E3;
}

.nfy-toast-bar {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 3px;
    width: 100%;
    background: currentColor;
    opacity: 0.35;
}

.nfy-toast.nfy-success {
    border-right-color: var(--rs-success);
}

.nfy-toast.nfy-success .nfy-toast-icon,
.nfy-toast.nfy-success .nfy-toast-bar {
    color: var(--rs-success);
}

.nfy-toast.nfy-error {
    border-right-color: var(--rs-danger);
}

.nfy-toast.nfy-error .nfy-toast-icon,
.nfy-toast.nfy-error .nfy-toast-bar {
    color: var(--rs-danger);
}

.nfy-toast.nfy-warning {
    border-right-color: var(--rs-gold-dark);
}

.nfy-toast.nfy-warning .nfy-toast-icon,
.nfy-toast.nfy-warning .nfy-toast-bar {
    color: var(--rs-gold-dark);
}

.nfy-toast.nfy-info .nfy-toast-icon,
.nfy-toast.nfy-info .nfy-toast-bar {
    color: var(--rs-brand);
}

/* --- Confirm modal --- */
.nfy-modal-back {
    position: fixed;
    inset: 0;
    z-index: 4100;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.nfy-modal-back.show {
    opacity: 1;
}

.nfy-modal {
    width: 100%;
    max-width: 410px;
    background: #fff;
    border-radius: 18px;
    padding: 26px 26px 22px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
    transform: translateY(14px) scale(0.94);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.nfy-modal-back.show .nfy-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.nfy-modal-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
}

.nfy-modal-icon.nfy-question {
    color: var(--rs-brand);
    background: #EAF2FC;
}

.nfy-modal-icon.nfy-warning {
    color: var(--rs-gold-dark);
    background: #FBF4E3;
}

.nfy-modal-icon.nfy-error {
    color: var(--rs-danger);
    background: #FBE9EB;
}

.nfy-modal-icon.nfy-success {
    color: var(--rs-success);
    background: #E6F4EC;
}

.nfy-modal-icon.nfy-info {
    color: var(--rs-brand);
    background: #EAF2FC;
}

.nfy-modal-title {
    font-family: 'Frank Ruhl Libre', 'Assistant', serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.nfy-modal-msg {
    color: var(--rs-text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 20px;
}

.nfy-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.nfy-btn {
    border: none;
    border-radius: 10px;
    padding: 9px 22px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
}

.nfy-btn:active {
    transform: translateY(1px);
}

.nfy-btn-primary {
    background: var(--rs-brand);
    color: #fff;
}

.nfy-btn-primary:hover {
    background: var(--rs-brand-dark);
}

.nfy-btn-danger {
    background: var(--rs-danger);
    color: #fff;
}

.nfy-btn-danger:hover {
    background: #b52a37;
}

.nfy-btn-ghost {
    background: #F1F3F7;
    color: var(--rs-text);
}

.nfy-btn-ghost:hover {
    background: #E4E8EE;
}

/* ============================ Audio player ============================ */
.amud-player {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(135deg, rgba(26, 35, 50, 0.86) 0%, rgba(44, 62, 92, 0.86) 100%);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
    color: #fff;
    box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.32);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    transform: translateY(120%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.amud-player.is-open {
    transform: translateY(0);
}

.ap-inner {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ap-btn {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.18s ease, transform 0.15s ease;
}

.ap-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

.ap-btn:active {
    transform: scale(0.92);
}

.ap-toggle {
    background: var(--rs-gold);
    color: var(--rs-sidebar-1);
    width: 46px;
    height: 46px;
    font-size: 1.05rem;
    box-shadow: 0 4px 14px rgba(201, 169, 97, 0.4);
}

.ap-toggle:hover {
    background: #d8bd7e;
}

.ap-skip-group {
    display: flex;
    gap: 2px;
}

.ap-skip {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
}

.ap-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ap-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.ap-title {
    font-weight: 700;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ap-subtitle {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    max-width: 45%;
}

.ap-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ap-time {
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.8);
    direction: ltr;
    min-width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.ap-seek {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    outline: none;
    cursor: pointer;
    direction: ltr;
    background: linear-gradient(to right,
            var(--rs-gold) 0%,
            var(--rs-gold) var(--ap-pct, 0%),
            rgba(255, 255, 255, 0.22) var(--ap-pct, 0%),
            rgba(255, 255, 255, 0.22) 100%);
}

.ap-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--rs-gold);
    cursor: pointer;
    transition: transform 0.15s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.ap-seek::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

.ap-seek::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--rs-gold);
    cursor: pointer;
}

.ap-spinner {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}

.ap-download {
    color: rgba(255, 255, 255, 0.85);
}

.ap-close {
    color: rgba(255, 255, 255, 0.7);
    width: 34px;
    height: 34px;
}

@media (max-width: 640px) {
    .ap-skip-group {
        display: none;
    }

    .ap-subtitle {
        display: none !important;
    }

    .ap-inner {
        gap: 8px;
    }
}

/* ============================ App footer ============================ */
.app-footer {
    flex: 0 0 auto;
    margin-top: 10px;
    padding: 5px 8px 2px;
    border-top: 1px solid var(--rs-border);
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.3;
    color: var(--rs-text-muted);
}

.app-footer a {
    color: var(--rs-brand);
    text-decoration: none;
    font-weight: 600;
}

.app-footer a:hover {
    text-decoration: underline;
}

.app-footer .app-footer-sep {
    margin: 0 5px;
    opacity: 0.45;
}

/* ====================== ארכיון ההודעות (messages) ====================== */
.msg-wrap {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.msg-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.msg-tab {
    border: 1px solid var(--rs-border);
    background: #fff;
    color: var(--rs-text-muted);
    border-radius: 999px;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.18s ease;
}

.msg-tab:hover {
    border-color: var(--rs-brand-light);
    color: var(--rs-brand);
}

.msg-tab.active {
    background: linear-gradient(135deg, var(--rs-brand), var(--rs-brand-light));
    border-color: var(--rs-brand);
    color: #fff;
    box-shadow: 0 3px 11px rgba(30, 91, 168, 0.28);
}

.msg-panes {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
}

.msg-pane {
    display: none;
}

.msg-pane.active {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

/* --- עץ ההודעות --- */
.msg-tree {
    overflow: auto;
    border: 1px solid var(--rs-border);
    border-radius: 12px;
    padding: 8px;
    flex: 1 1 auto;
    min-height: 0;
}

.msg-node-row,
.msg-subject-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s;
}

.msg-node-row:hover,
.msg-subject-row:hover {
    background: rgba(30, 91, 168, 0.06);
}

.msg-caret {
    width: 16px;
    text-align: center;
    color: var(--rs-text-muted);
    transition: transform 0.15s ease;
    flex: 0 0 auto;
    font-size: 0.78rem;
}

.msg-node.open > .msg-node-row > .msg-caret,
.msg-node.open > .msg-subject-row > .msg-caret {
    transform: rotate(-90deg);
}

.msg-node-ico {
    color: var(--rs-gold-dark);
    flex: 0 0 auto;
}

.msg-subject .msg-node-ico {
    color: var(--rs-brand-light);
}

.msg-node-label {
    font-weight: 600;
    flex: 1 1 auto;
    min-width: 0;
}

.msg-subject-title {
    font-weight: 600;
}

.msg-subject-meta {
    margin-inline-start: auto;
    font-size: 0.74rem;
    color: var(--rs-text-muted);
    white-space: nowrap;
}

.msg-children {
    margin-inline-start: 18px;
    border-inline-start: 1px dashed var(--rs-border);
    padding-inline-start: 6px;
    display: none;
}

.msg-node.open > .msg-children {
    display: block;
}

.msg-loading {
    color: var(--rs-text-muted);
    font-size: 0.85rem;
    padding: 6px 10px;
}

.msg-rec-line {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-bottom: 1px solid #EEF1F5;
}

.msg-rec-line:last-child {
    border-bottom: none;
}

/* הודעה שנמחקה (deleted=1) — מוצגת מסומנת וניתנת לשחזור */
.msg-rec-line.msg-deleted,
tr.msg-deleted > td {
    background: #FFF5F5;
}

.msg-rec-line.msg-deleted .msg-rec-title,
tr.msg-deleted .rec-subject-title {
    text-decoration: line-through;
    text-decoration-color: rgba(220, 53, 69, .5);
}

.msg-rec-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.msg-rec-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.msg-rec-sub {
    font-size: 0.76rem;
    color: var(--rs-text-muted);
}

.msg-rec-actions {
    margin-inline-start: auto;
    display: inline-flex;
    gap: 5px;
    flex: 0 0 auto;
}

.msg-rec-actions .btn,
.rec-actions-cell .msg-rec-actions .btn {
    --bs-btn-padding-y: 3px;
    --bs-btn-padding-x: 8px;
    --bs-btn-font-size: 0.78rem;
}

/* --- הצגה חופשית: סננים --- */
.msg-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.msg-chip-group {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
}

.msg-chip {
    border: 1px solid var(--rs-border);
    background: #fff;
    color: var(--rs-text-muted);
    border-radius: 999px;
    padding: 6px 14px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.msg-chip:hover {
    border-color: var(--rs-brand-light);
    color: var(--rs-brand);
}

.msg-chip.active {
    background: var(--rs-brand);
    border-color: var(--rs-brand);
    color: #fff;
}

.msg-search {
    position: relative;
}

.msg-search i {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: var(--rs-text-muted);
}

.msg-search input {
    padding: 8px 34px 8px 12px;
    border: 1px solid var(--rs-border);
    border-radius: 9px;
    outline: none;
    min-width: 220px;
}

.msg-search input:focus {
    border-color: var(--rs-brand-light);
    box-shadow: 0 0 0 3px rgba(59, 125, 216, 0.12);
}

/* --- לפי מקליטים --- */
.msg-recorders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
    overflow: auto;
    align-content: start;
    flex: 1 1 auto;
    min-height: 0;
    padding: 2px;
}

.msg-recorder-card {
    border: 1px solid var(--rs-border);
    border-radius: 12px;
    padding: 14px 16px;
    background: #fff;
    cursor: pointer;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.msg-recorder-card:hover {
    border-color: var(--rs-brand-light);
    box-shadow: 0 4px 14px rgba(30, 91, 168, 0.12);
    transform: translateY(-2px);
}

.msg-recorder-ava {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #EFF4FB;
    color: var(--rs-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex: 0 0 auto;
}

.msg-recorder-name {
    font-weight: 700;
}

.msg-recorder-count {
    font-size: 0.8rem;
    color: var(--rs-text-muted);
}

.msg-drill-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex: 0 0 auto;
}

.msg-state {
    text-align: center;
    color: var(--rs-text-muted);
    padding: 30px 10px;
}

.rec-duration {
    white-space: nowrap;
}

/* --- כפתורי "הצג בעץ" --- */
.msg-tree-btn span {
    margin-inline-start: 3px;
}

/* --- פעולות נושא בעץ (הורד הכל / קישור) --- */
.msg-subject-actions {
    margin-inline-start: 8px;
    display: inline-flex;
    gap: 5px;
    flex: 0 0 auto;
}

.msg-subject-actions .btn {
    --bs-btn-padding-y: 2px;
    --bs-btn-padding-x: 7px;
    --bs-btn-font-size: 0.75rem;
}

/* כפתורי הוספה (+) — נושא חדש / הודעה חדשה (מוצגים תמיד) */
.msg-add-btn {
    --bs-btn-padding-y: 2px;
    --bs-btn-padding-x: 7px;
    --bs-btn-font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

/* --- סימון והעברה (עץ ההודעות) --- */
.msg-sel-cb {
    flex: 0 0 auto;
    margin: 0;
    cursor: pointer;
    width: 17px;
    height: 17px;
}

.msg-node.msg-selected > .msg-subject-row,
.msg-rec-line.msg-selected {
    background: rgba(245, 158, 11, 0.14);
    border-radius: 8px;
}

/* כפתורי "העבר לכאן" — מוסתרים עד שמסמנים פריטים מהסוג המתאים */
.msg-move-here {
    display: none !important;
}

.msg-tree.msg-mode-records .msg-move-records,
.msg-tree.msg-mode-subjects .msg-move-subjects {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
}

.msg-move-subjects {
    margin-inline-start: auto;
}

/* בעת בחירת סוג אחד — מנטרל את ה-checkbox של הסוג השני */
.msg-tree.msg-mode-records .msg-sel-cb[data-sel-subject],
.msg-tree.msg-mode-subjects .msg-sel-cb[data-sel-record] {
    pointer-events: none;
    opacity: 0.3;
}

.msg-sel-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.08);
    border-radius: 10px;
}

.msg-sel-info {
    font-weight: 700;
    color: var(--rs-text);
}

.msg-sel-hint {
    font-size: 0.82rem;
    color: var(--rs-text-muted);
}

.msg-sel-bar > .btn {
    margin-inline-start: auto;
}

/* --- מודאל העברה וסידור --- */
.msg-move-list {
    max-height: 56vh;
    overflow: auto;
    border: 1px solid var(--rs-border);
    border-radius: 10px;
    padding: 6px;
}

.msg-move-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #fff;
    cursor: grab;
    user-select: none;
}

.msg-move-item + .msg-move-item {
    margin-top: 4px;
}

.msg-move-item:hover {
    background: rgba(30, 91, 168, 0.05);
}

.msg-move-item.dragging {
    opacity: 0.5;
    border-style: dashed;
    border-color: var(--rs-brand-light);
}

.msg-move-item.is-moved {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.4);
}

.msg-move-item.is-deleted .msg-move-name {
    text-decoration: line-through;
    text-decoration-color: rgba(220, 53, 69, .5);
}

.msg-move-grip {
    color: var(--rs-text-muted);
    flex: 0 0 auto;
    cursor: grab;
}

.msg-move-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.msg-move-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.msg-move-sub {
    font-size: 0.76rem;
    color: var(--rs-text-muted);
}

/* --- השלמה אוטומטית של מקליט --- */
.msg-typeahead {
    position: relative;
    min-width: 240px;
}

.msg-typeahead > i {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: var(--rs-text-muted);
    pointer-events: none;
}

.msg-typeahead input {
    width: 100%;
    padding: 8px 34px 8px 30px;
    border: 1px solid var(--rs-border);
    border-radius: 9px;
    outline: none;
}

.msg-typeahead input:focus {
    border-color: var(--rs-brand-light);
    box-shadow: 0 0 0 3px rgba(59, 125, 216, 0.12);
}

.msg-ta-clear {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--rs-text-muted);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
}

.msg-ta-clear:hover {
    color: var(--rs-brand);
    background: #EFF4FB;
}

.msg-ta-list {
    position: absolute;
    top: calc(100% + 4px);
    inset-inline: 0;
    background: #fff;
    border: 1px solid var(--rs-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 320px;
    overflow: auto;
    z-index: 30;
    display: none;
}

.msg-ta-list.open {
    display: block;
}

.msg-ta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--rs-border-light, #f0f0f0);
}

.msg-ta-item:last-child {
    border-bottom: none;
}

.msg-ta-item:hover {
    background: #EFF4FB;
}

.msg-ta-name {
    font-weight: 600;
    font-size: 0.88rem;
}

.msg-ta-meta {
    font-size: 0.74rem;
    color: var(--rs-text-muted);
}

.msg-ta-empty {
    padding: 12px;
    text-align: center;
    color: var(--rs-text-muted);
    font-size: 0.85rem;
}

/* --- הדגשת הודעה ב"הצג בעץ" --- */
.msg-rec-line.msg-rec-flash {
    animation: msgRecFlash 2.6s ease;
}

@keyframes msgRecFlash {
    0%   { background: rgba(201, 169, 97, 0.45); }
    70%  { background: rgba(201, 169, 97, 0.30); }
    100% { background: transparent; }
}

/* =========================================================================
   תיבת "התאמה מדויקת" + מיון (משותף לכל החיפושים)
   ========================================================================= */
.sys-table-exact,
.msg-exact,
.rc-exact,
.rp-exact,
.dm-exact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--rs-text-muted);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.sys-table-exact input,
.msg-exact input,
.rc-exact input,
.rp-exact input,
.dm-exact input {
    accent-color: var(--rs-brand);
    cursor: pointer;
}

.msg-sort {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--rs-text-muted);
}

.msg-sort select {
    width: auto;
}

/* =========================================================================
   עמוד "מקליטים" — טבלת שורות + עריכת פרטים
   ========================================================================= */
.rc-name-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.rc-name-main {
    font-weight: 700;
}

.rc-name-sub {
    font-size: 0.8rem;
    color: var(--rs-text-muted);
}

.rc-admin {
    color: var(--rs-gold-dark);
    font-size: 0.8rem;
}

.rc-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #EFF4FB;
    color: var(--rs-brand-dark);
    font-weight: 700;
}

.rc-col-actions {
    white-space: nowrap;
}

.rc-row-actions {
    display: inline-flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.rc-col-email span {
    word-break: break-all;
}

/* טושטוש סיסמה — נחשפת בלחיצה על העין */
.rc-pw-field.rc-pw-blur {
    filter: blur(5px);
    transition: filter 0.15s ease;
}

.rc-pw-field {
    transition: filter 0.15s ease;
    letter-spacing: 1px;
}

.rc-form-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* =========================================================================
   עמוד "דוחות"
   ========================================================================= */
.rp-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.rp-stat {
    border: 1px solid var(--rs-border);
    border-radius: 12px;
    background: #fff;
    padding: 14px 16px;
    text-align: center;
}

.rp-stat-val {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--rs-brand-dark);
    font-family: 'Frank Ruhl Libre', 'Assistant', serif;
}

.rp-stat-lbl {
    font-size: 0.82rem;
    color: var(--rs-text-muted);
}

.rp-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.rp-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rp-field-grow {
    flex: 1 1 220px;
}

.rp-field label {
    font-size: 0.78rem;
    color: var(--rs-text-muted);
    font-weight: 600;
}

.rp-table-wrap {
    overflow-x: auto;
}

.rp-table th {
    font-size: 0.82rem;
    color: var(--rs-text-muted);
    white-space: nowrap;
}

.rp-row {
    cursor: default;
}

.rp-detail-row > td {
    background: #F8FAFC;
    padding: 0;
}

.rp-events {
    padding: 14px 18px;
}

.rp-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rp-tl-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
}

.rp-tl-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #EFF4FB;
    color: var(--rs-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex: 0 0 auto;
}

.rp-tl-recording .rp-tl-icon {
    background: #E6F6EC;
    color: var(--rs-success);
}

.rp-tl-hangup .rp-tl-icon {
    background: #FBEAEC;
    color: var(--rs-danger);
}

.rp-tl-text {
    flex: 1 1 auto;
}

.rp-tl-time {
    color: var(--rs-text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.rp-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.rp-pager-info {
    font-size: 0.85rem;
    color: var(--rs-text-muted);
}

/* =========================================================================
   עמוד "לוח לימודים" — לוח שנה עברי
   ========================================================================= */
.cal-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.cal-title {
    font-family: 'Frank Ruhl Libre', 'Assistant', serif;
    font-size: 1.35rem;
    font-weight: 700;
    min-width: 200px;
    text-align: center;
}

.cal-today-btn {
    margin-inline-start: auto;
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 6px;
}

.cal-weekdays > div {
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--rs-text-muted);
    padding: 4px 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.cal-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--rs-text-muted);
}

.calendar-day {
    border: 1px solid var(--rs-border);
    border-radius: 10px;
    background: #fff;
    min-height: 104px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.calendar-day:hover {
    border-color: var(--rs-brand-light);
    box-shadow: 0 4px 12px rgba(30, 91, 168, 0.10);
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
    box-shadow: none;
}

.calendar-day.today {
    border-color: var(--rs-gold);
    box-shadow: 0 0 0 2px rgba(201, 169, 97, 0.35);
}

.calendar-day.shabbat {
    background: #FBF8F0;
}

.calendar-day.holiday {
    background: #F3F8FF;
}

.cal-day-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
}

.hebrew-date {
    font-family: 'Frank Ruhl Libre', 'Assistant', serif;
    font-weight: 700;
    font-size: 0.95rem;
}

.greg-date {
    font-size: 0.72rem;
    color: var(--rs-text-muted);
}

.day-info {
    font-size: 0.72rem;
    color: var(--rs-brand-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-lessons {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: auto;
}

.cal-lesson {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    background: #EFF4FB;
    border-radius: 6px;
    padding: 2px 5px;
    overflow: hidden;
}

.cal-lesson .cl-tag {
    font-weight: 700;
    color: var(--rs-brand-dark);
    flex: 0 0 auto;
}

.cal-lesson .cl-name {
    color: var(--rs-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- מודאל עריכת יום --- */
.dm-slots {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dm-slot {
    display: flex;
    gap: 12px;
    border: 1px solid var(--rs-border);
    border-radius: 10px;
    padding: 10px 12px;
    align-items: flex-start;
}

.dm-slot-disabled {
    opacity: 0.55;
}

.dm-slot-label {
    flex: 0 0 80px;
    font-weight: 700;
    color: var(--rs-brand-dark);
    padding-top: 4px;
}

.dm-slot-body {
    flex: 1 1 auto;
    min-width: 0;
}

.dm-current {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.dm-current.empty {
    margin-bottom: 6px;
}

.dm-cur-name {
    font-weight: 700;
}

.dm-cur-path {
    font-size: 0.76rem;
    color: var(--rs-text-muted);
}

.dm-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dm-search {
    flex: 1 1 220px;
    min-width: 180px;
}

.dm-results {
    position: absolute;
    top: calc(100% + 4px);
    inset-inline: 0;
    background: #fff;
    border: 1px solid var(--rs-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 280px;
    overflow: auto;
    z-index: 30;
}

.dm-results[hidden] {
    display: none;
}

.dm-result {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.dm-result:last-child {
    border-bottom: none;
}

.dm-result:hover {
    background: #EFF4FB;
}

.dm-result-name {
    font-weight: 600;
    font-size: 0.88rem;
}

.dm-result-path {
    font-size: 0.74rem;
    color: var(--rs-text-muted);
}

.dm-result-empty {
    padding: 12px;
    text-align: center;
    color: var(--rs-text-muted);
    font-size: 0.85rem;
}

/* ============================ התראות מייל ============================ */
.nt-help {
    background: #EFF4FB;
    border: 1px solid var(--rs-border);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--rs-text);
    line-height: 1.6;
}

.nt-help i {
    color: var(--rs-gold-dark);
}

.nt-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nt-card {
    background: var(--rs-surface);
    border: 1px solid var(--rs-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .04);
    overflow: hidden;
    transition: opacity .15s ease;
}

.nt-card-off {
    opacity: .55;
}

.nt-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rs-border);
    background: #FBFCFE;
}

.nt-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nt-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--rs-text);
}

.nt-subj {
    font-size: 0.78rem;
    color: var(--rs-text-muted);
    background: #F1F5F9;
    border-radius: 20px;
    padding: 2px 10px;
}

.nt-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nt-card-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nt-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.nt-row-label {
    flex: 0 0 60px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--rs-text-muted);
    padding-top: 4px;
}

.nt-row-val {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.nt-cond-group {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.nt-cond-type {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--rs-brand-dark);
}

.nt-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #EEF2F7;
    border: 1px solid var(--rs-border);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.8rem;
    color: var(--rs-text);
}

.nt-chip-mail {
    background: #EAF6EF;
    border-color: #CDE9DA;
}

.nt-chip-mail i {
    color: var(--rs-success);
}

.nt-or,
.nt-and {
    font-size: 0.72rem;
    font-weight: 700;
    margin: 0 4px;
}

.nt-or {
    color: var(--rs-text-muted);
}

.nt-and {
    color: var(--rs-gold-dark);
}

.nt-empty {
    text-align: center;
    color: var(--rs-text-muted);
    padding: 40px 16px;
    background: var(--rs-surface);
    border: 1px dashed var(--rs-border);
    border-radius: 12px;
}

/* מתג הפעלה */
.nt-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    margin: 0;
    cursor: pointer;
}

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

.nt-switch span {
    position: absolute;
    inset: 0;
    background: #CBD5E1;
    border-radius: 22px;
    transition: background .15s ease;
}

.nt-switch span::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    right: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .15s ease;
}

.nt-switch input:checked+span {
    background: var(--rs-success);
}

.nt-switch input:checked+span::before {
    transform: translateX(-16px);
}

/* מודאל עריכת חוק */
.nt-section {
    border: 1px solid var(--rs-border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.nt-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.nt-section-head h6 {
    margin: 0;
    font-weight: 700;
    color: var(--rs-text);
}

.nt-add-cond {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.nt-add-cond .form-select,
.nt-add-cond .form-control {
    min-width: 120px;
    width: auto;
}

.nt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nt-chip-rm {
    cursor: default;
}

.nt-chip-type {
    font-weight: 600;
    color: var(--rs-brand-dark);
}

.nt-chip-rm i.nt-rm-cond,
.nt-chip-rm i.nt-rm-rcpt {
    cursor: pointer;
    color: var(--rs-danger);
    margin-inline-start: 4px;
}

.nt-empty-hint {
    font-size: 0.78rem;
    color: var(--rs-text-muted);
    padding-top: 6px;
}

/* אופן מסירת ההקלטה (קובץ / קישור / שניהם) */
.nt-delivery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nt-delivery-opt {
    flex: 1 1 140px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--rs-border);
    border-radius: 10px;
    cursor: pointer;
    background: var(--rs-surface);
    transition: border-color .15s ease, background .15s ease;
}

.nt-delivery-opt:hover {
    border-color: var(--rs-brand-dark);
}

.nt-delivery-opt input {
    accent-color: var(--rs-success);
    margin: 0;
}

.nt-delivery-opt:has(input:checked) {
    border-color: var(--rs-success);
    background: #EAF6EF;
}

.nt-chip-delivery {
    background: #EEF2FF;
    border-color: #D5DCF5;
    color: var(--rs-brand-dark);
}

/* ===================== Login extras (links + toggle) ===================== */
.login-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
}

.login-links a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--rs-brand);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border: 1px solid rgba(30, 91, 168, 0.25);
    border-radius: 999px;
    background: rgba(30, 91, 168, 0.04);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.login-links a:hover {
    text-decoration: none;
    background: var(--rs-brand);
    border-color: var(--rs-brand);
    color: #fff;
    transform: translateY(-1px);
}

.login-links-sep {
    display: none;
}

/* ----------------------- Registration success ----------------------- */
.register-success {
    text-align: center;
    animation: loginFieldIn 0.5s ease both;
}

.register-success-icon {
    font-size: 3.2rem;
    line-height: 1;
    color: #16a34a;
    margin-bottom: 10px;
    animation: loginLogoIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.register-success-title {
    font-family: 'Frank Ruhl Libre', 'Assistant', serif;
    font-weight: 700;
    font-size: 1.6rem;
    margin: 0 0 12px;
    color: var(--rs-brand-dark);
}

.register-success-text {
    color: var(--rs-text);
    line-height: 1.8;
    margin: 0 0 14px;
}

.register-success-hint {
    color: var(--rs-text-muted);
    font-size: 0.92rem;
    margin: 0 0 8px;
}

.input-toggle {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--rs-text-muted);
    cursor: pointer;
    padding: 2px 6px;
}

.input-icon .form-control {
    padding-left: 38px;
}

/* ============================ Account page ============================ */
.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.account-card {
    background: var(--rs-surface);
    border: 1px solid var(--rs-border);
    border-radius: 14px;
    padding: 22px 24px;
}

.account-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 18px;
    color: var(--rs-brand-dark);
}

/* ============================ Users page ============================ */
.usr-section {
    margin-bottom: 26px;
}

.usr-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--rs-text);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.usr-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.usr-pending-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid #FCD9B6;
    background: #FFF8EF;
    border-radius: 12px;
}

.usr-pending-name {
    font-weight: 700;
}

.usr-pending-email {
    font-size: 0.85rem;
    color: var(--rs-text-muted);
}

.usr-pending-date {
    font-size: 0.78rem;
    color: var(--rs-text-muted);
    margin-top: 3px;
}

.usr-pending-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.usr-table-wrap {
    background: var(--rs-surface);
    border: 1px solid var(--rs-border);
    border-radius: 14px;
    overflow: auto;
}

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

.usr-table thead th {
    text-align: right;
    padding: 12px 14px;
    background: #F3F5F9;
    color: var(--rs-text-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--rs-border);
    white-space: nowrap;
}

.usr-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--rs-border);
    vertical-align: middle;
}

.usr-table tbody tr:last-child td {
    border-bottom: none;
}

.usr-loading {
    text-align: center;
    color: var(--rs-text-muted);
    padding: 26px;
}

.usr-perms-cell {
    max-width: 320px;
}

.usr-badge {
    display: inline-block;
    background: #EEF2FF;
    color: var(--rs-brand-dark);
    border: 1px solid #D5DCF5;
    border-radius: 20px;
    padding: 2px 9px;
    font-size: 0.74rem;
    margin: 2px 0 2px 4px;
}

.usr-badge-all {
    background: #FFF3D6;
    border-color: #F0DCA0;
    color: var(--rs-gold-dark);
}

.usr-noperm {
    color: var(--rs-text-muted);
}

.usr-status {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 20px;
    padding: 3px 10px;
}

.usr-status-on {
    background: #E3F6EC;
    color: var(--rs-success);
}

.usr-status-off {
    background: #FBE3E5;
    color: var(--rs-danger);
}

.usr-status-super {
    background: #FFF3D6;
    color: var(--rs-gold-dark);
}

.usr-you {
    color: var(--rs-text-muted);
    font-size: 0.78rem;
}

.usr-row-actions {
    white-space: nowrap;
}

/* permission groups in modal */
.usr-perms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.usr-perm-group {
    border: 1px solid var(--rs-border);
    border-radius: 12px;
    padding: 14px 16px;
}

.usr-perm-group-title {
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--rs-brand-dark);
}

.usr-perm-super {
    grid-column: 1 / -1;
    border-color: #F0DCA0;
    background: #FFFBF0;
}

.usr-perm-super .usr-perm-group-title {
    color: var(--rs-gold-dark);
}

.usr-perm-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.usr-perm-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    margin: 0;
}

.usr-perm-item input {
    width: 16px;
    height: 16px;
}

/* account/account-gear chip in sidebar */
.su-account {
    cursor: pointer;
}

/* ===================== Extensions tree (\u05de\u05d1\u05e0\u05d4 \u05d4\u05e9\u05dc\u05d5\u05d7\u05d5\u05ea) ===================== */
.ext-intro {
    background: #EEF4FF;
    border: 1px solid #D5E2FA;
    color: var(--rs-brand-dark);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.ext-tree {
    background: var(--rs-surface);
    border: 1px solid var(--rs-border);
    border-radius: 14px;
    padding: 14px 10px;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.04);
}

.ext-loading,
.ext-error {
    text-align: center;
    color: var(--rs-text-muted);
    padding: 30px;
}

.ext-error {
    color: var(--rs-danger);
}

.ext-node-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    transition: background 0.15s ease;
}

.ext-node-header.expandable {
    cursor: pointer;
}

.ext-node-header.expandable:hover {
    background: #F4F7FD;
}

.ext-expand {
    width: 14px;
    color: var(--rs-brand);
    font-size: 0.85rem;
    flex: 0 0 auto;
    transition: transform 0.15s ease;
}

.ext-expand-placeholder {
    width: 14px;
    flex: 0 0 auto;
}

.ext-key {
    flex: 0 0 auto;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--rs-brand);
    color: #fff;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 2px 6px rgba(30, 91, 168, 0.25);
}

.ext-key-root {
    background: var(--rs-gold);
    box-shadow: 0 2px 6px rgba(201, 169, 97, 0.35);
}

.ext-label {
    font-weight: 600;
    color: var(--rs-text);
}

.ext-badge {
    flex: 0 0 auto;
    background: #EEF2FF;
    color: var(--rs-brand-dark);
    border: 1px solid #D5DCF5;
    border-radius: 20px;
    padding: 1px 9px;
    font-size: 0.72rem;
    font-weight: 700;
}

.ext-hint {
    color: var(--rs-text-muted);
    font-size: 0.82rem;
}

.ext-children {
    margin-right: 18px;
    padding-right: 14px;
    border-right: 2px dashed var(--rs-border);
}

.ext-node.collapsed>.ext-children {
    display: none;
}




/* ── ניהול שיעורים (lessons.php) ─────────────────────────────────────── */
/* פריסה סטטית — גלילה פנימית בלבד בתוך הטבלה (לא גלילה של כל העמוד). */
.msg-tabs-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.lessons-hint,
.lessons-filters {
    flex: 0 0 auto;
}

/* אזור הטבלה ממלא את שארית הגובה — סרגל הכלים נשאר קבוע והטבלה נגללת בפנים. */
.lessons-table-area {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.lessons-table-area .sys-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
}

/* טבלת סוגי השיעור — שורות נגררות לשינוי סדר. */
.lt-table td {
    vertical-align: middle;
}

.lt-table .lt-grip-cell {
    width: 32px;
    text-align: center;
}

.lt-grip {
    cursor: grab;
    color: var(--rs-text-muted, #888);
}

.lt-grip:active {
    cursor: grabbing;
}

.lt-row.lt-inactive {
    opacity: 0.65;
}

.lt-row.dragging {
    opacity: 0.5;
    background: var(--rs-surface-muted, #f0f4fa);
}

.lt-meta-cell {
    white-space: nowrap;
}

.lt-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* טיפוסר (typeahead) לבחירת נושא בהוספת שיעור */
.al-ta {
    position: relative;
}

.al-ta-list {
    position: absolute;
    z-index: 20;
    inset-inline: 0;
    top: 100%;
    background: #fff;
    border: 1px solid var(--rs-border);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(26, 35, 50, 0.12);
    max-height: 240px;
    overflow-y: auto;
    display: none;
}

.al-ta-list.open {
    display: block;
}

.al-ta-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.al-ta-item:hover {
    background: #EFF4FB;
}

.al-ta-meta {
    font-size: 0.78rem;
    color: var(--rs-text-muted, #888);
}

.al-ta-empty {
    padding: 8px 12px;
    color: var(--rs-text-muted, #888);
}
