/* ===================== Inter (self-hosted, latin + greek) ===================== */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/inter/inter-400-greek.woff2') format('woff2'); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/inter/inter-400-greek-ext.woff2') format('woff2'); unicode-range: U+1F00-1FFF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/inter/inter-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/inter/inter-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/inter/inter-500-greek.woff2') format('woff2'); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/inter/inter-500-greek-ext.woff2') format('woff2'); unicode-range: U+1F00-1FFF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/inter/inter-500-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/inter/inter-500-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/inter/inter-600-greek.woff2') format('woff2'); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/inter/inter-600-greek-ext.woff2') format('woff2'); unicode-range: U+1F00-1FFF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/inter/inter-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/inter/inter-600-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/inter/inter-700-greek.woff2') format('woff2'); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/inter/inter-700-greek-ext.woff2') format('woff2'); unicode-range: U+1F00-1FFF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/inter/inter-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/inter/inter-700-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

html, body {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

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."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ===================== Auth (standalone login/register) ===================== */
:root {
    --navy-900: #0a1c38;
    --navy-800: #0d2547;
    --navy-700: #123059;
    --gold: #d4a23a;
    --gold-light: #e6b955;
}

.auth-bg {
    position: fixed;
    inset: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(150deg, #0a1830 0%, #122f59 55%, #163a6b 100%);
    overflow: auto;
}

.auth-card { position: relative; z-index: 1; }

.auth-lang {
    position: absolute;
    top: 22px;
    right: 26px;
    width: 46px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    backdrop-filter: blur(4px);
}

.auth-card {
    width: 100%;
    max-width: 940px;
    display: flex;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}

.auth-brand {
    flex: 0 0 42%;
    background: linear-gradient(165deg, var(--navy-800) 0%, var(--navy-900) 100%);
    color: #eaf1fb;
    padding: 44px 38px;
    position: relative;
    overflow: hidden;
}

.auth-brand > * { position: relative; z-index: 1; }

.auth-logo {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: .5px;
    margin-bottom: 56px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.auth-logo .mark {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 42px;
    color: var(--gold-light);
}

.auth-logo-img {
    height: 52px;
    width: auto;
    margin-bottom: 56px;
    filter: brightness(0) invert(1);
}

.auth-logo-mobile {
    display: none;
    height: 46px;
    width: auto;
    margin: 0 auto 24px;
    filter: brightness(0) saturate(100%) invert(13%) sepia(34%) saturate(1500%) hue-rotate(185deg) brightness(95%) contrast(95%);
}

.auth-brand h2 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 14px;
}

.auth-brand p.lead {
    color: #b9c7dd;
    font-size: 14.5px;
    line-height: 1.5;
    margin-bottom: 28px;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #cdd9ec;
    font-size: 14px;
}

.auth-features li svg {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    color: var(--gold-light);
}

.auth-partner {
    margin: 28px 0 0;
    font-size: 13px;
    color: #8197b4;
}

.auth-partner span { color: var(--gold-light); }

.auth-panel {
    flex: 1;
    padding: 48px 46px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-panel h1 {
    font-size: 30px;
    font-weight: 700;
    color: #0e1b2e;
    margin-bottom: 6px;
}

.auth-panel .subtitle {
    color: #6b7686;
    font-size: 14.5px;
    margin-bottom: 30px;
}

.auth-field {
    position: relative;
    margin-bottom: 18px;
}

.auth-input {
    width: 100%;
    height: 52px;
    border: 1px solid #d7dce3;
    border-radius: 10px;
    padding: 0 16px;
    font-size: 15px;
    color: #1b2738;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.auth-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,162,58,0.18);
}

.auth-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    color: #8a93a3;
    font-size: 18px;
    padding: 6px;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.auth-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #54606f;
    font-size: 14px;
    user-select: none;
    cursor: pointer;
}

.auth-switch input { display: none; }

.auth-switch .track {
    width: 40px;
    height: 22px;
    border-radius: 22px;
    background: #cfd5de;
    position: relative;
    transition: background .15s;
}

.auth-switch .track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s;
}

.auth-switch input:checked + .track { background: var(--navy-800); }
.auth-switch input:checked + .track::after { transform: translateX(18px); }

.auth-btn {
    width: 100%;
    height: 54px;
    border-radius: 10px;
    background: var(--gold);
    color: var(--navy-900);
    font-size: 16px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
}

.auth-btn:hover {
    background: var(--gold-light);
    box-shadow: 0 6px 18px rgba(212,162,58,0.32);
}

.auth-row-link {
    color: #4a5666;
    font-size: 14px;
    text-decoration: none;
}

.auth-row-link:hover { color: var(--gold); text-decoration: underline; }

.auth-invite {
    margin-top: 16px;
    text-align: center;
    color: #6b7686;
    font-size: 13.5px;
}

.auth-invite a {
    color: var(--navy-800);
    font-weight: 600;
    text-decoration: none;
}

.auth-invite a:hover { color: var(--gold); text-decoration: underline; }

.auth-links {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 20px;
}

.auth-links a {
    color: #4a5666;
    font-size: 14px;
    text-decoration: none;
}

.auth-links a:hover { color: var(--gold); text-decoration: underline; }

.auth-copy {
    margin-top: 34px;
    color: #9aa6b6;
    font-size: 12.5px;
    text-align: left;
}

.auth-error {
    background: #fdecec;
    border: 1px solid #f5c2c2;
    color: #b3261e;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 18px;
}

@media (max-width: 760px) {
    .auth-bg { padding: 16px; align-items: flex-start; }
    .auth-card { max-width: 440px; flex-direction: column; border-radius: 18px; margin: 20px auto; }
    .auth-brand { flex: none; padding: 30px 26px 26px; }
    .auth-logo-img { height: 38px; margin-bottom: 20px; }
    .auth-brand h2 { font-size: 20px; }
    .auth-brand p.lead { font-size: 13px; margin-bottom: 18px; }
    .auth-features { gap: 11px; }
    .auth-features li { font-size: 13px; }
    .auth-features li svg { width: 17px; height: 17px; }
    .auth-partner { display: none; }
    .auth-logo-mobile { display: none; }
    .auth-panel { padding: 28px 26px; }
    .auth-panel h1 { font-size: 24px; }
    .auth-copy { text-align: center; }
    .auth-links { gap: 18px; flex-wrap: wrap; }
}

@media (max-width: 420px) {
    .auth-card { border-radius: 14px; margin: 12px auto; }
    .auth-brand { padding: 24px 22px 22px; }
    .auth-panel { padding: 24px 22px; }
}
/* ===================== Light shell design system (MudBlazor) ===================== */
:root {
    --ink: #1f2a37;
    --ink-soft: #5b6675;
    --ink-muted: #7a8696;
    --line: #e9edf3;
    --line-soft: #f2f5f9;
    --bg-app: #f6f7fa;
    --gold: #c8941e;
    --gold-deep: #9a7011;
    --gold-soft: #fbf3e1;
    --navy: #0d2342;
}

/* Shell: white appbar + navy drawer */
.mud-appbar {
    box-shadow: none !important;
    border-bottom: 1px solid var(--line);
}

.mud-drawer {
    box-shadow: none !important;
    border-right: none;
}

.mud-drawer .mud-drawer-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 64px;
}

/* Topbar global search pill */
.topbar-search {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--line-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 7px 12px;
    min-width: 230px;
    max-width: 320px;
    color: var(--ink-muted);
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.topbar-search:hover { border-color: #d4dbe5; background: #eef1f6; }

.topbar-search .ts-kbd {
    margin-left: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 5px;
    font-size: 11px;
    padding: 0 5px;
    color: #9aa6b6;
}

@media (max-width: 700px) {
    .topbar-search { min-width: 0; }
    .topbar-search .ts-label, .topbar-search .ts-kbd { display: none; }
}

/* Navigation (navy drawer): rounded items, gold active pill */
.mud-nav-link {
    border-radius: 10px;
    margin: 1px 10px;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color .15s ease, color .15s ease;
}

.mud-nav-link:hover { background-color: rgba(255, 255, 255, 0.07); }

.mud-nav-link.active {
    background-color: rgba(224, 169, 58, 0.16) !important;
    color: #f0c869 !important;
    box-shadow: inset 3px 0 0 var(--gold);
    border-radius: 0 10px 10px 0;
    font-weight: 600;
}

.mud-nav-link.active .mud-nav-link-icon { color: #f0c869 !important; }

/* Nav groups: small muted headers on navy */
.mud-nav-group > .mud-nav-link {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: .03em;
    color: #7e93b5 !important;
    padding-top: 6px;
    padding-bottom: 6px;
    margin-top: 8px;
}

.mud-nav-group > .mud-nav-link:hover { background: transparent; color: #c2cfe2 !important; }

.mud-nav-group .mud-nav-group-expand-icon { color: #7e93b5; }

/* Topbar user menu */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s ease;
}

.topbar-user:hover { background: var(--line-soft); }

.um-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    transition: background .12s ease;
}

.um-item:hover { background: var(--line-soft); }

/* Sidebar user card (on navy) */
.sb-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 12px 14px;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.sb-user:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.14); }

/* Drawer: never allow horizontal scroll */
.mud-drawer, .mud-drawer .mud-nav-menu { overflow-x: hidden; }

.sb-user .sbu-name { font-size: 12.5px; font-weight: 600; color: #fff; line-height: 1.25; }
.sb-user .sbu-role { font-size: 11px; color: #8fa3c2; }

/* Collapsed (mini) drawer: hide the user-card text, center the avatar */
.mud-drawer-mini.mud-drawer--closed .sbu-text { display: none; }
.mud-drawer-mini.mud-drawer--closed .sb-user { justify-content: center; margin-left: 8px; margin-right: 8px; padding-left: 0; padding-right: 0; }
.mud-drawer-mini.mud-drawer--closed:hover .sbu-text { display: block; }
.mud-drawer-mini.mud-drawer--closed:hover .sb-user { justify-content: flex-start; padding-left: 10px; padding-right: 10px; }

/* Papers / cards: flat, hairline border, soft radius */
.mud-paper {
    box-shadow: 0 1px 2px rgba(16, 42, 76, 0.04) !important;
    border: 1px solid var(--line);
}

.mud-paper.mud-elevation-2 { box-shadow: 0 4px 14px rgba(16, 42, 76, 0.06) !important; }

/* Tables: sentence-case headers, airy rows */
.mud-table-head .mud-table-cell {
    background-color: #fafbfd;
    color: var(--ink-muted);
    font-weight: 600;
    text-transform: none;
    font-size: 0.76rem;
    letter-spacing: 0;
    border-bottom: 1px solid var(--line);
}

.mud-table-row:hover { background-color: #f7fafd !important; }

.mud-table-cell { border-bottom: 1px solid #f4f6fa; }

.mud-table-container { border-radius: 12px; }

/* Page headings */
.mud-typography-h4 { color: #11233f; letter-spacing: -0.01em; }
.mud-typography-h5 { color: #11233f; letter-spacing: -0.01em; }

.page-sub { color: var(--ink-muted); font-size: 0.8rem; margin-top: 2px; }

/* Buttons */
.mud-button-filled.mud-button-filled-primary {
    box-shadow: 0 3px 10px rgba(200, 148, 30, 0.28);
    font-weight: 600;
}

.mud-button-root { text-transform: none; font-weight: 600; border-radius: 10px; }

/* Inputs */
.mud-input.mud-input-outlined { border-radius: 10px; }

/* Chips as pills */
.mud-chip { font-weight: 500; border-radius: 999px; }

/* Tabs: sentence case */
.mud-tab { text-transform: none; font-weight: 600; }

/* KPI v2: icon chip + value + trend */
.kpi2 {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.kpi2:hover {
    transform: translateY(-2px);
    border-color: #dde3ec;
    box-shadow: 0 8px 22px rgba(16, 42, 76, 0.08);
}

.kpi2-top { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }

.kpi2-ic {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
}

.kpi2-ic .mud-icon-root { font-size: 1.1rem; }
.kpi2-ic.navy { background: #e8eef7; color: #2b4a77; }
.kpi2-ic.gold { background: var(--gold-soft); color: var(--gold-deep); }
.kpi2-ic.green { background: #e5f4ec; color: #247a52; }
.kpi2-ic.blue { background: #e7f1fa; color: #2f7dc4; }
.kpi2-ic.red { background: #fbeae8; color: #b3261e; }

.kpi2-label { font-size: 12px; color: #38424f; font-weight: 600; line-height: 1.3; }

.kpi2-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: #11233f;
    letter-spacing: -0.02em;
    display: flex;
    align-items: baseline;
    gap: 8px;
    line-height: 1.2;
}

.kpi2-sub { font-size: 11.5px; color: #4a5563; margin-top: 2px; }

/* Trend / status mini pills */
.tchip { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1.5px 8px; white-space: nowrap; }
.tchip.up { background: #e5f4ec; color: #247a52; }
.tchip.dn { background: #fbeae8; color: #b3261e; }
.tchip.gl { background: var(--gold-soft); color: var(--gold-deep); }
.tchip.nt { background: #eef2f8; color: #41506a; }
.tchip.bl { background: #e7f1fa; color: #185fa5; }

/* Empty states */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 38px 16px;
    color: var(--ink-muted);
    text-align: center;
}

.empty-state .es-ic {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--line-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa6b6;
}

/* Search palette */
.spal .mud-dialog { border-radius: 14px; overflow: hidden; }

.spal-group {
    font-size: 11px;
    font-weight: 600;
    color: #9aa6b6;
    letter-spacing: .03em;
    padding: 10px 18px 3px;
}

.spal-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 18px;
    cursor: pointer;
    transition: background .12s ease;
}

.spal-item:hover, .spal-item.sel { background: var(--line-soft); }

.spal-item .sp-t { font-size: 13.5px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.spal-item .sp-s { font-size: 11.5px; color: var(--ink-muted); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccd5e0; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #aeb9c9; }

/* ── Incoming-call toast (screen-pop) ─────────────────── */
.callpop {
  position: fixed; top: 78px; right: 20px; z-index: 1500;
  width: 332px; max-width: calc(100vw - 32px);
  animation: callpop-in .34s cubic-bezier(.16,.84,.44,1);
}
@keyframes callpop-in {
  from { opacity: 0; transform: translateX(30px) scale(.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.callpop-card {
  background: #fff; border-radius: 16px; overflow: hidden;
  border: 1px solid #e6ebf3;
  box-shadow: 0 18px 50px -12px rgba(13,35,66,.45), 0 4px 14px rgba(13,35,66,.16);
}
.callpop-head {
  display: flex; align-items: center; gap: 9px; color: #fff;
  padding: 11px 12px 11px 13px;
  background: linear-gradient(115deg, #0d2342 0%, #1a3f6c 100%);
}
.callpop-head .cp-ring {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: rgba(200,148,30,.18); color: #f0c668;
  transform-origin: 50% 8px;
  animation: cp-shake 1.1s ease-in-out infinite;
}
@keyframes cp-shake {
  0%,55%,100% { transform: rotate(0); }
  60%,80% { transform: rotate(-12deg); }
  70%,90% { transform: rotate(12deg); }
}
.callpop-head .cp-title {
  flex: 1; font-size: .69rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: #cdd9ec;
}
.callpop-head .cp-x {
  background: none; border: none; color: #9fb2cf; cursor: pointer;
  width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center;
  font-size: .82rem; line-height: 1;
}
.callpop-head .cp-x:hover { background: rgba(255,255,255,.12); color: #fff; }

.callpop-body { display: flex; align-items: center; gap: 13px; padding: 15px 16px 8px; }
.callpop-av {
  position: relative; width: 46px; height: 46px; flex: none;
  border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #c8941e, #e0b54e); color: #fff;
  font-weight: 700; font-size: 1rem;
  box-shadow: 0 4px 12px rgba(200,148,30,.4);
}
.callpop-av::before {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid rgba(200,148,30,.55);
  animation: cp-pulse 1.6s ease-out infinite;
}
@keyframes cp-pulse {
  0%   { transform: scale(.82); opacity: .85; }
  100% { transform: scale(1.45); opacity: 0; }
}
.callpop-info { flex: 1; min-width: 0; }
.callpop-name {
  font-weight: 700; color: #11233f; font-size: .98rem; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.callpop-name.unknown { color: #5b6675; font-weight: 600; }
.callpop-num {
  color: #6b7686; font-size: .82rem; margin-top: 3px;
  display: flex; align-items: center; gap: 5px;
}
.callpop-actions { padding: 8px 16px 15px; display: flex; gap: 8px; }
.callpop-btn {
  border: none; cursor: pointer; border-radius: 9px; font: inherit;
  font-weight: 600; font-size: .85rem; padding: 9px 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s;
}
.callpop-btn.primary { flex: 1; background: #c8941e; color: #fff; }
.callpop-btn.primary:hover { background: #b3820f; }
.callpop-btn.ghost { flex: 0 0 auto; background: #eef1f6; color: #41506a; }
.callpop-btn.ghost:hover { background: #e2e7f0; }
@media (max-width: 600px) {
  .callpop { top: auto; bottom: 16px; right: 12px; left: 12px; width: auto; }
}

/* ── Floating telephony console ───────────────────────── */
.cc-wrap { position: fixed; bottom: 18px; right: 18px; z-index: 1400; }
.cc-panel {
  width: 344px; max-width: calc(100vw - 28px); max-height: 78vh;
  display: flex; flex-direction: column; background: #fff;
  border-radius: 16px; overflow: hidden; border: 1px solid #e6ebf3;
  box-shadow: 0 18px 50px -12px rgba(13,35,66,.45), 0 4px 14px rgba(13,35,66,.16);
  animation: callpop-in .28s cubic-bezier(.16,.84,.44,1);
}
.cc-head {
  display: flex; align-items: center; gap: 10px; color: #fff;
  padding: 12px 12px 12px 14px;
  background: linear-gradient(115deg, #0d2342 0%, #1a3f6c 100%);
}
.cc-head .cc-ic {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: rgba(200,148,30,.18); color: #f0c668;
}
.cc-head .cc-ttl { font-weight: 700; font-size: .96rem; line-height: 1.1; }
.cc-head .cc-sub {
  font-size: .66rem; color: #9db2d2; margin-top: 2px;
  display: flex; align-items: center; gap: 5px;
}
.cc-livedot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.cc-livedot.on  { background: #4ad991; box-shadow: 0 0 0 0 rgba(74,217,145,.6); animation: cc-live 1.8s ease-out infinite; }
.cc-livedot.off { background: #6b7c93; }
@keyframes cc-live { 0% { box-shadow: 0 0 0 0 rgba(74,217,145,.55); } 100% { box-shadow: 0 0 0 7px rgba(74,217,145,0); } }
.cc-min {
  background: none; border: none; color: #9fb2cf; cursor: pointer; margin-left: auto;
  width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-size: 1rem;
}
.cc-min:hover { background: rgba(255,255,255,.12); color: #fff; }

.cc-body { padding: 13px 14px 16px; overflow-y: auto; }
.cc-label {
  font-size: .64rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: #97a2b2; margin: 14px 0 7px; display: flex; align-items: center; gap: 6px;
}
.cc-label:first-child { margin-top: 2px; }
.cc-label .cc-count {
  background: #eef1f6; color: #5b6675; font-weight: 700; font-size: .62rem;
  border-radius: 999px; padding: 1px 7px; letter-spacing: 0;
}

.cc-call {
  border: 1px solid #e6ebf3; border-radius: 12px; padding: 9px 10px; margin-bottom: 8px;
  background: #fbfcfe;
}
.cc-call-top { display: flex; align-items: center; gap: 9px; }
.cc-call-dir { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; }
.cc-call-dir.in  { background: #e7f0fb; color: #2f7dc4; }
.cc-call-dir.out { background: #faf0db; color: #b3820f; }
.cc-call-info { min-width: 0; flex: 1; }
.cc-call-name { font-weight: 700; font-size: .84rem; color: #11233f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-call-num  { font-size: .71rem; color: #6b7686; }

.cc-ext-row { display: flex; align-items: center; gap: 9px; padding: 5px 7px; border-radius: 9px; }
.cc-ext-row:hover { background: #f5f7fa; }
.cc-ext-num  { font-weight: 700; font-size: .8rem; color: #11233f; width: 32px; flex: none; }
.cc-ext-name { font-size: .8rem; flex: 1; color: #41506a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-pill {
  font-size: .66rem; font-weight: 600; padding: 2px 9px 2px 7px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px; flex: none;
}
.cc-pill .cc-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

/* Calls page — direction badge reuses .cc-call-dir; add a missed variant */
.cc-call-dir.missed { background: #fdeaea; color: #d24b4b; }
.calls-table tr.missed-row td { background: #fffafa; }

/* Hours upsell radar — urgency pill */
.hours-tier {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 600; padding: 2px 10px 2px 8px; border-radius: 999px;
}
.hours-tier .ht-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

/* Clickable dashboard KPI cards */
.kpi2.clickable { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.kpi2.clickable:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -12px rgba(13,35,66,.32); }

/* Dashboard inline stat rows (calls summary) */
.dash-stat { display: flex; justify-content: space-between; align-items: center; padding: 9px 2px; border-bottom: 1px solid #eef1f6; font-size: .86rem; color: #41506a; }
.dash-stat:last-child { border-bottom: none; }
.dash-stat b { color: #11233f; font-size: 1rem; }

/* Representative card - recent activity feed */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; align-items: flex-start; gap: 11px; padding: 8px 2px; border-bottom: 1px solid #f0f2f6; }
.feed-item:last-child { border-bottom: none; }
.feed-ic { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; margin-top: 1px; }
.feed-body { min-width: 0; }
.feed-date { font-size: .72rem; color: #97a2b2; margin-top: 1px; }

/* Notifications - bell button */
.noti-btn { position: relative; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; cursor: pointer; color: #41506a; transition: background .15s; margin-right: 4px; }
.noti-btn:hover { background: #eef1f6; }
.noti-btn .mud-icon-root { font-size: 22px; }
.noti-btn.has .mud-icon-root { color: #0d2342; }
.noti-dot { position: absolute; top: 3px; right: 3px; min-width: 13px; height: 17px; padding: 0 4px; border-radius: 9px; background: #d24b4b; color: #fff; font-size: .64rem; font-weight: 700; display: grid; place-items: center; border: 2px solid #fff; }

/* Notifications - rich clickable cards (chat / mail) */
.noti-stack { position: fixed; right: 18px; bottom: 18px; z-index: 2100; display: flex; flex-direction: column; gap: 10px;
    width: 350px; max-width: calc(100vw - 36px); }
.noti-card { position: relative; display: flex; gap: 11px; align-items: flex-start; background: #fff; border: 1px solid var(--line);
    border-left: 3px solid var(--navy); border-radius: 13px; padding: 12px 30px 12px 13px; cursor: pointer;
    box-shadow: 0 12px 32px rgba(13,35,66,.17); animation: notiIn .22s cubic-bezier(.2,.8,.2,1); }
.noti-card:hover { border-color: var(--gold); border-left-color: var(--gold); }
.noti-card.accent { border-left-color: var(--gold); background: #fffdf6; }
.noti-card-ava { flex: none; width: 38px; height: 38px; border-radius: 50%; color: #fff; display: flex; align-items: center;
    justify-content: center; font-weight: 600; font-size: .8rem; }
.noti-card-body { min-width: 0; flex: 1; }
.noti-card-head { display: flex; align-items: center; gap: 6px; }
.noti-card-type { font-size: 15px !important; color: var(--gold) !important; flex: none; }
.noti-card-title { font-weight: 700; font-size: .85rem; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.noti-card-sub { font-size: .74rem; font-weight: 600; color: #46566b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.noti-card-prev { font-size: .76rem; color: #6b7686; margin-top: 3px; line-height: 1.45; word-break: break-word;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.noti-card-x { position: absolute; top: 7px; right: 7px; border: none; background: none; color: #b6c0cd; cursor: pointer;
    font-size: 17px; line-height: 1; width: 21px; height: 21px; border-radius: 7px; display: grid; place-items: center; }
.noti-card-x:hover { background: #f0f3f8; color: #46566b; }
@keyframes notiIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* Notifications - panel */
.noti-head { display: flex; align-items: center; gap: 11px; padding: 14px; color: #fff; background: linear-gradient(115deg, #0d2342 0%, #1a3f6c 100%); }
.noti-head-ic { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: rgba(200,148,30,.18); color: #f0c668; }
.noti-head-title { font-weight: 700; font-size: 1.02rem; line-height: 1.1; }
.noti-head-sub { font-size: .72rem; color: #aebfd6; margin-top: 1px; }
.noti-head-x { margin-left: auto; background: none; border: none; color: #9fb2cf; cursor: pointer; width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; font-size: .82rem; }
.noti-head-x:hover { background: rgba(255,255,255,.12); color: #fff; }
.noti-body { padding: 8px 12px 24px; overflow-y: auto; }

.noti-group { margin-top: 14px; }
.noti-group:first-child { margin-top: 6px; }
.noti-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; padding: 0 4px; }
.noti-group-ic { width: 24px; height: 24px; border-radius: 7px; flex: none; display: grid; place-items: center; }
.noti-group-ic.red { background: #fdeaea; color: #d24b4b; }
.noti-group-ic.gold { background: #fdf3da; color: #b3820f; }
.noti-group-ic.blue { background: #e7f0fb; color: #2f7dc4; }
.noti-group-ic.green { background: #e7f6ee; color: #1d7a4f; }
.noti-group-title { font-weight: 700; font-size: .8rem; color: #11233f; }
.noti-group-hint { font-size: .68rem; color: #97a2b2; }
.noti-group-count { margin-left: auto; background: #eef1f6; color: #5b6675; font-weight: 700; font-size: .66rem; border-radius: 999px; padding: 1px 8px; }

.noti-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; cursor: pointer; transition: background .12s; }
.noti-item:hover { background: #f5f7fa; }
.noti-item-body { min-width: 0; flex: 1; }
.noti-item-title { font-weight: 600; font-size: .84rem; color: #1f2a37; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.noti-item-sub { font-size: .72rem; color: #6b7686; }
.noti-item-sub.overdue { color: #b3322f; font-weight: 600; }
.noti-chevron { color: #c2cad6; font-size: 18px !important; flex: none; }

.noti-empty { text-align: center; padding: 50px 20px; }
.noti-empty-ic { width: 60px; height: 60px; border-radius: 50%; background: #e7f6ee; color: #2e9e6b; display: grid; place-items: center; margin: 0 auto 12px; }
.noti-empty-t { font-weight: 700; color: #11233f; }
.noti-empty-s { font-size: .82rem; color: #6b7686; margin-top: 2px; }

/* Notifications panel: force white background (theme drawer bg is navy for the sidebar) */
.mud-drawer.noti-drawer { background-color: #ffffff !important; }
.mud-drawer.noti-drawer .mud-drawer-content { background-color: #ffffff !important; }

/* ============================ Staff chat (/chat) ============================ */
.chat-shell {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: calc(100vh - 150px);
    min-height: 460px;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 22px rgba(13,35,66,.06);
}

/* ---- sidebar ---- */
.chat-side { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fbfcfe; min-width: 0; }
.chat-side-head {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 18px; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--navy) 0%, #14365f 100%);
    letter-spacing: .2px;
}
.chat-side-head .mud-icon-root { color: var(--gold); }
.chat-side-list { flex: 1; overflow-y: auto; padding: 8px; }

.chat-conv {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 10px; border-radius: 12px; cursor: pointer;
    transition: background .12s; min-width: 0;
}
.chat-conv:hover { background: #eef2f8; }
.chat-conv.active { background: var(--gold-soft); box-shadow: inset 0 0 0 1px #ecd9ab; }

.chat-ava {
    flex: none; width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center; overflow: hidden;
    background: var(--navy); color: #fff; font-weight: 700; font-size: .9rem;
}
.chat-ava.sm { width: 38px; height: 38px; font-size: .82rem; }
.chat-ava.team { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%); }
.chat-ava img { width: 100%; height: 100%; object-fit: cover; }

.chat-conv-body { min-width: 0; flex: 1; }
.chat-conv-top { display: flex; align-items: baseline; gap: 8px; }
.chat-conv-name { font-weight: 700; font-size: .9rem; color: #1a2740; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.chat-conv-time { font-size: .68rem; color: #9aa5b4; flex: none; }
.chat-conv-sub { display: flex; align-items: center; gap: 6px; margin-top: 1px; }
.chat-conv-prev { font-size: .78rem; color: #6b7686; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.chat-conv-prev.muted { color: #9aa5b4; font-style: italic; }
.chat-badge {
    flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
    background: #e0322f; color: #fff; font-weight: 800; font-size: .68rem;
    display: grid; place-items: center;
}

/* ---- main ---- */
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f4f6fa; }
.chat-empty, .chat-nomsg { margin: auto; text-align: center; color: #8a96a6; }
.chat-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.chat-empty .mud-icon-root { font-size: 56px !important; color: #c2cdda; }
.chat-nomsg { padding: 30px; font-size: .9rem; }

.chat-head {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--line);
}
.chat-head-name { font-weight: 800; color: #16233c; }
.chat-head-sub { font-size: .76rem; color: #7a8696; }

.chat-msgs { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 3px; }

.chat-daysep { text-align: center; margin: 12px 0 8px; }
.chat-daysep span {
    background: #e4e9f1; color: #5d6b80; font-size: .7rem; font-weight: 700;
    padding: 3px 12px; border-radius: 999px;
}

.chat-row { display: flex; margin-top: 2px; }
.chat-row.mine { justify-content: flex-end; }
.chat-bubble {
    max-width: 70%; padding: 8px 12px 6px; border-radius: 14px;
    background: #fff; border: 1px solid var(--line);
    box-shadow: 0 1px 2px rgba(13,35,66,.05); position: relative;
}
.chat-bubble.mine { background: var(--navy); border-color: var(--navy); color: #fff; }
.chat-bubble-who { font-size: .72rem; font-weight: 800; color: var(--gold-deep); margin-bottom: 2px; }
.chat-bubble-text { font-size: .9rem; line-height: 1.35; white-space: pre-wrap; word-break: break-word; }
.chat-bubble-time { font-size: .64rem; color: #9aa5b4; text-align: right; margin-top: 3px; display: flex; align-items: center; gap: 3px; justify-content: flex-end; }
.chat-bubble.mine .chat-bubble-time { color: #aebfd6; }
.chat-read { font-size: 14px !important; color: #6fd0a0 !important; }

.chat-compose { position: relative; flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; background: #fff; border-top: 1px solid var(--line); }
.chat-compose-row { display: flex; align-items: flex-end; gap: 8px; }
.chat-input {
    flex: 1; resize: none; border: 1px solid var(--line); border-radius: 22px;
    padding: 10px 16px; font: inherit; font-size: .9rem; line-height: 1.4;
    max-height: 120px; min-height: 42px; outline: none; transition: border-color .12s, box-shadow .12s;
    background: #f7f9fc;
}
.chat-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); background: #fff; }
.chat-send { flex: none; }
.chat-icon-btn { flex: none; color: #6b7686 !important; }
.chat-icon-btn.on { color: var(--gold) !important; background: var(--gold-soft) !important; }
.chat-upl { flex: none; display: inline-flex; }
.chat-upl .mud-input-control { margin: 0 !important; }

/* @mention highlight inside bubbles */
.chat-mention { color: var(--navy); font-weight: 700; background: var(--gold-soft); border-radius: 4px; padding: 0 3px; }
.chat-bubble.mine .chat-mention { color: #fff; background: rgba(255,255,255,.22); }
.chat-mention.me { background: var(--gold); color: var(--navy); }

/* read receipt line under last own DM */
.chat-receipt { display: flex; align-items: center; gap: 4px; justify-content: flex-end; font-size: .68rem; color: #9aa5b4; margin: 1px 4px 6px; }
.chat-receipt.seen { color: #4aa97e; }
.chat-receipt .mud-icon-root { font-size: 14px !important; }

/* reference chip inside a bubble */
.chat-ref { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 10px;
    border: 1px solid var(--line); border-radius: 10px; background: #f7f9fc; text-decoration: none;
    color: var(--navy); max-width: 100%; }
.chat-bubble.mine .chat-ref { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
.chat-ref:hover { border-color: var(--gold); }
.chat-ref-ic { font-size: 18px !important; color: var(--gold) !important; flex: none; }
.chat-ref-k { font-size: .62rem; text-transform: uppercase; letter-spacing: .04em; opacity: .65; flex: none; }
.chat-ref-l { font-size: .82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* media + file attachments inside bubbles */
.chat-media { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chat-media img { max-width: 220px; max-height: 220px; border-radius: 10px; cursor: zoom-in; display: block; object-fit: cover; }
.chat-file { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 12px;
    border: 1px solid var(--line); border-radius: 10px; background: #f7f9fc; text-decoration: none; color: var(--navy); max-width: 320px; }
.chat-bubble.mine .chat-file { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
.chat-file:hover { border-color: var(--gold); }
.chat-file-ic { font-size: 22px !important; color: var(--gold) !important; flex: none; }
.chat-file-n { font-size: .82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file-s { font-size: .68rem; opacity: .6; flex: none; }

/* composer tray (staged ref + attachments) */
.chat-tray { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-chip-att, .chat-ref-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 10px;
    border: 1px solid var(--line); border-radius: 10px; background: #f7f9fc; max-width: 260px; }
.chat-ref-chip { border-color: var(--gold-soft); }
.chat-thumb { position: relative; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.chat-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-chip-x { border: none; background: rgba(13,35,66,.55); color: #fff; cursor: pointer; line-height: 1;
    border-radius: 999px; width: 18px; height: 18px; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: none; }
.chat-thumb .chat-chip-x { position: absolute; top: 2px; right: 2px; }
.chat-chip-att .chat-chip-x, .chat-ref-chip .chat-chip-x { background: #d8dee8; color: #4a5566; }
.chat-chip-att .chat-chip-x:hover, .chat-ref-chip .chat-chip-x:hover { background: #c0392b; color: #fff; }

/* entity-reference picker popover */
.chat-refpick { position: absolute; left: 16px; right: 16px; bottom: 64px; z-index: 30;
    background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(13,35,66,.18); padding: 10px; }
.chat-refpick-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.chat-refpick-tabs button { border: 1px solid var(--line); background: #f7f9fc; color: #4a5566; border-radius: 999px;
    padding: 4px 12px; font-size: .78rem; cursor: pointer; }
.chat-refpick-tabs button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chat-refpick-sp { flex: 1; }
.chat-refpick-close { margin-left: auto; width: 26px; height: 26px; border-radius: 8px; }
.chat-refpick-q { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: .85rem; outline: none; }
.chat-refpick-q:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.chat-refpick-list { max-height: 240px; overflow-y: auto; margin-top: 6px; }
.chat-refpick-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: none; background: none;
    padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: .85rem; color: var(--navy); }
.chat-refpick-item:hover { background: #f1f5fb; }
.chat-refpick-empty { padding: 14px; text-align: center; color: #9aa5b4; font-size: .82rem; }

/* @mention autocomplete popover */
.chat-mention-pop { position: absolute; left: 16px; bottom: 64px; z-index: 30; min-width: 240px; max-width: 340px;
    background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(13,35,66,.18); padding: 6px; }
.chat-mention-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none; background: none;
    padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.chat-mention-item:hover { background: #f1f5fb; }
.chat-mention-name { font-size: .85rem; font-weight: 600; color: var(--navy); }
.chat-mention-role { font-size: .72rem; color: #9aa5b4; margin-left: auto; }
.chat-ava.xs { width: 26px; height: 26px; font-size: .62rem; }

/* image lightbox */
.chat-lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(8,16,30,.82);
    display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.chat-lightbox img { max-width: 92vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); cursor: default; }
.chat-lightbox-x { position: fixed; top: 18px; right: 22px; width: 40px; height: 40px; border-radius: 999px;
    border: none; background: rgba(255,255,255,.16); color: #fff; font-size: 24px; cursor: pointer; }
.chat-lightbox-x:hover { background: rgba(255,255,255,.28); }

/* ticket «send email» dialog — branded preview */
.te-prev-label { font-size: .72rem; font-weight: 600; color: #6b7686; margin: 2px 0 6px; }
.te-prev { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f4f6f9; }
.te-prev iframe { width: 100%; height: 300px; border: none; background: #fff; display: block; }

/* chat: back-to-list button (mobile only) */
.chat-back-btn { display: none; align-items: center; justify-content: center; border: none; background: none;
    cursor: pointer; color: var(--navy); flex: none; width: 34px; height: 34px; border-radius: 9px; margin-right: 2px; }
.chat-back-btn:hover { background: #eef2f8; }
.chat-back-btn .mud-icon-root { font-size: 21px; }

/* Phone: one pane at a time — conversations list, then the open chat (with Back). */
@media (max-width: 760px) {
    .chat-shell { grid-template-columns: 1fr; height: calc(100vh - 130px); }
    .chat-main { display: none; }
    .chat-side { display: flex; }
    .chat-shell.open .chat-side { display: none; }
    .chat-shell.open .chat-main { display: flex; }
    .chat-back-btn { display: inline-flex; }
}

/* ============ List tables: stable column widths + tidy look ============ */
/* Columns keep their width across pages (no reflow when data changes). */
.mud-table.tbl-fixed .mud-table-root { table-layout: fixed; }
.mud-table.tbl-fixed td,
.mud-table.tbl-fixed th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mud-table.tbl-fixed td.wrap { white-space: normal; }            /* let a column wrap instead of ellipsis */
.mud-table.tbl-fixed td.acts,
.mud-table.tbl-fixed th.acts { overflow: visible; text-align: right; }
.mud-table.tbl-fixed td.num,
.mud-table.tbl-fixed th.num { text-align: right; }
.mud-table.tbl-fixed td.ctr,
.mud-table.tbl-fixed th.ctr { text-align: center; }
.mud-table.tbl-fixed .mud-table-cell { padding-top: 7px; padding-bottom: 7px; }
.mud-table.tbl-fixed .acts .mud-icon-button { margin: 0 1px; }

/* Sortable column headers (reusable SortHeader component) */
.sort-h { cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.sort-h:hover { color: var(--gold-deep); }
.sort-h.active { color: var(--navy); font-weight: 700; }
.sort-h-ic { font-size: 15px !important; }

/* Call console: handling-extension label on each active call */
.cc-call-ext { display: flex; align-items: center; gap: 4px; font-size: .68rem; color: #6b7686; margin-top: 2px; }
.cc-call-ext .mud-icon-root { color: #9aa5b4; }
.cc-you { background: var(--gold-soft); color: var(--gold-deep); font-weight: 700; font-size: .6rem; padding: 0 5px; border-radius: 999px; margin-left: 2px; }

/* live call timer */
.cc-timer { font-variant-numeric: tabular-nums; font-size: .72rem; font-weight: 700; color: #5b6675; background: #f0f2f6;
    border-radius: 6px; padding: 1px 6px; flex: none; }
/* consultation (second) line during an attended transfer */
.cc-call.consult { border-left: 3px solid var(--gold); background: #fffdf6; }
.cc-call-dir.consult { background: var(--gold-soft); color: var(--gold-deep); }
/* clickable extension rows + popover */
.cc-ext-row { cursor: pointer; border-radius: 8px; }
.cc-ext-row:hover { background: #f1f5fb; }
.cc-ext-row.open { background: #eaf1fb; }
.cc-ext-row.me .cc-ext-num { color: var(--gold-deep); font-weight: 700; }
.cc-ext-pop { margin: 2px 0 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
    box-shadow: 0 6px 18px rgba(13,35,66,.1); }
.cc-ext-pop-row { display: flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--navy); margin-bottom: 4px; }
.cc-ext-pop-row .mud-icon-root { color: #8a94a3; }
.cc-ext-pop-row.busy { color: #b3322f; }
.cc-ext-pop-row.busy .mud-icon-root { color: #d24b4b; }
.cc-ext-pop-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.cc-ext-pop-you { font-size: .75rem; color: #8a94a3; font-style: italic; }

/* Date/time picker calendar must keep its natural width even when the field has a max-width
   (MudBlazor leaks the field's inline max-width onto the popover, clipping the calendar). */
.mud-picker-popover { width: max-content !important; max-width: none !important; }
.mud-picker-popover .mud-paper,
.mud-picker-popover .mud-picker-container { max-width: none !important; }
.mud-picker-popover .mud-picker-container { min-width: 312px; }

/* ============ Mail client (/mail) ============ */
.mail-shell {
    display: grid;
    grid-template-columns: 248px 330px 1fr;
    grid-template-rows: 1fr;                 /* single row fills the height so panes scroll internally */
    height: calc(100vh - 150px);
    min-height: 480px;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 6px 22px rgba(13,35,66,.06);
}
.mail-shell.side-collapsed { grid-template-columns: 56px 330px 1fr; }

/* accounts + folders */
.mail-side { border-right: 1px solid var(--line); overflow-y: auto; min-height: 0; background: #fafbfd; padding: 8px; }
.mail-side-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px; }
.mail-side-title { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: #9aa5b4; font-weight: 600; }
.mail-side-toggle { border: none; background: none; cursor: pointer; color: #6b7686; border-radius: 6px; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.mail-side-toggle:hover { background: #e7edf6; color: var(--navy); }
.mail-uni { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 10px; cursor: pointer; margin-bottom: 4px; }
.mail-uni:hover { background: #eef2f8; }
.mail-uni.active { background: var(--navy); color: #fff; }
.mail-uni .mud-icon-root { font-size: 20px; flex: none; }
.mail-uni.active .mud-icon-root { color: var(--gold); }
.mail-uni-label { font-size: .85rem; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-acc-av { flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--gold-soft); color: var(--gold-deep);
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .72rem; }
.mail-acc.active .mail-acc-av { background: var(--gold); color: var(--navy); }
.mail-acc-chip { flex: none; font-size: .62rem; font-weight: 600; color: #6b7686; background: #eef2f8; border-radius: 5px; padding: 1px 6px; }
/* collapsed drawer: show only icons/avatars */
.side-collapsed .mail-side-title, .side-collapsed .mail-acc-body, .side-collapsed .mail-uni-label,
.side-collapsed .mail-folders, .side-collapsed .mail-acc .mail-badge, .side-collapsed .mail-uni .mail-badge { display: none; }
.side-collapsed .mail-side-head { justify-content: center; }
.side-collapsed .mail-acc, .side-collapsed .mail-uni { justify-content: center; padding: 9px 4px; }

/* list + reading panes must be able to shrink so their children scroll */
.mail-list, .mail-read { min-height: 0; }
.mail-acc { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.mail-acc:hover { background: #eef2f8; }
.mail-acc.active { background: var(--navy); color: #fff; }
.mail-acc .mud-icon-root { font-size: 20px; flex: none; }
.mail-acc.active .mud-icon-root { color: var(--gold); }
.mail-acc-body { min-width: 0; flex: 1; }
.mail-acc-name { font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-acc-mail { font-size: .68rem; opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-badge { background: var(--gold); color: var(--navy); font-weight: 700; font-size: .66rem; min-width: 18px; height: 18px;
    border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; flex: none; }
.mail-badge.sm { font-size: .6rem; min-width: 16px; height: 16px; }
.mail-folders { margin: 2px 0 8px 8px; padding-left: 6px; border-left: 1px solid var(--line); }
.mail-folder { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 8px; cursor: pointer; }
.mail-folder:hover { background: #eef2f8; }
.mail-folder.active { background: var(--gold-soft); }
.mail-folder.active .mail-folder-name { color: var(--navy); font-weight: 700; }
.mail-folder-ic { font-size: 17px !important; color: #6b7686 !important; flex: none; }
.mail-folder-name { font-size: .82rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-folder-note { font-size: .72rem; color: #9aa5b4; padding: 6px 9px; }

/* message list */
.mail-list { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-width: 0; }
.mail-toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.mail-search { flex: 1; display: flex; align-items: center; gap: 6px; background: #f3f6fa; border: 1px solid var(--line);
    border-radius: 10px; padding: 5px 10px; }
.mail-search input { border: none; background: none; outline: none; font: inherit; font-size: .82rem; flex: 1; min-width: 0; }
.mail-search-x { border: none; background: #d8dee8; color: #4a5566; width: 18px; height: 18px; border-radius: 999px; cursor: pointer; font-size: 13px; line-height: 1; }
.mail-items { flex: 1; min-height: 0; overflow-y: auto; }
.mail-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px 10px 14px; border-bottom: 1px solid #f0f3f8; cursor: pointer; position: relative; }
.mail-item:hover { background: #f7f9fc; }
.mail-item.active { background: #eaf1fb; box-shadow: inset 3px 0 0 var(--navy); }
.mail-item.unread { background: #fffdf6; }
.mail-item.unread .mail-item-from, .mail-item.unread .mail-item-subj { font-weight: 700; color: var(--navy); }
.mail-item-main { min-width: 0; flex: 1; }
.mail-unread-dot { position: absolute; left: 5px; top: 50%; transform: translateY(-50%); width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.mail-ava-sm, .mail-ava-md { flex: none; border-radius: 50%; background: var(--navy); color: #fff; display: inline-flex;
    align-items: center; justify-content: center; font-weight: 600; }
.mail-ava-sm { width: 34px; height: 34px; font-size: .72rem; }
.mail-ava-md { width: 40px; height: 40px; font-size: .8rem; }
.mail-item.unread .mail-ava-sm { background: var(--gold); color: var(--navy); }
.mail-item-top { display: flex; justify-content: space-between; gap: 8px; }
.mail-item-from { font-size: .82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item-date { font-size: .68rem; color: #9aa5b4; flex: none; }
.mail-item-subj { font-size: .8rem; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.mail-item-prev { font-size: .72rem; color: #8a95a5; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.mail-flag { font-size: 14px !important; color: var(--gold) !important; }
.mail-clip { font-size: 14px !important; color: #9aa5b4 !important; }
.mail-cust { background: var(--gold-soft); color: var(--gold-deep); font-size: .64rem; font-weight: 600; padding: 0 5px; border-radius: 5px; flex: none; }
.mail-more { width: 100%; border: none; background: none; color: var(--navy); padding: 12px; cursor: pointer; font-size: .8rem; font-weight: 600; }
.mail-more:hover { background: #f1f5fb; }

/* reading pane */
.mail-read { display: flex; flex-direction: column; min-width: 0; }
.mail-read-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.mail-read-subj { font-size: 1.1rem; font-weight: 700; color: var(--navy); }
.mail-read-id { display: flex; align-items: flex-start; gap: 12px; margin-top: 8px; }
.mail-read-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.mail-read-from { font-weight: 600; font-size: .88rem; }
.mail-read-addr { color: #8a95a5; font-size: .8rem; margin-left: 4px; }
.mail-read-date { color: #8a95a5; font-size: .75rem; flex: none; }
.mail-read-to { color: #8a95a5; font-size: .75rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-read-actions { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.mail-cust-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--navy);
    background: var(--gold-soft); padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.mail-cust-link .mud-icon-root { font-size: 16px; color: var(--gold-deep); }
.mail-atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.mail-att { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line);
    border-radius: 10px; background: #f7f9fc; text-decoration: none; color: var(--navy); max-width: 280px; }
.mail-att:hover { border-color: var(--gold); }
.mail-att-ic { font-size: 20px !important; color: var(--gold) !important; flex: none; }
.mail-att-n { flex: 0 1 auto; min-width: 0; font-size: .8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; color: var(--navy); }
.mail-att-n:hover { text-decoration: underline; }
.mail-att-s { font-size: .68rem; opacity: .6; flex: none; }
.mail-att-dl { display: inline-flex; align-items: center; color: #6b7686; text-decoration: none; flex: none; }
.mail-att-dl:hover { color: var(--gold-deep); }
.mail-att-dl .mud-icon-root { font-size: 17px !important; }
.mail-body { flex: 1; min-height: 0; overflow: auto; }
.mail-frame-wrap { position: relative; width: 100%; height: 100%; }
.mail-frame-spin { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #fff; z-index: 1; }
.mail-frame { width: 100%; height: 100%; border: none; background: #fff; opacity: 0; transition: opacity .15s ease; }
.mail-text { padding: 18px 20px; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: .88rem; margin: 0; }
.mail-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    color: #9aa5b4; font-size: .85rem; padding: 28px; }
.mail-empty.big { height: 100%; }
.mail-empty.big .mud-icon-root { font-size: 44px; color: #cdd6e2; }

.mail-compose-btn { flex: none; }
.mail-reply-group { display: inline-flex; gap: 6px; }

/* sidebar account chevron (expand/collapse folders) */
.mail-acc-chev { font-size: 18px !important; color: #9aa5b4 !important; flex: none; margin: 0 -3px 0 -2px; }

/* attachment chip: clickable name/icon opens the preview modal */
.mail-att-open { display: inline-flex; align-items: center; gap: 8px; border: none; background: none; cursor: pointer;
    padding: 0; min-width: 0; color: var(--navy); font: inherit; }
.mail-att-open:hover .mail-att-n { text-decoration: underline; color: var(--gold-deep); }

/* attachment preview modal */
.mail-attprev-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mail-attprev-title .mud-icon-root { color: var(--gold); flex: none; }
.mail-attprev-name { font-weight: 600; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-attprev { display: flex; align-items: center; justify-content: center; min-height: 60vh; background: #f4f6f9; border-radius: 10px; overflow: hidden; }
.mail-attprev-img { max-width: 100%; max-height: 74vh; object-fit: contain; display: block; }
.mail-attprev-frame { width: 100%; height: 74vh; border: none; background: #fff; }
.mail-attprev-video { max-width: 100%; max-height: 74vh; background: #000; }
.mail-attprev-media { padding: 40px; }
.mail-attprev-none { display: flex; flex-direction: column; align-items: center; gap: 12px; color: #6b7686; padding: 48px; }
.mail-attprev-none .mud-icon-root { font-size: 48px; color: #cdd6e2; }

/* branch / contact info card lines */
.branch-line { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: #6b7686; margin-top: 3px; }
.branch-line .mud-icon-root { font-size: 16px !important; color: #9aa5b4 !important; flex: none; }

/* sidebar: tags / categories */
.mail-tags-sec { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.mail-tags-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 4px; }
.mail-tags-head span { font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #8a95a5; }
.mail-tagrow { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 8px; cursor: pointer; }
.mail-tagrow:hover { background: #eef2f8; }
.mail-tagrow.active { background: var(--gold-soft); }
.mail-tagrow.active .mail-tagrow-name { color: var(--navy); font-weight: 700; }
.mail-tagrow-name { font-size: .8rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-tagdot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.side-collapsed .mail-tags-sec { display: none; }

/* tag chips on list rows + reading pane */
.mail-item-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.mail-tagchip { font-size: .64rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; line-height: 1.5; white-space: nowrap; }
.mail-tagchip.lg { font-size: .72rem; padding: 2px 9px; display: inline-flex; align-items: center; gap: 5px; }
.mail-tagchip-x { border: none; background: none; cursor: pointer; font-size: 13px; line-height: 1; color: inherit; opacity: .6; padding: 0; }
.mail-tagchip-x:hover { opacity: 1; }
.mail-read-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 20px; border-bottom: 1px solid var(--line); }
.mail-tagmenu { display: inline-flex; align-items: center; gap: 7px; }
.mail-tagmenu .mail-tagdot { width: 12px; height: 12px; }

/* drafts list rows */
.mail-draft-item .mail-ava-sm.draft { background: #eef2f8; color: #6b7686; }
.mail-draft-item .mail-ava-sm.draft .mud-icon-root { font-size: 18px; }
.mail-draft-x { border: none; background: none; cursor: pointer; color: #b6c0cd; align-self: center; flex: none; padding: 4px; border-radius: 8px; }
.mail-draft-x:hover { color: #c0392b; background: #fdecea; }
.mail-draft-x .mud-icon-root { font-size: 18px !important; }

/* composer: draft-saved indicator + manager */
.mail-compose-title { display: flex; align-items: center; gap: 12px; }
.mail-draft-saved { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; color: #2e7d32; font-weight: 600; }
.mail-draft-saved .mud-icon-root { font-size: 15px !important; color: #2e7d32 !important; }
.mail-tagmgr { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.mail-tagmgr-row { display: flex; align-items: center; gap: 9px; padding: 4px 2px; }
.mail-tagmgr-name { flex: 1; font-size: .85rem; }
.mail-tagnew { display: flex; flex-direction: column; gap: 8px; }
.mail-tagpalette { display: flex; flex-wrap: wrap; gap: 6px; }
.mail-tagswatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.mail-tagswatch.sel { border-color: var(--navy); box-shadow: 0 0 0 2px #fff inset; }

/* rich-text editor */
.rte { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: visible; background: #fff; }
.rte-tb { display: flex; align-items: center; gap: 1px; padding: 5px 8px; border-bottom: 1px solid var(--line); background: #f7f9fc; flex-wrap: wrap; border-radius: 10px 10px 0 0; }
.rte-grp { display: inline-flex; }
.rte-b { border: none; background: none; cursor: pointer; min-width: 28px; height: 28px; padding: 0 4px; border-radius: 6px; color: #4a5566;
    display: inline-flex; align-items: center; justify-content: center; gap: 1px; font-size: .9rem; line-height: 1; }
.rte-b:hover { background: #e7edf6; color: var(--navy); }
.rte-b .mud-icon-root { font-size: 18px !important; }
.rte-caret { font-size: .6rem; opacity: .6; }
.rte-i { font-style: italic; }
.rte-u { text-decoration: underline; }
.rte-s { text-decoration: line-through; }
.rte-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.rte-pop { position: absolute; z-index: 40; top: 40px; left: 8px; background: #fff; border: 1px solid var(--line);
    border-radius: 10px; box-shadow: 0 8px 24px rgba(13,35,66,.16); padding: 6px; }
.rte-size-o { display: block; width: 100%; min-width: 130px; text-align: left; border: none; background: none; cursor: pointer;
    padding: 6px 10px; border-radius: 6px; color: #1f2a37; }
.rte-size-o:hover { background: #f1f5fb; }
.rte-palette { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.rte-swatch { width: 24px; height: 24px; border-radius: 6px; border: 1px solid rgba(0,0,0,.12); cursor: pointer; }
.rte-swatch:hover { transform: scale(1.08); }
.rte-area { min-height: 220px; max-height: 360px; overflow-y: auto; padding: 12px 14px; outline: none; font-size: .9rem; line-height: 1.5; color: #1f2a37; }
.rte-area:empty:before { content: attr(data-ph); color: #9aa5b4; }
.rte-area img { max-width: 100%; }
.rte-area blockquote { margin: 0; padding-left: 12px; border-left: 2px solid #d0d7e2; color: #555; }
.rte-area a { color: var(--gold-deep); }
.mail-ticket-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--navy);
    background: #eef2f8; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.mail-ticket-link .mud-icon-root { font-size: 16px; color: var(--navy); }
.mail-compose-atts { display: flex; flex-wrap: wrap; gap: 6px; }
.mail-chip-att { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line);
    border-radius: 8px; background: #f7f9fc; font-size: .78rem; }
.mail-chip-att .mail-att-ic { font-size: 16px !important; }
.mail-link-list { margin-top: 8px; max-height: 280px; overflow-y: auto; }
.mail-link-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: none; background: none;
    padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: .85rem; color: var(--navy); }
.mail-link-item:hover { background: #f1f5fb; }
.mail-link-item .mud-icon-root { font-size: 18px; color: var(--gold-deep); }

/* filter bar + selection bar */
.mail-filterbar { display: flex; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: #fafbfd; }
.mail-fchip { border: 1px solid var(--line); background: #fff; color: #4a5566; border-radius: 999px; padding: 3px 12px; font-size: .76rem; cursor: pointer; }
.mail-fchip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.mail-selbar { display: flex; align-items: center; gap: 4px; padding: 5px 10px; border-bottom: 1px solid var(--line); background: var(--gold-soft); }
.mail-sel-n { font-size: .8rem; font-weight: 700; color: var(--gold-deep); }

/* message-row selection: the avatar circle IS the checkbox — same footprint always, so nothing shifts */
.mail-ava-sm { position: relative; cursor: pointer; }
.mail-ava-ini { transition: opacity .12s ease; }
.mail-ava-check { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    color: #fff; opacity: 0; transition: opacity .12s ease; pointer-events: none; }
.mail-ava-check svg { width: 18px; height: 18px; }
/* hover but not yet ticked: faint check + dimmed initials → "you can click me" */
.mail-item:hover .mail-ava-sm:not(.checked) .mail-ava-ini { opacity: .2; }
.mail-item:hover .mail-ava-sm:not(.checked) .mail-ava-check { opacity: .5; }
/* ticked: strong check, initials hidden, ring to signal "selected" */
.mail-ava-sm.checked .mail-ava-ini { opacity: 0; }
.mail-ava-sm.checked .mail-ava-check { opacity: 1; }
.mail-ava-sm.checked { box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--navy); }
.mail-item.selected { background: #eaf1fb; }

/* right-click context menu */
.mail-ctx-backdrop { position: fixed; inset: 0; z-index: 1400; }
.mail-ctx { position: fixed; z-index: 1401; min-width: 210px; background: #fff; border: 1px solid var(--line);
    border-radius: 10px; box-shadow: 0 12px 36px rgba(13,35,66,.2); padding: 5px; }
.mail-ctx-i { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; text-align: left; border: none; background: none;
    cursor: pointer; padding: 8px 11px; border-radius: 7px; font-size: .84rem; color: var(--navy); }
.mail-ctx-i:hover { background: #f1f5fb; }
.mail-ctx-i .mud-icon-root { font-size: 18px !important; color: #6b7686; }
.mail-ctx-i.danger { color: #c0392b; }
.mail-ctx-i.danger .mud-icon-root { color: #c0392b; }
.mail-ctx-sep { height: 1px; background: var(--line); margin: 4px 6px; }

/* pop-out window page */
.mpop { padding: 18px 22px; background: #fff; min-height: 100vh; color: #1f2a37; }
.mpop-empty { padding: 40px; text-align: center; color: #9aa5b4; }
.mpop-head { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.mpop-subj { font-size: 1.25rem; font-weight: 700; color: var(--navy); }
.mpop-from { font-size: .9rem; font-weight: 600; margin-top: 6px; }
.mpop-addr { color: #8a95a5; font-weight: 400; margin-left: 4px; }
.mpop-date { color: #8a95a5; font-weight: 400; }
.mpop-to { font-size: .78rem; color: #8a95a5; margin-top: 3px; }
.mpop-atts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mpop-att { font-size: .82rem; color: var(--navy); background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px; text-decoration: none; }
.mpop-att:hover { border-color: var(--gold); }
.mpop-frame { width: 100%; height: calc(100vh - 220px); border: none; }
.mpop-text { white-space: pre-wrap; word-break: break-word; font: inherit; font-size: .9rem; }

/* recipient address-book field (composer) */
.rcp { position: relative; }
.rcp-label { display: block; font-size: .7rem; color: #6b7686; margin-bottom: 3px; }
.rcp-in { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; font-size: .85rem; outline: none; box-sizing: border-box; }
.rcp-in:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.rcp-pop { position: absolute; z-index: 50; left: 0; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--line);
    border-radius: 10px; box-shadow: 0 10px 30px rgba(13,35,66,.16); max-height: 260px; overflow-y: auto; padding: 4px; }
.rcp-item { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; border: none; background: none; cursor: pointer; padding: 7px 10px; border-radius: 7px; }
.rcp-item:hover { background: #f1f5fb; }
.rcp-i-main { font-size: .82rem; color: var(--navy); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.rcp-cust { font-weight: 600; }
.rcp-cont { color: #6b7686; }
.rcp-which { font-size: .58rem; background: var(--gold-soft); color: var(--gold-deep); border-radius: 4px; padding: 0 5px; font-weight: 600; text-transform: uppercase; }
.rcp-i-mail { font-size: .75rem; color: #8a95a5; }

/* customer 360 → Email tab */
.cust-mail-list { display: flex; flex-direction: column; gap: 6px; }
.cust-mail { display: flex; align-items: flex-start; gap: 11px; padding: 11px 13px; border: 1px solid var(--line);
    border-radius: 12px; background: #fff; text-decoration: none; color: var(--navy); transition: border-color .12s, background .12s; }
.cust-mail:hover { border-color: var(--gold); background: #fffdf6; }
.cust-mail-ic { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.cust-mail-ic.in { background: #e7f1fb; color: #185fa5; }
.cust-mail-ic.out { background: var(--gold-soft); color: var(--gold-deep); }
.cust-mail-body { min-width: 0; flex: 1; }
.cust-mail-top { display: flex; justify-content: space-between; gap: 10px; }
.cust-mail-from { font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-mail-date { font-size: .72rem; color: #9aa5b4; flex: none; }
.cust-mail-subj { font-size: .82rem; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-mail-subj .mud-icon-root { color: #9aa5b4; vertical-align: -2px; }
.cust-mail-prev { font-size: .74rem; color: #8a95a5; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-mail-acc { flex: none; align-self: center; font-size: .66rem; color: #6b7686; background: #f0f2f6; border-radius: 6px; padding: 2px 7px; }

/* ===================== Mobile / tablet responsive ===================== */
/* mail: mobile-only controls, hidden on desktop */
.mail-folders-btn { display: none; }
.mail-back-btn { display: none; align-items: center; gap: 4px; border: none; background: none; cursor: pointer;
    color: var(--navy); font: inherit; font-size: .82rem; font-weight: 600; padding: 0 0 8px; }
.mail-back-btn .mud-icon-root { font-size: 19px; }
.mail-side-backdrop { display: none; }

/* Tablet: folders slide over; list + reading share the width. */
@media (max-width: 1100px) {
    .mail-shell { grid-template-columns: 330px 1fr; position: relative; }
    .mail-side { position: absolute; top: 0; bottom: 0; left: 0; z-index: 30; width: 270px;
        transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 18px 44px rgba(13,35,66,.2); }
    .mail-shell.show-side .mail-side { transform: none; }
    .mail-side-backdrop { position: absolute; inset: 0; z-index: 25; background: rgba(13,35,66,.32); }
    .mail-shell.show-side .mail-side-backdrop { display: block; }
    .mail-folders-btn { display: inline-flex !important; }
    .mail-read { display: flex; }
}

/* Phone: one pane at a time — list, then the open message with a Back button. */
@media (max-width: 640px) {
    .mail-shell { grid-template-columns: 1fr; border-radius: 12px; }
    .mail-list { border-right: none; }
    .mail-read { display: none; }
    .mail-shell.reading .mail-list { display: none; }
    .mail-shell.reading .mail-read { display: flex; }
    .mail-side { width: 86vw; max-width: 320px; }
    .mail-back-btn { display: inline-flex; }
    .mail-read-head { padding: 12px 14px 10px; }
    .mail-read-subj { font-size: 1rem; }
    .mail-frame-wrap, .mail-frame { min-height: 58vh; }
    .mail-shell { height: calc(100vh - 132px); }
}

/* Global phone polish across all pages */
@media (max-width: 640px) {
    .noti-stack { right: 10px; left: 10px; bottom: 10px; width: auto; }
    .mud-dialog { max-width: calc(100vw - 20px) !important; }
    .mud-table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .cc-panel { width: calc(100vw - 18px); }
    .callpop { left: 10px; right: 10px; }
    /* page header rows that pack a title + actions should wrap instead of overflowing */
    .page-head, .pagehead, .list-head, .section-head { flex-wrap: wrap; row-gap: 8px; }
}
