/* ── Global Reset & Font ────────────────────────────────────────── */
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Google Sans', 'Assistant', 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
}

/* ── RTL support ────────────────────────────────────────────────── */
html[dir="rtl"] .mud-drawer-left {
    border-left: 1px solid #eef2f5 !important;
    border-right: none !important;
}

/* RTL: labels, helper text, and form groups on the right */
html[dir="rtl"] .mud-dialog,
html[dir="rtl"] .mud-dialog-content,
html[dir="rtl"] .mud-dialog-title {
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] .mud-input-label,
html[dir="rtl"] .mud-input-helper-text,
html[dir="rtl"] .mud-form-group {
    text-align: right;
}

/* MudAlert RTL — override MudBlazor's justify-sm-end which pushes content to flex-end (= left in RTL) */
html[dir="rtl"] .mud-alert-position.justify-sm-end {
    justify-content: flex-start !important;
}

html[dir="rtl"] .mud-alert-message {
    text-align: right;
}

/* ── Page Headers ──────────────────────────────────────────────── */
.mud-typography-h5 {
    padding-inline-start: 8px;
}

/* ── Links ─────────────────────────────────────────────────────── */
a { color: #0d6efd; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Blazor internals ──────────────────────────────────────────── */
h1:focus { outline: none; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

/* ── Psiphas-specific utilities ────────────────────────────────── */
.psiphas-logo {
    max-height: 44px;
    width: auto;
}

.psiphas-content-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eef2f5;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* ══════════════════════════════════════════════════════════════════
   NEW DASHBOARD DESIGN v4.3
   ══════════════════════════════════════════════════════════════════ */

:root {
    --navy-border: rgba(31,61,102,.10);
    --navy-border-soft: rgba(31,61,102,.07);
    --bg: #f0f4f9;
    --surface: #ffffff;
    --border: #dce5ef;
    --border-soft: #e8eff6;
    --text-dark: #0d1b2e;
    --text-body: #2c3e52;
    --text-muted: #6b7f96;
    --text-faint: #9aafc4;
    --accent: #2a6dd9;
    --accent-soft: #e8f0fd;
    --accent-border: #b8d0f7;
    --success: #0d7a45;
    --success-soft: #e6f7ef;
    --warning: #b05a00;
    --warning-soft: #fff4e5;
    --danger: #c0202e;
    --danger-soft: #fef0f1;
    --db-radius: 14px;
    --db-radius-sm: 8px;
    --db-shadow: 0 1px 3px rgba(13,27,46,.06), 0 4px 16px rgba(13,27,46,.06);
    --db-shadow-pop: 0 8px 32px rgba(13,27,46,.18), 0 1px 4px rgba(13,27,46,.1);
}

/* ── Header ─────────────────────────────────────────────────────── */
.psiphas-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(247,250,254,.95);
    backdrop-filter: blur(12px);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 24px;
    border-bottom: 1px solid rgba(31,61,102,.09);
    box-shadow: 0 4px 14px rgba(13,27,46,.04);
    font-family: 'Assistant', 'Noto Sans Hebrew', sans-serif;
}

.psiphas-header-right,
.psiphas-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.psiphas-logo-wrap {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    padding: 6px 13px 6px 8px;
    border-radius: 14px;
    background: linear-gradient(180deg,#ffffff,#f3f8fe);
    border: 1px solid rgba(31,61,102,.08);
    box-shadow: 0 6px 18px rgba(13,27,46,.05);
    text-decoration: none;
    cursor: pointer;
}

.psiphas-logo-badge {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    background: linear-gradient(180deg,#ffffff,#eff6ff);
    border: 1px solid rgba(31,61,102,.10);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.psiphas-logo-badge svg { width: 20px; height: 20px; display: block; }

.psiphas-logo-text-block { display: flex; flex-direction: column; line-height: 1; gap: 3px; }

.psiphas-logo-text {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.2px;
    color: #18314f;
}

.psiphas-logo-subtext {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #7e92aa;
}

.psiphas-nav-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    color: #4c6178;
    text-decoration: none;
    font-weight: 650;
    font-size: 13px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(31,61,102,.08);
    transition: all .16s ease;
    cursor: pointer;
    font-family: 'Assistant', sans-serif;
    white-space: nowrap;
}

.psiphas-nav-item:hover {
    color: var(--text-dark);
    background: #ffffff;
    border-color: rgba(42,109,217,.18);
    box-shadow: 0 4px 14px rgba(13,27,46,.06);
    text-decoration: none;
}

.psiphas-nav-item.logout { color: var(--danger); }
.psiphas-nav-item.logout:hover { background: #fff5f5; border-color: rgba(192,32,46,.16); }

.psiphas-help-select {
    font-size: 13px;
    font-family: inherit;
    color: var(--text-mid);
    background: transparent;
    border: 1px solid rgba(42,109,217,.15);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    outline: none;
    transition: border-color .15s, background .15s;
}
.psiphas-help-select:hover { background: #ffffff; border-color: rgba(42,109,217,.3); }
.psiphas-help-select:focus { border-color: var(--primary); }

.psiphas-greeting {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 13px;
    font-family: 'Assistant', sans-serif;
    background: transparent;
    border: none;
    white-space: nowrap;
    cursor: default;
}

/* ── Culture Selector (language dropdown) ───────────────────────── */
.psiphas-culture-select .mud-input-outlined .mud-input-outlined-border { border-color: var(--border); }
.psiphas-culture-select .mud-select-input { font-size: 13px; padding: 4px 8px; }
.psiphas-culture-select .mud-input { min-height: unset; }

.psiphas-org-autocomplete {
    min-width: 220px;
    max-width: 320px;
}

.psiphas-org-autocomplete .mud-input-root {
    background: linear-gradient(180deg, #ffffff, #f4f8fd);
    border-radius: 999px !important;
    font-weight: 650;
    font-size: 13px;
    font-family: 'Assistant', sans-serif;
    color: #30455d;
    min-height: 36px;
    box-shadow: 0 2px 8px rgba(13,27,46,.04);
}

.psiphas-org-autocomplete .mud-input-outlined-border {
    border-color: rgba(31,61,102,.10) !important;
    border-radius: 999px !important;
}

.psiphas-org-autocomplete .mud-input-root input {
    font-family: 'Assistant', sans-serif;
    font-size: 13px;
    font-weight: 650;
    color: #30455d;
    padding: 0 12px;
}

.psiphas-org-autocomplete .mud-input-root:hover .mud-input-outlined-border {
    border-color: rgba(42,109,217,.22) !important;
}

.psiphas-org-autocomplete .mud-input-adornment { color: #758aa2; }

.psiphas-header-select {
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(180deg,#ffffff,#f4f8fd)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 4.2 6 8l3.8-3.8' fill='none' stroke='%23758aa2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat 12px 50%;
    color: #30455d;
    border: 1px solid rgba(31,61,102,.10);
    padding: 0 16px 0 34px;
    border-radius: 999px;
    font-weight: 650;
    font-size: 13px;
    outline: none;
    min-height: 36px;
    box-shadow: 0 2px 8px rgba(13,27,46,.04);
    cursor: pointer;
    font-family: 'Assistant', sans-serif;
}

.psiphas-header-select:hover { background-color: #eef5fc; }
.psiphas-header-select:focus { border-color: rgba(42,109,217,.22); box-shadow: 0 0 0 4px rgba(42,109,217,.08); }
.psiphas-header-select option { background: #fff; color: #18314f; }

.psiphas-last-login {
    padding: 6px 24px;
    font-size: 11.5px;
    color: #93a6bb;
    font-weight: 500;
    letter-spacing: .01em;
    background: rgba(247,250,254,.7);
    border-bottom: 1px solid rgba(31,61,102,.06);
}

/* ── Dashboard Layout ───────────────────────────────────────────── */
.psiphas-dashboard-body {
    background: #edf3f9;
    min-height: calc(100vh - 64px);
}

.psiphas-dashboard-container {
    display: grid;
    grid-template-columns: 220px minmax(0,1fr);
    gap: 18px;
    padding: 14px 18px 26px 22px;
    align-items: start;
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.psiphas-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 76px;
}

html[dir="rtl"] .psiphas-sidebar {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .psiphas-btn-action {
    direction: rtl;
    justify-content: flex-start;
}

.psiphas-sidebar-card {
    background: linear-gradient(180deg,#ffffff,#f8fbff);
    border: 1px solid rgba(31,61,102,.07);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 3px 12px rgba(13,27,46,.035);
}

.psiphas-sidebar-header {
    font-size: 18px;
    font-weight: 700;
    color: #17314f;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(31,61,102,.10);
    text-align: start;
}

.psiphas-btn-stack { display: flex; flex-direction: column; gap: 6px; }

.psiphas-btn-stack-primary {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(31,61,102,.10);
}

.psiphas-btn-action {
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 650;
    cursor: pointer;
    text-align: start;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: all .15s ease;
    border: 1px solid transparent;
    font-family: 'Assistant', sans-serif;
    text-decoration: none;
}

.psiphas-btn-action.primary {
    background: linear-gradient(135deg,#3b82f6,#2563eb);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37,99,235,.22);
    border-color: rgba(37,99,235,.1);
}

.psiphas-btn-action.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(37,99,235,.26); }

.psiphas-btn-action.nav {
    background: #ffffff;
    color: #4f647b;
    border-color: rgba(31,61,102,.08);
}

.psiphas-btn-action.nav:hover {
    background: linear-gradient(180deg,#f7fbff,#eef5ff);
    color: #17314f;
    border-color: rgba(42,109,217,.18);
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(42,109,217,.08);
    text-decoration: none;
}

.psiphas-btn-action.nav.active {
    background: #edf4ff;
    border-color: rgba(42,109,217,.20);
    color: #2a6dd9;
}

.psiphas-date-input {
    width: 100%;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(31,61,102,.10);
    border-radius: 12px;
    font-family: 'Assistant', sans-serif;
    outline: none;
    background: #ffffff;
    color: #30455d;
    color-scheme: light;
    box-shadow: 0 2px 8px rgba(13,27,46,.03);
    margin-bottom: 8px;
}

.psiphas-date-input:focus { border-color: rgba(42,109,217,.22); box-shadow: 0 0 0 4px rgba(42,109,217,.08); }

.psiphas-sidebar-datepicker { margin-bottom: 8px; }
.psiphas-sidebar-datepicker .mud-input-outlined .mud-input-outlined-border { border-radius: 12px; }

.psiphas-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 650;
    color: #62778f;
    font-size: 13px;
}

.psiphas-stat-row span:last-child { font-size: 15px; font-weight: 800; color: #18314f; }

.psiphas-progress-bg {
    height: 6px;
    background: rgba(220,229,239,.6);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 12px;
}

.psiphas-progress-fill {
    height: 100%;
    background: linear-gradient(90deg,#60a5fa,#3b82f6);
    border-radius: 999px;
}

/* ── Content Area ───────────────────────────────────────────────── */
.psiphas-content-area {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--db-radius);
    box-shadow: var(--db-shadow);
}

.psiphas-content-header-sticky {
    position: sticky;
    top: 64px;
    z-index: 20;
    background: #fff;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
}

.psiphas-select-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: #2a6dd9;
}

.psiphas-select-links .psiphas-select-label {
    color: #334155;
    font-weight: 500;
    margin-inline-end: 4px;
}

.psiphas-select-links a {
    color: #2a6dd9;
    text-decoration: underline;
    cursor: pointer;
}

.psiphas-select-links a:hover {
    color: #1b4fa0;
}

.psiphas-record-count {
    color: #64748b;
    font-size: 0.9rem;
    white-space: nowrap;
}

.psiphas-content-header {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border-soft);
    background: #fff;
}

.psiphas-content-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.psiphas-page-title h1 {
    font-size: 22px;
    line-height: 1.1;
    margin-bottom: 4px;
    letter-spacing: -.03em;
    color: var(--text-dark);
    font-weight: 800;
}

.psiphas-page-title p { color: #93a6bb; font-size: 11.5px; font-weight: 500; }

/* ── Toolbar ────────────────────────────────────────────────────── */
.psiphas-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 11px 12px;
    background: #f8fafc;
    border: 1px solid var(--border-soft);
    border-radius: var(--db-radius-sm);
}

.psiphas-toolbar-rows { display: flex; flex-direction: column; gap: 10px; }

.psiphas-toolbar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.psiphas-toolbar-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.psiphas-toolbar-meta {
    font-size: 12.5px;
    font-weight: 700;
    color: #62778f;
    white-space: nowrap;
}

.psiphas-search-input {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Assistant', sans-serif;
    outline: none;
    background: #fff;
    color: var(--text-dark);
    font-size: 13px;
    width: 220px;
    flex: 0 0 220px;
}

.psiphas-search-input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px rgba(42,109,217,.1); }

.psiphas-select-inline {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Assistant', sans-serif;
    outline: none;
    background: #fff;
    color: var(--text-dark);
    font-size: 13px;
    width: 148px;
    appearance: none;
}

.psiphas-select-inline:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px rgba(42,109,217,.1); }

.psiphas-tool-btn {
    min-height: 35px;
    border-radius: 8px;
    padding: 0 13px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-body);
    box-shadow: 0 1px 2px rgba(13,27,46,.04);
    transition: all .15s ease;
    font-family: 'Assistant', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.psiphas-tool-btn:hover { border-color: var(--accent-border); color: var(--accent); background: var(--accent-soft); }

.psiphas-tool-btn:disabled { opacity: .4; cursor: default; pointer-events: none; }

.psiphas-tool-btn.accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }

/* ── MudMenu buttons in toolbar — match psiphas-tool-btn style ── */
.psiphas-toolbar-row > .mud-menu > .mud-button-root {
    min-height: 35px;
    border-radius: 8px;
    padding: 0 13px;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-body);
    box-shadow: 0 1px 2px rgba(13,27,46,.04);
    transition: all .15s ease;
    font-family: 'Assistant', sans-serif;
    text-transform: none;
    letter-spacing: normal;
}
.psiphas-toolbar-row > .mud-menu > .mud-button-root:hover {
    border-color: var(--accent-border);
    color: var(--accent);
    background: var(--accent-soft);
}

/* ── Chip / selection toggle buttons ────────────────────────────── */
.psiphas-chip-btn {
    min-height: 26px;
    border-radius: 14px;
    padding: 0 10px;
    font-weight: 500;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: #f5f6f8;
    color: var(--text-muted, #6b7280);
    transition: all .15s ease;
    font-family: 'Assistant', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    line-height: 1;
}

.psiphas-chip-btn:hover { border-color: var(--accent-border); color: var(--accent); background: var(--accent-soft, #eef2ff); }

/* ── Table ──────────────────────────────────────────────────────── */
.psiphas-table-wrap {
}

.psiphas-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.psiphas-table thead,
.psiphas-table thead tr {
    position: sticky;
    top: var(--psiphas-toolbar-bottom, 176px);
    z-index: 2;
    background: #f6f9fc;
}

.psiphas-table thead th {
    position: sticky;
    top: var(--psiphas-toolbar-bottom, 176px);
    z-index: 2;
    background: #f6f9fc;
    padding: 10px 8px 10px 20px;
    text-align: start;
    font-size: 12px;
    font-weight: 800;
    color: #22384f;
    box-shadow: inset 0 -2px 0 #d8e3ef;
    white-space: nowrap;
    overflow: visible;
    cursor: pointer;
}

.psiphas-table thead th::after {
    content: '';
    position: absolute;
    inset-inline-end: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 11px;
    height: 15px;
    opacity: .85;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 11px 15px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='15' viewBox='0 0 11 15'%3E%3Cpath d='M2 5.25 5.5 1.75 9 5.25' fill='none' stroke='%234a5e74' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M2 9.75 5.5 13.25 9 9.75' fill='none' stroke='%234a5e74' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.psiphas-table thead th.no-sort { cursor: default; padding-inline-end: 12px; }
.psiphas-table thead th.no-sort::after { content: none; }

.psiphas-table thead th.sorted-asc::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='15' viewBox='0 0 11 15'%3E%3Cpath d='M2 5.25 5.5 1.75 9 5.25' fill='none' stroke='%232a6dd9' stroke-width='2.15' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M2 9.75 5.5 13.25 9 9.75' fill='none' stroke='%23c5d4e5' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    opacity: 1;
}

.psiphas-table thead th.sorted-desc::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='15' viewBox='0 0 11 15'%3E%3Cpath d='M2 5.25 5.5 1.75 9 5.25' fill='none' stroke='%23c5d4e5' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M2 9.75 5.5 13.25 9 9.75' fill='none' stroke='%232a6dd9' stroke-width='2.15' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    opacity: 1;
}

.psiphas-table thead th:not(:last-child),
.psiphas-table tbody td:not(:last-child) { border-inline-end: 1px solid rgba(194,207,223,.42); }

.psiphas-table tbody tr { transition: background .12s ease; height: 30px; }
.psiphas-table tbody td { border-bottom: 1px solid #edf2f8; }
.psiphas-table tbody tr:nth-child(even) { background: #fbfdff; }
.psiphas-table tbody tr:hover { background: #f1f6ff !important; }
.psiphas-table tbody tr:hover td { color: var(--text-dark); }

.psiphas-table tbody td {
    padding: 2px 8px;
    font-size: 13px;
    vertical-align: middle;
    color: var(--text-body);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Column widths — narrow columns get explicit widths; text-heavy columns fill remaining space and truncate */
.psiphas-table .col-check { width: 28px; text-align: center !important; padding: 0 4px !important; }
.psiphas-table .col-id { width: 90px; text-align: start !important; }
.psiphas-table .col-gender { width: 55px; text-align: start !important; }
.psiphas-table .col-date { width: 88px; text-align: start !important; }
.psiphas-table .col-invite { width: 62px; text-align: center !important; }
.psiphas-table .col-score { width: 76px; text-align: center !important; }
.psiphas-table .col-integrity { width: 62px; text-align: center !important; }

/* Wider columns for LTR cultures — Hebrew labels are short (מין, זימון, יושרה, ציון);
   English/other LTR labels need more room for the text + sort arrow. */

/* LTR-only: reserve 22px end-padding so the absolute-positioned sort chevron
   (11px wide at inset-inline-end:6px → reaches 17px from end) does not overlap
   header text. Hebrew RTL labels are short enough that the original 8px end-
   padding never causes overlap, so we leave RTL untouched. */
[dir="ltr"] .psiphas-table thead th { padding-inline-start: 14px; padding-inline-end: 22px; }
[dir="ltr"] .psiphas-table thead th.no-sort { padding-inline-end: 12px; }

/* LTR widths sized for: header text + 14 start-padding + 22 end-padding (chevron),
   or + 12 end-padding for .no-sort columns. */
[dir="ltr"] .psiphas-table .col-id        { width: 80px;  }   /* "ID" header tiny, but data ("dapar12") needs room */
[dir="ltr"] .psiphas-table .col-gender    { width: 88px;  }   /* "Gender" */
[dir="ltr"] .psiphas-table .col-invite    { width: 72px;  }   /* "Invite" (no-sort) */
[dir="ltr"] .psiphas-table .col-integrity { width: 102px; }   /* "Integrity" */
[dir="ltr"] .psiphas-table .col-score     { width: 78px;  }   /* "Score" */
[dir="ltr"] .psiphas-table .col-video     { width: 70px;  }   /* "Video" (no-sort) */
[dir="ltr"] .psiphas-table .col-date      { width: 84px;  }   /* "Date" + "5/26/2026" data */
[dir="ltr"] .psiphas-table .col-actions   { width: 127px; }   /* "Resume" + "Ans" + "Del" */
[dir="ltr"] .psiphas-table .col-site      { max-width: 75px;  }
[dir="ltr"] .psiphas-table .col-client    { max-width: 100px; }
[dir="ltr"] .psiphas-table .col-name      { max-width: 110px; }
[dir="ltr"] .psiphas-table .col-array     { max-width: 150px; }
.psiphas-table .col-ost { width: 44px; text-align: start !important; }
.psiphas-table .col-video { width: 60px; text-align: start !important; }
.psiphas-table .col-site { text-align: start !important; }
.psiphas-table .col-client { max-width: 110px; }
.psiphas-table .col-client .psiphas-cell-truncate {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
.psiphas-table .col-actions { width: 128px; white-space: nowrap; text-align: start !important; overflow: visible !important; padding: 4px 2px !important; }

.psiphas-name-cell { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.psiphas-name-cell strong { display: block; font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-dark); }
.psiphas-cell-truncate { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.psiphas-row-check { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.psiphas-clickable-cell { cursor: pointer; }
.psiphas-clickable-cell:hover { background: #eef5ff !important; }

/* ── Score Pill ─────────────────────────────────────────────────── */
.psiphas-score-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

/* Legacy fifthyon palette — matches Standard.RTL/psiphas.css Grade{10..50}Cell */
.psiphas-score-f10 { background: #FF1F1F; color: #fff;   border: 1px solid #d61818; }
.psiphas-score-f20 { background: #FDF941; color: #000;   border: 1px solid #d6d23a; }
.psiphas-score-f30 { background: #B5F68E; color: #000;   border: 1px solid #8fd96a; }
.psiphas-score-f40 { background: #39FBFE; color: #000;   border: 1px solid #29c6c8; }
.psiphas-score-f50 { background: #302AFE; color: #fff;   border: 1px solid #1f1ad6; }
.psiphas-score-na  { background: #f1f5fa; color: var(--text-faint); border: 1px solid #dde6f0; }
/* Back-compat aliases (used by other report views) */
.psiphas-score-good { background: #B5F68E; color: #000; border: 1px solid #8fd96a; }
.psiphas-score-mid  { background: #FDF941; color: #000; border: 1px solid #d6d23a; }
.psiphas-score-low  { background: #FF1F1F; color: #fff; border: 1px solid #d61818; }

/* ── Status Pill ────────────────────────────────────────────────── */
.psiphas-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    color: #4a5e74;
    background: #f1f5fa;
    border: 1px solid #dde6f0;
    white-space: nowrap;
}

.psiphas-status-pill.done { background: var(--success-soft); color: var(--success); border-color: #b7e6cf; }
.psiphas-status-pill.progress { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.psiphas-status-pill.pending { background: var(--warning-soft); color: var(--warning); border-color: #f5d9b0; }

/* ── Invite Badge ───────────────────────────────────────────────── */
.psiphas-invite-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 30px;
    padding: 0 6px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: #f4f7fb;
}

.psiphas-invite-badge svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.psiphas-invite-badge.mail { color: #2a6dd9; background: #eef5ff; border-color: #b8d0f7; }
.psiphas-invite-badge.sms  { color: #0d7a45; background: var(--success-soft); border-color: #b7e6cf; }

/* ── Video Badge ────────────────────────────────────────────────── */
.psiphas-video-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 32px;
    padding: 0 6px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f4f7fb;
    position: relative;
}

.psiphas-video-badge svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.psiphas-video-badge.done    { color: var(--success); background: var(--success-soft); border-color: #b7e6cf; }
.psiphas-video-badge.paused  { color: var(--warning); background: var(--warning-soft); border-color: #f5d9b0; }
.psiphas-video-badge.error   { color: var(--danger);  background: var(--danger-soft);  border-color: #f5c0c4; }
.psiphas-video-badge.nocam   { color: var(--text-faint); background: #f4f7fb; border-color: var(--border); }
.psiphas-video-badge.deleted { color: var(--success); background: var(--success-soft); border-color: #b7e6cf; }
.psiphas-video-badge.live    { background: #fef0f1; border-color: #f5c0c4; }

.psiphas-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e11d48;
    box-shadow: 0 0 0 3px rgba(225,29,72,.16);
    animation: psiphas-pulse 1.6s ease-in-out infinite;
}

@keyframes psiphas-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .7; transform: scale(1.2); }
}

/* ── Integrity Badge ────────────────────────────────────────────── */
.psiphas-integrity-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
}
.psiphas-integrity-badge.ok   { background: #1b7a40; }
.psiphas-integrity-badge.warn { background: #1b7a40; }
.psiphas-integrity-badge.fail { background: #b83228; }

/* ── Row Actions Dropdown ───────────────────────────────────────── */
.psiphas-row-actions { position: relative; display: inline-block; }

.psiphas-action-toggle {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fbff;
    border: 1px solid rgba(31,61,102,.10);
    border-radius: 9px;
    cursor: pointer;
    color: #71859a;
    font-size: 16px;
    line-height: 1;
    transition: all .15s ease;
    list-style: none;
}

.psiphas-action-toggle:hover { border-color: rgba(42,109,217,.18); color: var(--accent); background: #eef5ff; }

.psiphas-action-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-start: 0;
    min-width: 152px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--db-radius);
    box-shadow: var(--db-shadow-pop);
    padding: 5px;
    z-index: 20;
}

.psiphas-action-dropdown a {
    display: block;
    width: 100%;
    padding: 9px 11px;
    border-radius: var(--db-radius-sm);
    color: var(--text-body);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    text-align: start;
    transition: background .12s ease;
}

.psiphas-action-dropdown a:hover { background: #f4f7fb; text-decoration: none; }
.psiphas-action-dropdown a.exam { color: var(--accent); font-weight: 700; }
.psiphas-action-dropdown a.delete { color: var(--danger); }

/* ── Inline Action Buttons (compact row actions) ──────────────── */
.psiphas-action-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 2px;
    align-items: center;
    justify-content: flex-start;
}

.psiphas-action-btn {
    display: inline-block;
    padding: 1px 4px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    background: none;
    transition: background .12s ease, border-color .12s ease;
}

.psiphas-action-btn.act-start {
    color: var(--accent);
    border-color: rgba(42,109,217,.2);
}
.psiphas-action-btn.act-start:hover {
    background: #eef5ff;
    border-color: var(--accent);
    text-decoration: none;
    color: var(--accent);
}

.psiphas-action-btn.act-continue {
    color: var(--accent);
    border-color: rgba(42,109,217,.2);
}
.psiphas-action-btn.act-continue:hover {
    background: #eef5ff;
    border-color: var(--accent);
    text-decoration: none;
    color: var(--accent);
}

.psiphas-action-btn.act-stop {
    color: var(--danger);
    border-color: rgba(220,53,69,.2);
}
.psiphas-action-btn.act-stop:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
}

.psiphas-action-btn.act-answers {
    color: var(--text-body);
    border-color: rgba(31,61,102,.1);
}
.psiphas-action-btn.act-answers:hover {
    background: #f4f7fb;
    border-color: rgba(31,61,102,.25);
}

.psiphas-action-btn.act-delete {
    color: var(--danger);
    border-color: rgba(220,53,69,.15);
}
.psiphas-action-btn.act-delete:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
}

.psiphas-action-btn.act-disabled {
    color: #b0bec5;
    cursor: default;
    border-color: rgba(176,190,197,.2);
}

/* ── Content Footer / Pagination ────────────────────────────────── */
.psiphas-content-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px;
    border-top: 1px solid var(--border-soft);
    color: #7f92a7;
    font-size: 12px;
    font-weight: 600;
    background: #fbfdff;
}

.psiphas-pagination { display: flex; gap: 6px; align-items: center; }

.psiphas-page-btn {
    width: 33px;
    height: 33px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-body);
    transition: all .15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.psiphas-page-btn:hover { border-color: var(--accent-border); color: var(--accent); background: var(--accent-soft); }
.psiphas-page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 8px rgba(42,109,217,.3); }
.psiphas-page-btn:disabled { opacity: .4; cursor: default; }

/* ── Advanced Search Modal ──────────────────────────────────────── */
.psiphas-modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 88px 20px 24px;
    background: rgba(9,18,31,.28);
    backdrop-filter: blur(4px);
    z-index: 80;
}

.psiphas-modal-backdrop.open { display: flex; }

.psiphas-advanced-modal {
    width: min(1320px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(180deg,#ffffff,#fbfdff);
    border: 1px solid rgba(31,61,102,.10);
    border-radius: 18px;
    box-shadow: 0 24px 72px rgba(13,27,46,.20), 0 8px 24px rgba(13,27,46,.12);
}

.psiphas-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px 6px;
    border-bottom: 1px solid var(--border-soft);
    background: linear-gradient(180deg,#ffffff,#f8fbff);
    flex-shrink: 0;
}

.psiphas-modal-header h2 { margin: 0 0 2px; font-size: 17px; font-weight: 800; color: var(--text-dark); letter-spacing: -.02em; }
.psiphas-modal-header p  { margin: 0; font-size: 11px; color: #6f8398; font-weight: 600; }

.psiphas-modal-close {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(31,61,102,.10);
    background: #fff;
    color: #5d738b;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    transition: all .15s ease;
}

.psiphas-modal-close:hover { background: #f4f8fd; color: var(--text-dark); border-color: rgba(42,109,217,.18); }

.psiphas-modal-body {
    padding: 10px 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    align-content: start;
}
.psiphas-modal-body > .psiphas-filter-section:nth-child(3) { grid-column: 1 / -1; }

.psiphas-filter-section {
    border: 1px solid rgba(31,61,102,.08);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 5px rgba(13,27,46,.04);
    padding: 8px 10px;
}

.psiphas-filter-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 4px;
}

.psiphas-filter-section-title h3 { font-size: 13px; font-weight: 800; color: #17314f; margin: 0; }
.psiphas-filter-section-title span { font-size: 10px; font-weight: 700; color: #8ca1b7; }

.psiphas-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 6px 10px;
}

.psiphas-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.psiphas-field.span-2 { grid-column: span 2; }
.psiphas-field label { font-size: 11px; font-weight: 700; color: #63788f; }

.psiphas-field input,
.psiphas-field select {
    min-height: 32px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 14px;
    background: #fff;
    color: var(--text-dark);
    font-size: 13px;
    font-family: 'Assistant', sans-serif;
    outline: none;
    box-shadow: 0 1px 4px rgba(13,27,46,.03);
}

.psiphas-field input:focus,
.psiphas-field select:focus { border-color: var(--accent-border); box-shadow: 0 0 0 4px rgba(42,109,217,.09); }

/* Shrink MudAutocomplete inside filter fields to match plain textboxes */
.psiphas-field .mud-input-control { margin-top: 0; margin-bottom: 0; }
.psiphas-field .mud-input.mud-input-outlined { min-height: 32px; height: 32px; }
.psiphas-field .mud-input.mud-input-outlined .mud-input-slot { padding-top: 0; padding-bottom: 0; font-size: 12px; }
.psiphas-field .mud-input-control-input-container > .mud-input-label { font-size: 12px; }

.psiphas-gender-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    background: #f4f8fc;
    border: 1px solid rgba(31,61,102,.08);
    border-radius: 10px;
    min-height: 32px;
}

.psiphas-gender-toggle input { display: none; }

.psiphas-gender-toggle label {
    min-height: 32px;
    padding: 0 13px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    font-size: 12.5px;
    font-weight: 800;
    color: #66809a;
    cursor: pointer;
    transition: all .15s ease;
}

.psiphas-gender-toggle input:checked + label { background: #fff; color: var(--accent); box-shadow: 0 2px 8px rgba(42,109,217,.11); }

.psiphas-date-presets { display: flex; gap: 8px; flex-wrap: wrap; }

.psiphas-preset-chip {
    border: 1px solid #c9daf8;
    background: #eef5ff;
    color: #2a6dd9;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all .15s ease;
    font-family: 'Assistant', sans-serif;
}

.psiphas-preset-chip:hover { background: #e4efff; border-color: #b8d0f7; }
.psiphas-preset-chip.active { background: #dce8ff; border-color: #2a6dd9; box-shadow: 0 0 0 3px rgba(42,109,217,.10); }

.psiphas-date-range-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 6px 10px;
    align-items: end;
    margin-top: 6px;
}

.psiphas-modal-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    border-top: 1px solid var(--border-soft);
    background: linear-gradient(180deg,rgba(255,255,255,.94),#ffffff);
}

.psiphas-modal-footer-note { font-size: 12px; font-weight: 700; color: #8ca1b7; }
.psiphas-modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.psiphas-modal-btn {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid rgba(31,61,102,.10);
    font-family: 'Assistant', sans-serif;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all .15s ease;
}

.psiphas-modal-btn.primary   { background: linear-gradient(135deg,#3777ea,#245fda); color: #fff; border-color: transparent; box-shadow: 0 10px 20px rgba(42,109,217,.22); }
.psiphas-modal-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(42,109,217,.26); }
.psiphas-modal-btn.secondary { background: #eef5ff; color: #2a6dd9; border-color: #b8d0f7; }
.psiphas-modal-btn.secondary:hover { background: #e7f0ff; }
.psiphas-modal-btn.ghost     { background: #fff; color: #5c738a; }
.psiphas-modal-btn.ghost:hover { background: #f6f9fc; }
.psiphas-modal-btn.add       { background: #eaf3ff; color: #1f5dca; border-color: #a9c5f5; }

/* ── Semantic field widths ──────────────────────────────────────── */
/* Apply via Class="field-xxx" on MudTextField/MudSelect/MudNumericField/etc.
   to constrain width to match expected content length. */
.field-id      { max-width: 140px; }
.field-phone   { max-width: 180px; }
.field-short   { max-width: 220px; }
.field-name    { max-width: 280px; }
.field-email   { max-width: 320px; }
.field-medium  { max-width: 400px; }
.field-long    { max-width: 600px; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1320px) {
    .psiphas-dashboard-container { grid-template-columns: 1fr; }
    .psiphas-sidebar { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); }
}

/* Push snackbar below the sticky header (64px) */
.mud-snackbar-location-top-left,
.mud-snackbar-location-top-center,
.mud-snackbar-location-top-right {
    top: 70px !important;
}

@media (max-width: 760px) {
    .psiphas-header { flex-direction: column; align-items: stretch; min-height: auto; padding: 12px; gap: 8px; }
    .psiphas-dashboard-container { padding: 12px; }
    .psiphas-fields-grid { grid-template-columns: 1fr; }
    .psiphas-date-range-grid { grid-template-columns: 1fr; }
    .psiphas-field.span-2 { grid-column: auto; }
    .psiphas-modal-footer { flex-direction: column; align-items: stretch; }
}

/* Required field asterisk — red and slightly larger */
.mud-input-required > .mud-input-control-input-container > .mud-input-label::after {
    color: #d32f2f !important;
    font-size: 1.15em;
    font-weight: 700;
}

/* ── App loading spinner ─────────────────────────────────────────── */
#app-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #f8f9fb;
}

/* ── Blazor reconnect modal ──────────────────────────────────────── */
#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.45);
    align-items: center;
    justify-content: center;
}

#components-reconnect-modal.components-reconnect-show { display: flex !important; }
#components-reconnect-modal.components-reconnect-hide { display: none !important; }

#components-reconnect-modal.components-reconnect-failed .show-reconnecting,
#components-reconnect-modal.components-reconnect-rejected .show-reconnecting { display: none !important; }

#components-reconnect-modal.components-reconnect-failed .show-failed,
#components-reconnect-modal.components-reconnect-rejected .show-failed { display: block !important; }

.reconnect-dialog {
    background: #fff;
    padding: 28px 36px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

.reconnect-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.reconnect-body  { color: #64748b; font-size: 0.9rem; }
.show-failed     { display: none; }
