@font-face {
    font-family: 'Anthropic Serif Display';
    src: url('../fonts/font.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.14s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

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

button,
input,
select,
textarea {
    font-family: inherit
}

:root {
    --bg: #f8fafc;
    --surface: #fff;
    --card: #fff;
    --border: #e2e8f0;
    --border2: #cbd5e1;
    --accent: #ff335f;
    --accent-h: #e0183e;
    --accent-g: #16a34a;
    --accent-y: #d97706;
    --accent-b: #2563eb;
    --accent-p: #7c3aed;
    --accent-o: #ea580c;
    --text: #0f172a;
    --muted: #64748b;
    --muted2: #94a3b8;
    --sidebar: #fff;
    --sidebar-text: #374151;
    --mono: 'JetBrains Mono', monospace;
    --sans: 'Inter', sans-serif;
    --display: 'Unbounded', sans-serif;
    --r: 12px;
    --r-sm: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .04);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
    --trans: .16s ease;
    --hover: #f8fafc;
    --input-bg: #f8fafc;
    --status-red-bg: #fff0f3;
    --status-red-text: #991b1b;
    --status-red-border: #fecdd3;
    --status-green-bg: #f0fdf4;
    --status-green-text: #166534;
    --status-green-border: #bbf7d0;
    --status-yellow-bg: #fffbeb;
    --status-yellow-text: #92400e;
    --status-yellow-border: #fde68a;
    --status-blue-bg: #eff6ff;
    --status-blue-text: #1d4ed8;
    --status-blue-border: #bfdbfe;
    --status-purple-bg: #f5f3ff;
    --status-purple-text: #5b21b6;
    --status-purple-border: #ddd6fe;
    --status-neutral-bg: #f1f5f9;
    --status-neutral-text: #64748b;
    --status-neutral-border: #cbd5e1;
    --status-orange-bg: #fff7ed;
    --status-orange-text: #9a3412;
    --status-orange-border: #fed7aa;
    --status-cyan-bg: #ecfeff;
    --status-cyan-text: #0891b2;
    --status-cyan-border: #a5f3fc;
}

[data-theme="dark"] {
    --bg: #0d0d0f;
    --surface: #131316;
    --card: #18181c;
    --border: #2a2a30;
    --border2: #3a3a42;
    --text: #e8e8f0;
    --muted: #7a7a8a;
    --muted2: #55555f;
    --sidebar: #101013;
    --sidebar-text: #c8c8d8;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --hover: #1c1c21;
    --input-bg: #1c1c21;
    --status-red-bg: #3a1519;
    --status-red-text: #ff8a97;
    --status-red-border: #5c1f26;
    --status-green-bg: #0f2a1a;
    --status-green-text: #5fd88a;
    --status-green-border: #1c4a2c;
    --status-yellow-bg: #332408;
    --status-yellow-text: #f0b849;
    --status-yellow-border: #523a0c;
    --status-blue-bg: #101f38;
    --status-blue-text: #7cb0ff;
    --status-blue-border: #1c3660;
    --status-purple-bg: #241a3d;
    --status-purple-text: #c4a6ff;
    --status-purple-border: #3a2a63;
    --status-neutral-bg: #202024;
    --status-neutral-text: #a0a0ac;
    --status-neutral-border: #33333a;
    --status-orange-bg: #3a2210;
    --status-orange-text: #ff9d5c;
    --status-orange-border: #5c3a1c;
    --status-cyan-bg: #062b33;
    --status-cyan-text: #22d3ee;
    --status-cyan-border: #0e7490;
}

html,
body {
    height: 100%
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column
}

.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.auth-bg-blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

.auth-bg-blob-1 {
    width: 580px;
    height: 580px;
    top: 10%;
    left: 15%;
    background: radial-gradient(circle at center, rgba(255, 51, 95, .42) 0%, rgba(255, 51, 95, .22) 38%, rgba(255, 51, 95, .06) 62%, rgba(255, 51, 95, 0) 74%);
    filter: blur(34px);
    animation: authOrbMove1 22s cubic-bezier(.45, 0, .55, 1) infinite alternate;
}

.auth-bg-blob-2 {
    width: 500px;
    height: 500px;
    bottom: 8%;
    right: 12%;
    background: radial-gradient(circle at center, rgba(99, 102, 241, .32) 0%, rgba(244, 63, 94, .18) 42%, rgba(99, 102, 241, .05) 65%, rgba(0, 0, 0, 0) 75%);
    filter: blur(38px);
    animation: authOrbMove2 28s cubic-bezier(.45, 0, .55, 1) infinite alternate;
}

.auth-bg-blob-3 {
    width: 360px;
    height: 360px;
    top: 55%;
    left: 22%;
    background: radial-gradient(circle at center, rgba(255, 107, 138, .30) 0%, rgba(255, 51, 95, .14) 45%, rgba(255, 51, 95, 0) 72%);
    filter: blur(30px);
    animation: authOrbMove3 18s ease-in-out infinite alternate;
}

@keyframes authOrbMove1 {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    25% {
        transform: translate3d(320px, 80px, 0) scale(1.14);
    }

    50% {
        transform: translate3d(200px, 320px, 0) scale(0.94);
    }

    75% {
        transform: translate3d(-180px, 200px, 0) scale(1.12);
    }

    100% {
        transform: translate3d(-80px, -60px, 0) scale(1.02);
    }
}

@keyframes authOrbMove2 {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    25% {
        transform: translate3d(-260px, -120px, 0) scale(1.16);
    }

    50% {
        transform: translate3d(-140px, 180px, 0) scale(0.92);
    }

    75% {
        transform: translate3d(240px, -60px, 0) scale(1.18);
    }

    100% {
        transform: translate3d(60px, 140px, 0) scale(1);
    }
}

@keyframes authOrbMove3 {
    0% {
        transform: translate3d(0, 0, 0) scale(0.92);
    }

    50% {
        transform: translate3d(180px, -160px, 0) scale(1.18);
    }

    100% {
        transform: translate3d(-120px, 120px, 0) scale(0.96);
    }
}

.auth-box {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 24px;
    padding: 40px 36px 32px;
    width: 100%;
    max-width: 430px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, .03),
        0 20px 40px -10px rgba(255, 51, 95, .14),
        0 25px 60px -15px rgba(15, 23, 42, .12);
    transition: all .3s ease;
}

[data-theme="dark"] .auth-box {
    background: rgba(24, 24, 28, 0.84);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, .3),
        0 20px 40px -10px rgba(255, 51, 95, .22),
        0 25px 60px -15px rgba(0, 0, 0, .5);
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-brand-logo-wrap {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    transition: transform .28s cubic-bezier(.34, 1.56, .64, 1);
    cursor: default;
}

.auth-brand-logo-wrap:hover {
    transform: scale(1.08);
}

.auth-brand-logo {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 18px;
    filter: drop-shadow(0 10px 22px rgba(255, 51, 95, .42));
    transition: filter .25s ease;
}

.auth-brand-logo-wrap:hover .auth-brand-logo {
    filter: drop-shadow(0 14px 28px rgba(255, 51, 95, .55));
}

.auth-title {
    font-family: var(--display);
    font-size: 17px;
    font-weight: 900;
    color: var(--text);
    letter-spacing: .03em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-title-tag {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(255, 51, 95, .12);
    color: var(--accent);
    font-family: var(--mono);
    letter-spacing: .04em;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
    font-weight: 400;
}

.auth-step {
    display: none
}

.auth-step.active {
    display: block
}

.auth-field-group {
    margin-bottom: 18px
}

.auth-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.auth-field-sub {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
    line-height: 1.45;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-prefix {
    position: absolute;
    left: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: rgba(255, 51, 95, .08);
    color: var(--accent);
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 700;
    pointer-events: none;
    z-index: 5;
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}

.auth-input {
    width: 100%;
    background: var(--surface);
    border: 1.5px solid var(--border2);
    border-radius: 12px;
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    padding: 13px 16px 13px 48px !important;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease, padding-left .15s ease;
}

.auth-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 51, 95, .14);
}

.auth-input::placeholder {
    color: var(--muted2);
    opacity: .8;
}

.auth-input-wrap.has-at-in-input .auth-input-prefix {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.7);
    pointer-events: none;
}

.auth-input-wrap.has-at-in-input .auth-input {
    padding-left: 16px !important;
}

.auth-messenger-group {
    margin: 18px 0 14px;
}

.auth-messenger-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    user-select: none;
}

.auth-messenger-tabs {
    display: flex !important;
    width: 100% !important;
    margin-bottom: 0 !important;
    box-sizing: border-box !important;
    background: var(--surface) !important;
    border: 1.5px solid var(--border2) !important;
    border-radius: 12px !important;
    padding: 4px !important;
    position: relative !important;
    box-shadow: none !important;
}

.auth-messenger-tabs .cr-tabs-glider {
    box-shadow: none !important;
    background: var(--accent) !important;
}

.auth-messenger-btn {
    flex: 1 !important;
    justify-content: center !important;
    padding: 10px 16px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    gap: 8px !important;
    border-radius: 8px !important;
    color: var(--muted) !important;
    transition: color .22s ease !important;
}

.auth-messenger-btn.active {
    color: #fff !important;
}

.auth-messenger-btn:hover:not(.active) {
    color: var(--text) !important;
}

.auth-messenger-icon {
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.auth-options-row {
    margin: 14px 0 22px;
}

.auth-remember-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    text-transform: none !important;
    letter-spacing: normal !important;
    transition: opacity var(--trans);
}

.auth-remember-row:hover {
    opacity: .85
}

.auth-remember-row input[type=checkbox] {
    width: 19px !important;
    height: 19px !important;
    border-radius: 6px !important;
    border: 1.5px solid var(--border2) !important;
    margin: 0 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
}

.auth-remember-row input[type=checkbox]:checked {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
}

.auth-remember-text {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: none !important;
}

.auth-remember-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(255, 51, 95, .12);
    color: var(--accent);
    letter-spacing: .02em;
    text-transform: none !important;
}

.auth-license-row {
    margin: 0 0 16px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
    text-align: center;
    user-select: none;
}

.auth-license-link {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--trans), opacity var(--trans);
}

.auth-license-link:hover {
    color: var(--accent-h);
    text-decoration: underline;
    opacity: .9;
}

.license-modal-overlay {
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    background: rgba(0, 0, 0, .38) !important;
}

.auth-btn {
    width: 100%;
    background: linear-gradient(135deg, #ff335f 0%, #e61a49 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 700;
    padding: 14px 20px;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 16px rgba(255, 51, 95, .32);
    letter-spacing: .01em;
}

.auth-btn:hover {
    background: linear-gradient(135deg, #ff2654 0%, #db1240 100%);
    box-shadow: 0 6px 22px rgba(255, 51, 95, .42);
}

.auth-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    box-shadow: none;
}

.auth-btn-icon {
    flex-shrink: 0;
    transition: transform .2s ease;
}

.auth-btn:hover:not(:disabled) .auth-btn-icon {
    transform: translateX(2px) translateY(-1px);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.auth-footer-shield {
    opacity: .8;
    font-size: 13px;
}

.wait-card {
    background: var(--hover);
    border: 2px dashed var(--border2);
    border-radius: 18px;
    padding: 32px 24px;
    text-align: center;
    margin-bottom: 20px;
}

.wait-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

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

    50% {
        opacity: .6;
        transform: scale(.95)
    }
}

.wait-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.wait-sub {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.6;
}

.wait-username {
    font-family: var(--mono);
    color: var(--accent);
    font-weight: 700;
    font-size: 14.5px;
}

.dots-loader {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px
}

.dots-loader span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: dots .9s ease-in-out infinite
}

.dots-loader span:nth-child(2) {
    animation-delay: .15s
}

.dots-loader span:nth-child(3) {
    animation-delay: .3s
}

@keyframes dots {

    0%,
    80%,
    100% {
        transform: scale(.6);
        opacity: .4
    }

    40% {
        transform: scale(1);
        opacity: 1
    }
}

.auth-timer {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted2);
    margin-top: 14px;
    font-weight: 600;
}

.auth-timer.warning {
    color: var(--accent-y)
}

.auth-timer.expired {
    color: var(--accent)
}

.auth-status {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 18px;
    display: none;
    border: 1px solid;
}

.auth-status.error {
    background: var(--status-red-bg);
    border-color: var(--status-red-border);
    color: var(--status-red-text);
    display: block;
}

.auth-status.success {
    background: var(--status-green-bg);
    border-color: var(--status-green-border);
    color: var(--status-green-text);
    display: block;
}

input[type=date] {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--r-sm);
    color: var(--text);
    font-family: var(--mono);
    font-size: 14px;
    padding: 10px 14px;
    outline: none;
    transition: border-color var(--trans), box-shadow var(--trans);
    cursor: pointer;
}

input[type=date]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 51, 95, .1);
}

input[type=date]::-webkit-calendar-picker-indicator {
    filter: invert(28%) sepia(89%) saturate(3000%) hue-rotate(330deg) brightness(95%);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: background var(--trans);
}

input[type=date]::-webkit-calendar-picker-indicator:hover {
    background: var(--status-red-bg);
}

input[type=file] {
    background: var(--surface);
    border: 1.5px dashed var(--border2);
    border-radius: var(--r-sm);
    color: var(--muted);
    font-family: var(--sans);
    font-size: 13px;
    padding: 6px 12px 6px 6px;
    outline: none;
    cursor: pointer;
    transition: border-color var(--trans), background var(--trans), box-shadow var(--trans);
    display: inline-flex;
    align-items: center;
    max-width: 100%;
}

input[type=file]:hover {
    border-color: var(--accent);
    background: var(--hover);
}

input[type=file]:focus,
input[type=file]:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 51, 95, 0.12);
}

input[type=file]::file-selector-button {
    background: rgba(255, 51, 95, 0.08);
    color: var(--accent);
    border: 1.5px solid rgba(255, 51, 95, 0.28);
    border-radius: 6px;
    padding: 6px 15px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    margin-right: 12px;
    transition: all var(--trans);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

input[type=file]:hover::file-selector-button {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 10px rgba(255, 51, 95, 0.32);
    transform: translateY(-1px);
}

input[type=file]:active::file-selector-button {
    transform: translateY(0);
}

input[type=file]::-webkit-file-upload-button {
    background: rgba(255, 51, 95, 0.08);
    color: var(--accent);
    border: 1.5px solid rgba(255, 51, 95, 0.28);
    border-radius: 6px;
    padding: 6px 15px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    margin-right: 12px;
    transition: all var(--trans);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

input[type=file]:hover::-webkit-file-upload-button {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 10px rgba(255, 51, 95, 0.32);
    transform: translateY(-1px);
}

input[type=file]:active::-webkit-file-upload-button {
    transform: translateY(0);
}

input[type=checkbox] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background-color: var(--input-bg);
    border: 1.5px solid var(--border2);
    outline: none;
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    margin: 0;
    position: relative;
    flex-shrink: 0;
    transform: none !important;
    transition: border-color var(--trans), background-color var(--trans);
}

input[type=checkbox]:hover {
    border-color: var(--accent);
    transform: none !important;
}

input[type=checkbox]:focus,
input[type=checkbox]:active,
input[type=checkbox]:focus-visible {
    outline: none;
    border-color: var(--accent);
    transform: none !important;
}

input[type=checkbox]:checked {
    background-color: var(--accent);
    border-color: var(--accent);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.5 8.5L6.5 11.5L12.5 4.5'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 11px 11px;
    box-shadow: none;
    transform: none !important;
}

input[type=checkbox]:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none !important;
}

.shell {
    display: flex;
    flex: 1;
    height: 100vh;
    overflow: hidden
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--sidebar);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border)
}

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative
}

.sidebar-scroll::-webkit-scrollbar {
    display: none
}

.sidebar-nav-glider {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: rgba(255, 51, 95, .1);
    border-left: 3px solid var(--accent);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
    transition: transform .18s cubic-bezier(0.25, 1, 0.5, 1), opacity .12s ease
}

.sidebar-nav-glider.no-trans {
    transition: none !important
}

.main {
    flex: 1;
    overflow-y: auto;
    padding: 32px 36px;
    background: var(--bg)
}

.sidebar-logo {
    padding: 24px 22px 18px;
    border-bottom: 1px solid var(--border)
}

.sidebar-logo .wordmark {
    font-family: var(--display);
    font-size: 12px;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: .04em
}

.sidebar-logo .sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
    font-family: var(--mono)
}

.sidebar-section {
    padding: 18px 22px 7px;
    font-size: 10px;
    font-weight: 700;
    color: var(--muted2);
    letter-spacing: .13em;
    text-transform: uppercase
}

.nav-item {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 20px;
    /* Одинаковая высота для всех пунктов меню (a и button):
       высота строки текста и иконки не должна влиять на размер пункта */
    min-height: 48px;
    line-height: 1.6;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: color .2s ease, background .2s ease, border-color .2s ease;
    cursor: pointer;
    background: none;
    border-top: none;
    border-right: none;
    border-bottom: none;
    width: 100%;
    text-align: left;
    font-family: var(--sans);
    white-space: nowrap
}

.nav-item:hover:not(.active) {
    color: var(--accent);
    background: rgba(255, 51, 95, .08);
    border-left-color: rgba(255, 51, 95, .3)
}

.sidebar:not(.has-glider) .nav-item.active {
    color: var(--accent);
    background: rgba(255, 51, 95, .1);
    border-left: 3px solid var(--accent);
    font-weight: 600
}

.sidebar.has-glider .nav-item.active {
    color: var(--accent);
    font-weight: 600;
    background: transparent !important;
    border-left-color: transparent !important
}

.nav-item .icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0
}

.nav-hide-btn {
    display: none !important;
}

.can-hide-tabs .nav-hide-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 0;
    margin-right: -11px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    color: var(--muted2);
    cursor: pointer;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    transform: none !important;
    user-select: none;
    transition: width .2s cubic-bezier(0.16, 1, 0.3, 1),
        margin-right .2s cubic-bezier(0.16, 1, 0.3, 1),
        opacity .15s ease,
        color .15s ease;
}

.can-hide-tabs .nav-item:hover .nav-hide-btn,
.can-hide-tabs .nav-item:focus-within .nav-hide-btn {
    width: 14px;
    margin-right: 2px;
    opacity: 0.6;
    pointer-events: auto;
}

.can-hide-tabs .nav-hide-btn:hover {
    opacity: 1 !important;
    color: #ef4444 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.can-hide-tabs .nav-hide-btn:active {
    opacity: 0.85 !important;
    color: #dc2626 !important;
    background: transparent !important;
    transform: none !important;
}

.nav-label {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-badge {
    margin-left: auto;
    background: var(--status-neutral-bg);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    font-family: var(--mono)
}

.nav-badge.green {
    background: var(--status-green-bg);
    color: var(--status-green-text)
}

.nav-badge.yellow {
    background: var(--status-yellow-bg);
    color: var(--status-yellow-text)
}

.nav-badge.red {
    background: var(--status-red-bg);
    color: var(--status-red-text)
}

.nav-badge.purple {
    background: var(--status-purple-bg);
    color: var(--status-purple-text)
}

.nav-badge.blue {
    background: var(--status-blue-bg);
    color: var(--status-blue-text)
}

.nav-badge.cyan {
    background: var(--status-cyan-bg);
    color: var(--status-cyan-text)
}

.sidebar-user {
    margin: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 12px 14px
}

.sidebar-user .uname {
    font-weight: 900;
    font-size: 14px;
    color: var(--text)
}

.sidebar-user .ufio {
    font-size: 11px;
    font-weight: 600;
    color: #4d6071db;
    line-height: 1.35;
    margin-top: 1px;
    word-break: break-word
}

.sidebar-user .urole {
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px
}

.role-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 5px
}

.role-dot.admin {
    background: var(--accent)
}

.role-dot.supervisor {
    background: var(--accent-y)
}

.role-dot.user {
    background: var(--accent-g)
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px 22px;
    border-top: 1px solid var(--border)
}

.sidebar-footer .time-str {
    font-size: 11px;
    color: var(--muted);
    font-family: var(--mono);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.sidebar-footer form button {
    width: 100%;
    background: var(--accent);
    border: 1px solid rgba(255, 51, 95, .25);
    color: white;
    padding: 9px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--trans)
}


.page-header {
    margin-bottom: 28px
}

.page-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    font-family: var(--display)
}

.page-header p {
    color: var(--muted);
    font-size: 14px;
    margin-top: 6px
}

/* Toast / Floating notification system */
.toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    width: 100%;
    max-width: 100%;
    padding: 0 16px;
    box-sizing: border-box;
}

.toast-item {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    max-width: min(92vw, 580px);
    min-width: 260px;
    padding: 12px 18px;
    border-radius: var(--r, 12px);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
    word-break: break-word;
    border: 1px solid transparent;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    background: var(--surface);
    color: var(--text);
    animation: toastSlideInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
    transition: transform 0.22s ease, opacity 0.22s ease, max-height 0.22s ease;
}

.toast-item.toast-ok,
.toast-item.toast-success {
    background: var(--status-green-bg);
    border-color: var(--status-green-border);
    color: var(--status-green-text);
}

.toast-item.toast-error,
.toast-item.toast-err {
    background: var(--status-red-bg);
    border-color: var(--status-red-border);
    color: var(--status-red-text);
}

.toast-item.toast-warning,
.toast-item.toast-warn {
    background: var(--status-yellow-bg);
    border-color: var(--status-yellow-border);
    color: var(--status-yellow-text);
}

.toast-item.toast-info {
    background: var(--status-blue-bg);
    border-color: var(--status-blue-border);
    color: var(--status-blue-text);
}

.toast-item .toast-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .toast-item .toast-icon {
    background: rgba(255, 255, 255, 0.1);
}

.toast-item .toast-message {
    flex: 1;
    min-width: 0;
}

.toast-item .toast-close {
    background: transparent;
    border: none;
    color: currentColor;
    opacity: 0.6;
    cursor: pointer;
    padding: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    line-height: 1;
    margin-left: 6px;
    flex-shrink: 0;
    transition: opacity var(--trans, .16s ease), background var(--trans, .16s ease);
}

.toast-item .toast-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .toast-item .toast-close:hover {
    background: rgba(255, 255, 255, 0.14);
}

.toast-item.toast-hiding {
    animation: toastSlideOutUp 0.22s cubic-bezier(0.4, 0, 1, 1) forwards !important;
}

@keyframes toastSlideInDown {
    0% {
        opacity: 0;
        transform: translate3d(0, -28px, 0) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes toastSlideOutUp {
    0% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate3d(0, -20px, 0) scale(0.96);
    }
}

.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: var(--r, 12px);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
    word-break: break-word;
    border: 1px solid transparent;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
    width: fit-content;
    max-width: min(92vw, 580px);
    margin: 0 auto 20px auto;
}

.toast-container .flash {
    pointer-events: auto;
    margin: 0;
    animation: toastSlideInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.flash.ok {
    background: var(--status-green-bg);
    border: 1px solid var(--status-green-border);
    color: var(--status-green-text);
}

.flash.error {
    background: var(--status-red-bg);
    border: 1px solid var(--status-red-border);
    color: var(--status-red-text);
}

.section-pinned-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--r);
    border: 1px solid transparent;
    margin-bottom: 22px;
    font-size: 14px;
    line-height: 1.55;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: all var(--trans);
}

.section-pinned-banner.green {
    background: var(--status-green-bg);
    border-color: var(--status-green-border);
    color: var(--status-green-text);
}

.section-pinned-banner.yellow {
    background: var(--status-yellow-bg);
    border-color: var(--status-yellow-border);
    color: var(--status-yellow-text);
}

.section-pinned-banner.red {
    background: var(--status-red-bg);
    border-color: var(--status-red-border);
    color: var(--status-red-text);
}

.pinned-banner-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-top: 1px;
}

.section-pinned-banner.green .pinned-banner-icon {
    background: rgba(22, 163, 74, 0.15);
    color: var(--accent-g);
}

.section-pinned-banner.yellow .pinned-banner-icon {
    background: rgba(217, 119, 6, 0.15);
    color: var(--accent-y);
}

.section-pinned-banner.red .pinned-banner-icon {
    background: rgba(255, 51, 95, 0.15);
    color: var(--accent);
}

.pinned-banner-content {
    flex: 1;
    min-width: 0;
}

.pinned-banner-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pinned-banner-text {
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}

.pinned-banner-text a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pinned-banner-text code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 12.5px;
}

[data-theme="dark"] .pinned-banner-text code {
    background: rgba(255, 255, 255, 0.1);
}

.pinned-banner-text ul,
.pinned-banner-text ol {
    margin: 6px 0 6px 20px;
}

.pinned-banner-text p {
    margin: 4px 0;
}

.pinned-banner-close {
    flex-shrink: 0;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1.5px solid currentColor;
    background: transparent;
    cursor: pointer;
    opacity: 0.85;
    padding: 0;
    line-height: 1;
    transition: all var(--trans);
    margin-left: auto;
}

.pinned-banner-close:hover {
    opacity: 1;
    transform: scale(1.05);
}

.section-pinned-banner.green .pinned-banner-close {
    color: var(--status-green-text);
    border-color: var(--status-green-text);
}

.section-pinned-banner.green .pinned-banner-close:hover {
    background: rgba(22, 163, 74, 0.18);
}

.section-pinned-banner.yellow .pinned-banner-close {
    color: var(--status-yellow-text);
    border-color: var(--status-yellow-text);
}

.section-pinned-banner.yellow .pinned-banner-close:hover {
    background: rgba(217, 119, 6, 0.18);
}

.section-pinned-banner.red .pinned-banner-close {
    color: var(--status-red-text);
    border-color: var(--status-red-text);
}

.section-pinned-banner.red .pinned-banner-close:hover {
    background: rgba(255, 51, 95, 0.18);
}

.notif-tag-btn {
    padding: 4px 9px;
    font-size: 12px;
    border: 1px solid var(--border2);
    border-radius: 5px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: all var(--trans);
}

.notif-tag-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.tg-insert-code {
    cursor: pointer;
    user-select: none;
    display: inline-block;
    font-family: var(--mono);
    font-size: 11.5px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary, #2563eb);
    padding: 1.5px 6.5px;
    border-radius: 4px;
    border: 1px solid rgba(37, 99, 235, 0.22);
    transition: all 0.15s ease;
}

.tg-insert-code:hover {
    background: var(--primary, #2563eb);
    color: #ffffff !important;
    border-color: var(--primary, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.tg-insert-code:active {
    transform: translateY(0);
}

.notif-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.notif-type-badge.green {
    background: var(--status-green-bg);
    border: 1px solid var(--status-green-border);
    color: var(--status-green-text);
}

.notif-type-badge.yellow {
    background: var(--status-yellow-bg);
    border: 1px solid var(--status-yellow-border);
    color: var(--status-yellow-text);
}

.notif-type-badge.red {
    background: var(--status-red-bg);
    border: 1px solid var(--status-red-border);
    color: var(--status-red-text);
}

.notif-section-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: var(--status-neutral-bg);
    border: 1px solid var(--status-neutral-border);
    color: var(--status-neutral-text);
}

.notif-scope-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.notif-scope-badge.all {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.28);
    color: #3b82f6;
}

.notif-scope-badge.personal {
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.28);
    color: #a855f7;
}

.notif-table-content {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
    max-height: 80px;
    overflow-y: auto;
    word-break: break-word;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.notif-table-content::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.notif-users-multiselect {
    position: relative;
    width: 100%;
}

.notif-ms-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    min-height: 40px;
    background: var(--bg);
    border: 1px solid var(--border2);
    border-radius: var(--r-sm);
    cursor: pointer;
    user-select: none;
    transition: border-color .15s, box-shadow .15s, opacity .15s;
    outline: none;
}

.notif-ms-trigger:hover {
    border-color: var(--accent);
}

.notif-ms-trigger:focus,
.notif-ms-trigger.open {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.notif-ms-trigger.disabled {
    opacity: 0.62;
    cursor: not-allowed;
    background: var(--hover, rgba(0, 0, 0, 0.03));
}

.notif-ms-trigger.disabled:hover {
    border-color: var(--border2);
}

.notif-ms-trigger-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13.5px;
    color: var(--text);
}

.notif-ms-trigger-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.notif-ms-badge {
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 12px;
    line-height: 1.4;
}

.notif-ms-arrow {
    font-size: 16px;
    color: var(--muted);
    transition: transform .2s ease, color var(--trans);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notif-ms-arrow svg {
    display: block;
    width: 11px;
    height: 7px;
    fill: currentColor;
    flex-shrink: 0;
}

.notif-ms-trigger:hover .notif-ms-arrow {
    color: var(--text);
}

.notif-ms-trigger.open .notif-ms-arrow {
    transform: rotate(180deg);
}

.notif-ms-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--card, var(--bg));
    border: 1px solid var(--border2);
    border-radius: var(--r-sm);
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.38), 0 6px 12px -4px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    max-height: 380px;
}

.notif-ms-header {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg);
    border-top-left-radius: var(--r-sm);
    border-top-right-radius: var(--r-sm);
}

.notif-ms-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.notif-ms-search-icon {
    position: absolute;
    left: 10px;
    font-size: 12px;
    color: var(--muted);
    pointer-events: none;
}

.notif-ms-search-input {
    width: 100%;
    padding: 6px 28px 6px 30px !important;
    font-size: 12.5px !important;
    height: 32px !important;
    border-radius: 6px !important;
    background: var(--bg2, var(--card)) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
}

.notif-ms-clear-search {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    line-height: 1;
}

.notif-ms-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.notif-ms-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
    max-height: 230px;
}

.notif-ms-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background .12s;
    user-select: none;
}

.notif-ms-item:hover {
    background: var(--hover, rgba(255, 255, 255, 0.04));
}

.notif-ms-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.notif-ms-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.notif-ms-username {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.notif-ms-uid {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    margin-left: auto;
}

.notif-ms-empty {
    padding: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.notif-ms-footer {
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    border-bottom-left-radius: var(--r-sm);
    border-bottom-right-radius: var(--r-sm);
}

/* ==========================================================
   Universal Custom Combobox (.app-combo)
   Matching the style of Notification Recipients component
   ========================================================== */
.app-combo {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    box-sizing: border-box;
    font-family: var(--sans);
    width: 100%;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.app-combo.open {
    z-index: 1060;
}

.app-combo--inline {
    width: auto;
}

.app-combo-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.app-combo-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    min-height: 40px;
    background: var(--bg);
    border: 1px solid var(--border2);
    border-radius: var(--r-sm);
    cursor: pointer;
    user-select: none;
    transition: border-color .15s, box-shadow .15s, opacity .15s, background .15s;
    outline: none;
    box-sizing: border-box;
    width: 100%;
}

.app-combo-trigger:hover {
    border-color: var(--accent);
}

.app-combo-trigger:focus,
.app-combo.open .app-combo-trigger {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.app-combo.disabled .app-combo-trigger,
.app-combo-trigger.disabled {
    opacity: 0.62;
    cursor: not-allowed;
    background: var(--hover, rgba(0, 0, 0, 0.03));
    pointer-events: none;
}

.app-combo-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13.5px;
    color: var(--text);
    text-align: left;
}

.app-combo-text.placeholder {
    color: var(--muted);
}

.app-combo-arrow {
    flex-shrink: 0;
    font-size: 16px;
    color: var(--muted);
    transition: transform .2s ease, color var(--trans);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-combo-arrow svg {
    display: block;
    width: 11px;
    height: 7px;
    fill: currentColor;
    flex-shrink: 0;
}

.app-combo-trigger:hover .app-combo-arrow {
    color: var(--text);
}

.app-combo.open .app-combo-arrow {
    transform: rotate(180deg);
}

.app-combo-dropdown {
    position: fixed !important;
    z-index: 999999 !important;
    background: var(--card, #ffffff);
    border: 1px solid var(--border2);
    border-radius: var(--r-sm);
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.42), 0 6px 16px -2px rgba(0, 0, 0, 0.25);
    display: none;
    flex-direction: column;
    max-height: 320px;
    overflow: hidden;
    box-sizing: border-box;
}

[data-theme="dark"] .app-combo-dropdown {
    background: #18181c !important;
    border-color: #3a3a42;
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.65), 0 6px 16px -2px rgba(0, 0, 0, 0.45);
}

[data-theme="light"] .app-combo-dropdown {
    background: #ffffff !important;
    border-color: #cbd5e1;
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.18), 0 6px 16px -2px rgba(0, 0, 0, 0.1);
}

.app-combo-dropdown.open {
    display: flex !important;
}

.app-combo.dropup .app-combo-dropdown,
.app-combo-dropdown.dropup {
    box-shadow: 0 -16px 36px -4px rgba(0, 0, 0, 0.42), 0 -6px 16px -2px rgba(0, 0, 0, 0.25);
}

.app-combo-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}

[data-theme="dark"] .app-combo-search-wrap {
    background: #111114;
}

[data-theme="light"] .app-combo-search-wrap {
    background: #f8fafc;
}

.app-combo-search {
    width: 100% !important;
    padding: 6px 28px 6px 10px !important;
    font-size: 12.5px !important;
    height: 32px !important;
    border-radius: 6px !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    outline: none !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
}

.app-combo-search:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15) !important;
}

.app-combo-clear {
    position: absolute;
    right: 18px;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    line-height: 1;
    display: none;
}

.app-combo-clear:hover {
    color: var(--text);
}

.app-combo-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
    max-height: 250px;
}

.app-combo-list::-webkit-scrollbar {
    width: 6px;
}

.app-combo-list::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 3px;
}

.app-combo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background .12s, color .12s;
    user-select: none;
    font-size: 13px;
    color: var(--text);
    text-align: left;
}

.app-combo-item:hover {
    background: var(--hover, rgba(255, 255, 255, 0.04));
}

.app-combo-item.selected {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent);
    font-weight: 600;
}

.app-combo-item.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.app-combo-item-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-combo-item-check {
    font-size: 11px;
    color: var(--accent);
    font-weight: 700;
    flex-shrink: 0;
    opacity: 0;
}

.app-combo-item.selected .app-combo-item-check {
    opacity: 1;
}

.app-combo-group-label {
    padding: 6px 14px 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .05em;
    text-transform: uppercase;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-top: 4px;
    margin-bottom: 2px;
}

.app-combo-group-label:first-child {
    border-top: none;
    margin-top: 0;
}

.app-combo-empty {
    padding: 20px;
    text-align: center;
    color: var(--muted);
    font-size: 12.5px;
    font-style: italic;
}

.app-combo--compact .app-combo-trigger {
    min-height: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: var(--r-sm);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
}

.app-combo--compact .app-combo-text {
    font-size: 13px;
    line-height: 1;
}

.app-combo--compact .app-combo-arrow {
    font-size: 14px;
}

.app-combo--compact .app-combo-arrow svg {
    width: 9.5px;
    height: 6px;
}

.app-combo--compact .app-combo-item {
    padding: 6px 12px;
    font-size: 12.5px;
}

/* Actions in tables (e.g. Users table) */
.actions {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
    white-space: nowrap;
}

.actions form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    flex-shrink: 0;
}

.actions select,
.actions .app-combo {
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
    flex-shrink: 0;
}

.actions .app-combo-trigger {
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
    min-height: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
    border-radius: var(--r-sm);
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
}

.actions .app-combo-text {
    font-size: 13px;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.actions .app-combo-arrow {
    font-size: 14px;
    flex-shrink: 0;
}

.actions .app-combo-arrow svg {
    width: 9.5px;
    height: 6px;
}

.actions .btn-sm {
    min-height: 32px;
    height: 32px;
    min-width: 32px;
    width: auto;
    padding: 0 12px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    white-space: nowrap;
}

.actions .btn-icon,
.actions .btn-sm.btn-icon {
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    padding: 0;
}

.app-combo--mini .app-combo-trigger {
    min-height: 24px;
    padding: 2px 6px;
    border-radius: 4px;
}

.app-combo--mini .app-combo-text {
    font-size: 11px;
    font-weight: 600;
}

.app-combo--mini .app-combo-arrow {
    font-size: 12px;
}

.app-combo--mini .app-combo-arrow svg {
    width: 8px;
    height: 5px;
}

.app-combo--mini .app-combo-item {
    padding: 4px 8px;
    font-size: 11px;
}

.app-combo.dir-custom-select {
    width: auto;
}

.app-combo.dir-custom-select .app-combo-trigger {
    border-radius: 20px;
    padding: 4px 12px;
    min-height: 28px;
    font-size: 12px;
    font-weight: 700;
}

.app-combo.dir-custom-select.is-desc .app-combo-trigger {
    background-color: var(--status-green-bg);
    color: var(--status-green-text);
    border-color: var(--status-green-border);
}

.app-combo.dir-custom-select.is-asc .app-combo-trigger {
    background-color: var(--status-blue-bg);
    color: var(--status-blue-text);
    border-color: var(--status-blue-border);
}

.stats-filter .app-combo {
    width: 100%;
}

.cr-filter-item .app-combo {
    min-width: 220px;
    width: 100%;
}

.app-combo[data-for="cr-send-ds-sel"],
.app-combo[data-for="hist-ds-sel"] {
    min-width: 280px;
    width: 300px;
    max-width: 100%;
}

.app-combo[data-for="cr-send-yw-sel"],
.app-combo[data-for="cr-send-all-yw-sel"],
.app-combo[data-for="hist-week-sel"] {
    min-width: 380px;
    width: 420px;
    max-width: 100%;
}

.app-combo[data-for="hist-sector-sel"] {
    min-width: 240px;
    width: 260px;
    max-width: 100%;
}

.app-combo[data-for="hist-type-sel"] {
    min-width: 220px;
    width: 240px;
    max-width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 28px
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm)
}

.stat-card .val {
    font-family: var(--display);
    font-size: clamp(40px, 4.5vw, 110px);
    font-weight: 800;
    line-height: .9;
    letter-spacing: -2px;
    color: var(--accent-b);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.stat-card .val.val-md {
    font-size: clamp(30px, 3.8vw, 90px);
    letter-spacing: -2px;
}

.stat-card .val.val-sm {
    font-size: clamp(22px, 2.6vw, 54px);
    letter-spacing: -1px;
}

.stat-card.red .val {
    color: var(--accent)
}

.stat-card.green .val {
    color: var(--accent-g)
}

.stat-card.yellow .val {
    color: var(--accent-y)
}

.stat-card.orange .val {
    color: var(--accent-o)
}

.stat-card.purple .val {
    color: var(--accent-p)
}

.stat-card .lbl {
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .05em
}

.stat-card .sub {
    font-size: 11px;
    color: var(--muted2);
    margin-top: 3px;
    font-family: var(--mono)
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    overflow: hidden
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    gap: 14px;
    background: var(--bg)
}

.card-title {
    font-size: 14px;
    font-weight: 650;
    color: var(--text)
}

.card-body {
    padding: 20px 22px
}

.table-responsive,
.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--border2) transparent;
}

.table-responsive::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track {
    background: var(--bg);
}

.table-responsive::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

.card:has(> table),
.card-body:has(> table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px
}

th {
    text-align: left;
    padding: 11px 16px;
    background: var(--bg);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border)
}

td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle
}

tr:last-child td {
    border-bottom: none
}

tr:hover td {
    background: var(--hover)
}

.mono {
    font-family: var(--mono);
    font-size: 13px
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 11px;
    height: 28px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-sizing: border-box
}

.badge-blue {
    background: var(--status-blue-bg);
    color: var(--status-blue-text);
    border-color: var(--status-blue-border)
}

.badge-green {
    background: var(--status-green-bg);
    color: var(--status-green-text);
    border-color: var(--status-green-border)
}

.badge-yellow {
    background: var(--status-yellow-bg);
    color: var(--status-yellow-text);
    border-color: var(--status-yellow-border)
}

.badge-red {
    background: var(--status-red-bg);
    color: var(--status-red-text);
    border-color: var(--status-red-border)
}

.badge-purple {
    background: var(--status-purple-bg);
    color: var(--status-purple-text);
    border-color: var(--status-purple-border)
}

.badge-gray {
    background: var(--hover);
    color: var(--muted);
    border-color: var(--border2)
}

.badge-orange {
    background: var(--status-orange-bg);
    color: var(--status-orange-text);
    border-color: var(--status-orange-border)
}

.badge-cyan {
    background: var(--status-cyan-bg);
    color: var(--status-cyan-text);
    border-color: var(--status-cyan-border)
}

.badge-method-tg {
    background: rgba(36, 161, 222, 0.12);
    color: #24a1de;
    border: 1px solid rgba(36, 161, 222, 0.25);
}

.badge-method-max {
    background: rgba(255, 102, 0, 0.12);
    color: #ff6600;
    border: 1px solid rgba(255, 102, 0, 0.25);
}

[data-theme="dark"] .badge-method-tg {
    background: rgba(36, 161, 222, 0.15);
    color: #4dc0f5;
    border-color: rgba(36, 161, 222, 0.35);
}

[data-theme="dark"] .badge-method-max {
    background: rgba(255, 102, 0, 0.15);
    color: #ff8533;
    border-color: rgba(255, 102, 0, 0.35);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    align-items: end
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px
}

label {
    font-size: 11px;
    font-weight: 650;
    color: var(--muted);
    letter-spacing: .05em;
    text-transform: uppercase
}

input[type=text],
input[type=password],
input[type=number],
select,
textarea {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--r-sm);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    padding: 10px 14px;
    outline: none;
    transition: border-color var(--trans), box-shadow var(--trans);
    width: 100%
}

/* Hide number input spinners (stepper arrows) */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 51, 95, .1)
}

select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 2L6 6.5L10.5 2' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 11px 7px !important;
    padding-right: 36px !important;
    cursor: pointer
}

[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 2L6 6.5L10.5 2' stroke='%2394a3b8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important
}

textarea {
    resize: vertical;
    min-height: 100px;
    font-family: var(--mono);
    font-size: 13px
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: 13px;
    transition: all var(--trans);
    font-weight: 500;
    color: var(--text)
}

.checkbox-label:hover {
    border-color: var(--accent);
    background: var(--status-red-bg)
}

.checkbox-label:has(input[type=checkbox]:checked) {
    border-color: rgba(255, 51, 95, .4);
    background: rgba(255, 51, 95, .06)
}

.checkbox-label input[type=checkbox] {
    width: 16px;
    height: 16px;
    margin: 0
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: var(--r-sm);
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid;
    transition: all var(--trans);
    text-decoration: none;
    white-space: nowrap;
    text-align: center;
    justify-content: center
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 51, 95, .25)
}

.btn-primary:hover {
    background: var(--accent-h);
    border-color: var(--accent-h)
}

.btn-green {
    background: var(--status-green-bg);
    border-color: var(--status-green-border);
    color: var(--status-green-text)
}

.btn-green:hover {
    background: var(--status-green-bg)
}

.btn-red {
    background: var(--status-red-bg);
    border-color: var(--status-red-border);
    color: var(--status-red-text)
}

.btn-red:hover {
    background: var(--status-red-border)
}

.btn-ghost {
    background: var(--surface);
    border-color: var(--border2);
    color: var(--muted)
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent)
}

.btn-yellow {
    background: var(--status-yellow-bg);
    border-color: var(--status-yellow-border);
    color: var(--status-yellow-text)
}

.btn-yellow:hover {
    background: var(--status-yellow-bg)
}

.btn-purple {
    background: var(--status-purple-bg);
    border-color: var(--status-purple-border);
    color: var(--status-purple-text)
}

.btn-purple:hover {
    background: var(--status-purple-bg)
}

.btn-sm {
    padding: 7px 13px;
    font-size: 13px
}

.btn-icon {
    padding: 7px 10px
}

.upload-area {
    border: 2px dashed var(--border2);
    border-radius: var(--r);
    padding: 36px;
    text-align: center;
    cursor: pointer;
    transition: all var(--trans);
    background: var(--bg)
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--accent);
    background: var(--status-red-bg)
}

.upload-area .up-icon {
    font-size: 40px;
    margin-bottom: 12px;
    display: block
}

.upload-area .up-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text)
}

.upload-area .up-sub {
    font-size: 13px;
    color: var(--muted);
    margin-top: 5px
}

#xlsx-input {
    display: none
}

#cancel-xlsx-input {
    display: none
}

.expandable {
    display: none
}

.expandable.show {
    display: block
}

.toggle-btn {
    background: none;
    border: 1.5px solid;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--sans);
    transition: all var(--trans);
    min-height: 31px
}

.toggle-btn.on {
    border-color: var(--status-green-border);
    color: var(--status-green-text);
    background: var(--status-green-bg)
}

.toggle-btn.on:hover {
    background: var(--status-green-bg)
}

.toggle-btn.off {
    border-color: var(--status-red-border);
    color: var(--status-red-text);
    background: var(--status-red-bg)
}

.toggle-btn.off:hover {
    background: var(--status-red-border)
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block
}

.dot-green {
    background: var(--accent-g);
    box-shadow: 0 0 5px rgba(22, 163, 74, .4)
}

.dot-gray {
    background: var(--muted2)
}

.sched {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    background: var(--status-neutral-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 9px
}

.chat-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    margin: 2px
}

.msg-preview {
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 14px 16px;
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--muted);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 180px;
    overflow-y: auto;
    line-height: 1.7
}

.tg-screenshot-wrap {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 36px -6px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    position: relative;
    transition: all 0.2s ease;
    user-select: text;
}

[data-theme="dark"] .tg-screenshot-wrap {
    box-shadow: 0 14px 38px -6px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.tg-screenshot-wrap,
.tg-screenshot-wrap[data-tg-theme="dark"] {
    --tg-topbar-bg: #212d3b;
    --tg-topbar-border: rgba(255, 255, 255, 0.05);
    --tg-topbar-text: #ffffff;
    --tg-topbar-sub: #708499;
    --tg-topbar-btn: #8696a6;
    --tg-body-bg: #0e1621;
    --tg-body-pattern: url("tg_pattern_dark.svg");
    --tg-bubble-bg: #182533;
    --tg-bubble-text: #f5f5f5;
    --tg-bubble-sender: #e06e75;
    --tg-bubble-time: #6c7e90;
    --tg-bottom-bg: #17212b;
    --tg-bottom-border: rgba(255, 255, 255, 0.06);
    --tg-bottom-input: rgba(255, 255, 255, 0.07);
    --tg-bottom-icon: #708499;
    --tg-bottom-placeholder: #68798a;
    --tg-code-bg: rgba(255, 255, 255, 0.12);
    --tg-code-text: #ff8597;
    --tg-link-color: #64b5f6;
    --tg-spoiler-bg: rgba(255, 255, 255, 0.24);
}

.tg-screenshot-wrap[data-tg-theme="light"],
[data-theme="light"] .tg-screenshot-wrap:not([data-tg-theme="dark"]),
:root:not([data-theme="dark"]) .tg-screenshot-wrap:not([data-tg-theme="dark"]) {
    --tg-topbar-bg: #ffffff;
    --tg-topbar-border: rgba(0, 0, 0, 0.08);
    --tg-topbar-text: #222222;
    --tg-topbar-sub: #707579;
    --tg-topbar-btn: #707579;
    --tg-body-bg: #8ea5b8;
    --tg-body-pattern: url("tg_pattern_light.svg");
    --tg-bubble-bg: #ffffff;
    --tg-bubble-text: #000000;
    --tg-bubble-sender: #d04646;
    --tg-bubble-time: #707579;
    --tg-bottom-bg: #ffffff;
    --tg-bottom-border: rgba(0, 0, 0, 0.08);
    --tg-bottom-input: #f4f4f5;
    --tg-bottom-icon: #707579;
    --tg-bottom-placeholder: #999999;
    --tg-code-bg: rgba(0, 0, 0, 0.07);
    --tg-code-text: #d63384;
    --tg-link-color: #2481cc;
    --tg-spoiler-bg: rgba(0, 0, 0, 0.28);
}

.tg-topbar {
    background: var(--tg-topbar-bg);
    border-bottom: 1px solid var(--tg-topbar-border);
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    transition: background 0.2s, border-color 0.2s;
}

.tg-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.tg-topbar-back {
    background: none;
    border: none;
    color: var(--tg-topbar-btn);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    cursor: pointer;
}

.tg-topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    background: transparent;
}

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

.tg-topbar-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tg-topbar-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--tg-topbar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.tg-topbar-subtitle {
    font-size: 11.5px;
    color: var(--tg-topbar-sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    margin-top: 1px;
}

.tg-topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tg-theme-toggle-btn {
    background: rgba(127, 127, 127, 0.15);
    border: none;
    color: var(--tg-topbar-btn);
    border-radius: 14px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
    font-family: inherit;
}

.tg-theme-toggle-btn:hover {
    background: rgba(127, 127, 127, 0.28);
    color: var(--tg-topbar-text);
}

.tg-topbar-btn-icon {
    background: none;
    border: none;
    color: var(--tg-topbar-btn);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    cursor: pointer;
}

.tg-body {
    background-color: var(--tg-body-bg);
    background-image: var(--tg-body-pattern);
    background-repeat: repeat;
    background-size: 420px auto;
    background-position: top center;
    position: relative;
    min-height: 180px;
    padding: 16px 14px 18px 14px;
    transition: background-color 0.2s;
}

.tg-date-badge {
    display: block;
    width: fit-content;
    margin: 0 auto 14px;
    background: rgba(0, 0, 0, 0.28);
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 500;
    padding: 2.5px 11px;
    border-radius: 12px;
    letter-spacing: 0.1px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    user-select: none;
}

.tg-bubble-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 92%;
    position: relative;
    margin-bottom: 2px;
}

.tg-bubble-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    background: transparent;
}

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

.tg-bubble {
    position: relative;
    background: var(--tg-bubble-bg);
    color: var(--tg-bubble-text);
    border-radius: 12px 12px 12px 0;
    box-shadow: 0 1px 2px rgba(16, 35, 47, 0.2);
    padding: 0;
    font-size: 14.5px;
    line-height: 1.36;
    word-break: break-word;
    min-width: 200px;
    max-width: 440px;
    width: fit-content;
    transition: background 0.2s, color 0.2s;
}

.tg-bubble-tail {
    position: absolute;
    bottom: 0;
    left: -8.5px;
    width: 9px;
    height: 17px;
    color: var(--tg-bubble-bg);
    pointer-events: none;
    z-index: 1;
    transition: color 0.2s;
}

.tg-bubble-sender {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--tg-bubble-sender);
    padding: 7px 12px 2px 12px;
    margin: 0;
    line-height: 1.25;
}

.tg-bubble-sender+.tg-bubble-img-box,
.tg-bubble-sender~.tg-bubble-img-box {
    margin-top: 5px;
}

.tg-bubble-img-box {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 0;
    display: block;
}

.tg-bubble-img {
    width: 100% !important;
    height: auto;
    max-height: 520px;
    object-fit: cover;
    border-radius: 0;
    display: block;
}

.tg-bubble-content-wrap {
    padding: 0 12px 8px 12px;
    line-height: 1.35;
}

.tg-bubble-img-box+.tg-bubble-content-wrap,
.tg-bubble-img-box:not([style*="none"])+.tg-bubble-content-wrap {
    padding-top: 6px;
}

.tg-bubble-content-wrap::after {
    content: "";
    display: table;
    clear: both;
}

.tg-bubble-text {
    font-size: 14.5px;
    line-height: 1.36;
    color: var(--tg-bubble-text);
}

.tg-bubble-text b,
.tg-bubble-text strong {
    font-weight: 600;
}

.tg-bubble-text i,
.tg-bubble-text em {
    font-style: italic;
}

.tg-bubble-text u {
    text-decoration: underline;
}

.tg-bubble-text s,
.tg-bubble-text strike,
.tg-bubble-text del {
    text-decoration: line-through;
}

.tg-bubble-text a {
    color: var(--tg-link-color);
    text-decoration: none;
}

.tg-bubble-text a:hover {
    text-decoration: underline;
}

.tg-bubble-text code {
    font-family: var(--mono);
    font-size: 12.5px;
    background: var(--tg-code-bg);
    color: var(--tg-code-text);
    padding: 1.5px 5px;
    border-radius: 4px;
}

.tg-bubble-text pre {
    font-family: var(--mono);
    font-size: 12px;
    background: var(--tg-code-bg);
    padding: 8px 10px;
    border-radius: 6px;
    margin: 6px 0;
    overflow-x: auto;
    white-space: pre-wrap;
}

.tg-spoiler {
    display: inline;
    background: var(--tg-spoiler-bg);
    color: transparent !important;
    border-radius: 4px;
    padding: 0 4px;
    cursor: pointer;
    user-select: none;
    filter: blur(4.5px);
    transition: filter 0.2s ease, background 0.2s ease;
    position: relative;
}

.tg-spoiler.revealed {
    background: rgba(127, 127, 127, 0.12);
    color: inherit !important;
    filter: none;
    user-select: text;
}

.tg-bubble-time {
    float: right;
    margin-left: 10px;
    margin-top: 10px;
    font-size: 11.5px;
    color: var(--tg-bubble-time);
    user-select: none;
    line-height: 1;
}

.tg-bottombar {
    background: var(--tg-bottom-bg);
    border-top: 1px solid var(--tg-bottom-border);
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 10px;
    transition: background 0.2s, border-color 0.2s;
}

.tg-bottom-btn {
    background: none;
    border: none;
    color: var(--tg-bottom-icon);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.tg-bottom-btn:hover {
    color: var(--tg-link-color);
    background: rgba(127, 127, 127, 0.16);
    transform: scale(1.08);
}

.tg-bottom-btn:active {
    transform: scale(0.95);
}

.tg-bottom-input-pill {
    flex: 1;
    height: 34px;
    background: var(--tg-bottom-input);
    border-radius: 17px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--tg-bottom-placeholder);
    font-size: 13.5px;
    user-select: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.tg-bottom-input-pill:hover {
    background: rgba(127, 127, 127, 0.14);
}

.report-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--trans)
}

.report-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08)
}

.report-card.hidden {
    display: none
}

.report-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    gap: 12px
}

.report-card-body {
    padding: 16px 20px
}

.report-text {
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 14px 16px;
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--text);
    white-space: pre-wrap;
    line-height: 1.75
}

.highlight {
    background: var(--status-yellow-bg);
    color: var(--status-yellow-text);
    border-radius: 3px;
    padding: 0 2px
}

.ds-chat-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    transition: background 0.15s ease;
}

.ds-chat-row:hover {
    background: var(--hover);
}

.ds-chat-row:last-child {
    border-bottom: none;
}

.ds-chat-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.ds-chat-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ds-chat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
    line-height: 1;
}

.ds-chat-title {
    font-size: 14.5px;
    font-weight: 650;
    color: var(--text);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 520px;
    display: inline-flex;
    align-items: center;
}

.ds-chat-cat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9999px;
    line-height: 1;
    letter-spacing: 0.01em;
    flex-shrink: 0;
    box-sizing: border-box;
    vertical-align: middle;
}

.ds-chat-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    line-height: 1.3;
    flex-wrap: wrap;
    margin-top: 2px;
}

.ds-chat-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 9999px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 11px;
    color: var(--muted);
    line-height: 1.25;
    box-sizing: border-box;
}

.ds-chat-meta-pill code {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text);
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 9999px;
    font-weight: 500;
}

.ds-chat-meta code {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    background: var(--bg);
    padding: 2px 9px;
    border-radius: 9999px;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.ds-chat-meta-sep {
    color: var(--muted);
    opacity: 0.4;
    font-size: 10px;
}

.actions {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
}

.mode-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border: 1.5px solid var(--border2);
    border-radius: var(--r-sm);
    overflow: hidden;
    width: fit-content
}

.mode-tab {
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--muted);
    border: none;
    background: transparent;
    transition: all var(--trans);
    font-family: var(--sans)
}

.mode-tab.active {
    background: var(--accent);
    color: #fff
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 22px;
    border-bottom: 1px solid var(--border);
    font-size: 14px
}

.recent-item:last-child {
    border-bottom: none
}

.recent-item .icon {
    font-size: 20px;
    flex-shrink: 0
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    gap: 12px
}

.info-row:last-child {
    border-bottom: none
}

.info-row .k {
    color: var(--muted)
}

.info-row .v {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text)
}

.info-license-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    border-radius: 20%;
    background: rgba(194, 193, 193, 0.1);
    color: var(--muted);
    border: 1px solid rgba(138, 138, 138, 0.0);
    font-size: 13px;
    font-weight: 500;
    font-style: normal;
    font-family: 'Anthropic Serif Display', Georgia, serif;
    cursor: pointer;
    line-height: 1;
    margin-left: 8px;
    vertical-align: middle;
    transition: all 0.18s cubic-bezier(.4, 0, .2, 1);
    text-decoration: none;
    user-select: none;
    padding: 0;
    outline: none;
    box-sizing: border-box;
}

.info-license-badge:hover {
    color: var(--accent);
}

.info-license-badge:active {
    transform: scale(0.96);
}

.chat-toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    transition: background 0.15s ease;
}

.chat-toggle-row:last-child {
    border-bottom: none;
}

.chat-toggle-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.14);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.chat-toggle-label {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chat-toggle-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
    line-height: 1;
}

.chat-toggle-title {
    font-size: 14px;
    font-weight: 650;
    color: var(--text);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 420px;
    display: inline-flex;
    align-items: center;
}

.chat-toggle-cat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    padding: 0 9px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9999px;
    line-height: 1;
    flex-shrink: 0;
    box-sizing: border-box;
    vertical-align: middle;
}

.chat-toggle-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--muted);
    line-height: 1.3;
    flex-wrap: wrap;
    margin-top: 2px;
}

.chat-toggle-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 9999px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 10.5px;
    color: var(--muted);
    line-height: 1.25;
    box-sizing: border-box;
}

.chat-toggle-meta-pill code {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--text);
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 9999px;
    font-weight: 500;
}

.chat-toggle-meta code {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 9999px;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.note-box {
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 12px;
    border: 1px solid;
    margin-top: 10px;
    line-height: 1.6
}

.note-box.yellow {
    background: var(--status-yellow-bg);
    border-color: var(--status-yellow-border);
    color: var(--status-yellow-text)
}

.note-box.blue {
    background: var(--status-blue-bg);
    border-color: var(--status-blue-border);
    color: var(--status-blue-text)
}

.note-box.purple {
    background: var(--status-purple-bg);
    border-color: var(--status-purple-border);
    color: var(--status-purple-text)
}

.section-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .1em;
    text-transform: uppercase;
    margin: 24px 0 12px
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 20px
}

.role-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column
}

.role-card-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 18px 14px
}

.role-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--display);
    font-weight: 800;
    font-size: 15px;
    flex-shrink: 0
}

.role-card-heading {
    flex: 1;
    min-width: 0
}

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

.role-card-meta {
    font-size: 11px;
    color: var(--muted);
    font-family: var(--mono);
    margin-top: 5px
}

.role-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0
}

.role-perms-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 18px 18px
}

.perm-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 20px;
    border: 1px solid;
    white-space: nowrap;
    font-family: var(--sans);
    cursor: default;
    background: transparent;
    line-height: 1.2;
    outline: none;
    user-select: none;
    transition: background var(--trans), border-color var(--trans), color var(--trans), transform 0.1s ease;
}

.role-card.is-editing .perm-chip:not(:disabled),
.role-card:has(.role-edit-form.show) .perm-chip:not(:disabled) {
    cursor: pointer;
}

.role-card.is-editing .perm-chip:not(:disabled):hover,
.role-card:has(.role-edit-form.show) .perm-chip:not(:disabled):hover {
    transform: translateY(-1px);
}

.role-card.is-editing .perm-chip:not(:disabled):active,
.role-card:has(.role-edit-form.show) .perm-chip:not(:disabled):active {
    transform: translateY(0) scale(0.97);
}

.perm-chip-on {
    background: var(--status-green-bg);
    color: var(--status-green-text);
    border-color: var(--status-green-border);
}

.role-card.is-editing .perm-chip-on:not(:disabled):hover,
.role-card:has(.role-edit-form.show) .perm-chip-on:not(:disabled):hover {
    filter: brightness(0.96);
}

.perm-chip-off {
    background: var(--hover);
    color: var(--muted2);
    border-color: var(--border);
}

.role-card.is-editing .perm-chip-off:not(:disabled):hover,
.role-card:has(.role-edit-form.show) .perm-chip-off:not(:disabled):hover {
    background: var(--border);
    color: var(--text);
}

.perm-chip:disabled,
.perm-chip-disabled {
    cursor: default;
    opacity: 0.85;
    pointer-events: none;
}

.role-card.is-editing .role-edit-btn,
.role-card:has(.role-edit-form.show) .role-edit-btn {
    background: var(--hover);
    color: var(--accent);
}

.perm-chip-icon {
    font-weight: 700;
    font-size: 11px;
    line-height: 1;
}

.role-edit-form {
    border-top: 1px solid var(--border);
}

.btn-aggr-choice {
    padding: 5px 13px;
    font-size: 12.5px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all var(--trans);
    outline: none;
    font-family: var(--sans);
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-aggr-choice:hover {
    color: var(--text);
    background: var(--hover);
}

.btn-aggr-choice.btn-aggr-sum.is-active {
    background: var(--status-purple-bg);
    color: var(--status-purple-text);
    font-weight: 700;
    box-shadow: inset 0 0 0 1px var(--status-purple-border);
}

.btn-aggr-choice.btn-aggr-avg.is-active {
    background: var(--status-blue-bg);
    color: var(--status-blue-text);
    font-weight: 700;
    box-shadow: inset 0 0 0 1px var(--status-blue-border);
}

.metric-aggr-table tr.aggr-row:hover {
    background: var(--hover);
}

.search-wrap {
    position: relative;
    margin-bottom: 20px
}

.search-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--r);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    padding: 12px 16px;
    outline: none;
    transition: border-color var(--trans), box-shadow var(--trans);
    box-shadow: var(--shadow-sm)
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 51, 95, .1)
}

.search-count {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--muted2);
    font-family: var(--mono);
    pointer-events: none
}

.no-results {
    text-align: center;
    padding: 48px;
    color: var(--muted);
    font-size: 14px
}

.no-results .icon {
    font-size: 36px;
    display: block;
    margin-bottom: 12px;
    opacity: .4
}

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
    gap: 10px
}

.empty .icon {
    font-size: 36px;
    opacity: .4
}

.builder-wrap {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start
}

.pills-panel {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 16px 18px;
    height: 100%;
}

.pills-panel-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 12px
}

.pills-search {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--r-sm);
    color: var(--text);
    font-family: var(--sans);
    font-size: 13px;
    padding: 8px 12px;
    outline: none;
    margin-bottom: 12px;
    transition: border-color var(--trans)
}

.pills-search:focus {
    border-color: var(--accent)
}

.pills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    max-height: 855px;
    overflow-y: auto
}

.col-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1.5px solid var(--accent-b);
    background: var(--status-blue-bg);
    color: var(--status-blue-text);
    font-size: 12px;
    font-weight: 600;
    cursor: grab;
    user-select: none;
    transition: all var(--trans);
    white-space: nowrap
}

.col-pill:hover {
    background: var(--status-blue-bg);
    border-color: var(--accent-b);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(37, 99, 235, .2)
}

.col-pill.dragging {
    opacity: .45;
    cursor: grabbing
}

.col-pill .pill-icon {
    font-size: 11px
}

.col-pill.pill-sys {
    border-color: var(--accent-p);
    background: var(--status-purple-bg);
    color: var(--status-purple-text)
}

.col-pill.pill-sys:hover {
    background: var(--status-purple-bg);
    border-color: var(--accent-p);
    box-shadow: 0 3px 8px rgba(124, 58, 237, .2)
}

.col-pill.pill-prev {
    border-color: rgba(99, 102, 241, .4);
    background: rgba(99, 102, 241, .1);
    color: #818cf8
}

.col-pill.pill-prev:hover {
    background: rgba(99, 102, 241, .18);
    border-color: rgba(99, 102, 241, .6);
    box-shadow: 0 3px 8px rgba(99, 102, 241, .22)
}

.col-pill.pill-delta {
    border-color: rgba(16, 185, 129, .4);
    background: rgba(16, 185, 129, .1);
    color: #34d399
}

.col-pill.pill-delta:hover {
    background: rgba(16, 185, 129, .18);
    border-color: rgba(16, 185, 129, .6);
    box-shadow: 0 3px 8px rgba(16, 185, 129, .22)
}

.builder-editor-wrap {
    position: relative
}

.builder-textarea {
    width: 100%;
    min-height: 600px;
    background: var(--input-bg);
    border: 2px solid var(--border2);
    border-radius: var(--r);
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
    padding: 16px 18px;
    outline: none;
    resize: vertical;
    line-height: 1.75;
    transition: border-color var(--trans), box-shadow var(--trans)
}

.builder-textarea:focus {
    border-color: var(--accent-b);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15)
}

.builder-textarea.drop-target {
    border-color: var(--accent-g);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .18);
    background: var(--status-green-bg)
}

.builder-preview {
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 14px 16px;
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--text);
    white-space: pre-wrap;
    line-height: 1.75;
    min-height: 80px;
    overflow-y: auto;
    word-break: break-word
}

.builder-preview .ph {
    display: inline-block;
    background: var(--status-blue-bg);
    color: var(--status-blue-text);
    border-radius: 4px;
    padding: 0 4px;
    font-weight: 700;
    font-size: 12px
}

.char-counter {
    position: absolute;
    right: 12px;
    bottom: 10px;
    font-size: 11px;
    color: var(--muted2);
    font-family: var(--mono);
    pointer-events: none
}

select.preview-select {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--r-sm);
    color: var(--text);
    font-family: var(--sans);
    font-size: 13px;
    padding: 8px 12px;
    outline: none;
    margin-bottom: 12px
}

.app-combo.preview-select {
    width: 100%;
    margin-bottom: 12px;
}

.insert-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: var(--text);
    color: var(--bg);
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--sans);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .2s, transform .2s
}

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

.access-banner {
    background: var(--status-yellow-bg);
    border: 1px solid var(--status-yellow-border);
    border-radius: var(--r);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--status-yellow-text);
    display: flex;
    align-items: center;
    gap: 10px
}

::-webkit-scrollbar {
    width: 7px;
    height: 7px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 4px
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted2)
}

.text-muted {
    color: var(--muted)
}

.text-mono {
    font-family: var(--mono);
    font-size: 13px
}

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

.mb-16 {
    margin-bottom: 16px
}

.mt-16 {
    margin-top: 16px
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0
}

.mobile-header {
    display: none;
}

.mobile-sidebar-close-btn {
    display: none;
}

.sidebar-overlay {
    display: none;
}

@media(max-width:800px) {
    .shell {
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        flex-shrink: 0;
        width: 100%;
        padding: 12px 18px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        z-index: 100;
        box-shadow: var(--shadow-sm);
    }

    .mobile-header-left {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
        flex: 1;
    }

    .mobile-burger-btn {
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--card);
        border: 1px solid var(--border2);
        border-radius: var(--r-sm);
        color: var(--text);
        cursor: pointer;
        flex-shrink: 0;
        padding: 0;
        transition: background var(--trans), border-color var(--trans), transform var(--trans);
    }

    .mobile-burger-btn:active {
        transform: scale(0.95);
    }

    .mobile-header-title {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
    }

    .mobile-brand-word {
        font-family: var(--display);
        font-size: 13px;
        font-weight: 900;
        letter-spacing: 0.04em;
        color: var(--accent);
        flex-shrink: 0;
    }

    .mobile-header-sep {
        color: var(--muted2);
        font-weight: 300;
        font-size: 13px;
        flex-shrink: 0;
    }

    .mobile-tab-name {
        font-size: 13px;
        font-weight: 700;
        color: var(--text);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-header-right {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    .mobile-theme-btn {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--card);
        border: 1px solid var(--border2);
        border-radius: var(--r-sm);
        color: var(--text);
        cursor: pointer;
        padding: 0;
        font-size: 16px;
        transition: background var(--trans), border-color var(--trans);
    }


    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        z-index: 1002;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    body.mobile-nav-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    body.mobile-nav-open {
        overflow: hidden;
    }

    .sidebar {
        display: flex !important;
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0;
        width: 290px;
        max-width: 86vw;
        height: 100vh;
        height: 100dvh;
        z-index: 1005;
        background: var(--sidebar);
        border-right: 1px solid var(--border);
        box-shadow: none;
        transform: translate3d(-100%, 0, 0);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease;
        will-change: transform;
    }

    body.mobile-nav-open .sidebar {
        transform: translate3d(0, 0, 0);
        box-shadow: 16px 0 40px rgba(0, 0, 0, 0.45);
    }

    .mobile-sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: var(--r-sm);
        background: var(--surface);
        border: 1px solid var(--border2);
        color: var(--muted);
        cursor: pointer;
        padding: 0;
        transition: color var(--trans), border-color var(--trans), background var(--trans);
    }

    .mobile-sidebar-close-btn:hover {
        color: var(--text);
        border-color: var(--border);
    }

    .main {
        padding: 18px
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .form-grid {
        grid-template-columns: 1fr
    }

    .builder-wrap {
        grid-template-columns: 1fr
    }

    .card-header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .card-header>div:first-child {
        min-width: 0;
        max-width: 100%;
    }

    .card-header .actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Mobile tables adaptation */
    .table-responsive,
    .table-wrap {
        overscroll-behavior-x: contain;
        touch-action: pan-x pan-y;
    }

    table:not(.stats-table),
    .stats-table.global-top-table {
        min-width: 520px;
    }

    th {
        padding: 9px 12px;
        font-size: 10px;
        white-space: nowrap;
    }

    td {
        padding: 10px 12px;
        font-size: 13px;
    }

    td .actions,
    td>div[style*="display:flex"],
    td>div[style*="display: flex"] {
        flex-wrap: nowrap !important;
        white-space: nowrap;
    }

    .badge {
        white-space: nowrap;
    }

    #directorBoundTable,
    #schedulesMainTable,
    .cr-rating-table-h,
    #maint-users-table {
        min-width: 680px;
    }

    .cr-metrics-tbl {
        min-width: 640px;
    }

    /* Role card top adaptation (e.g. chat_categories, roles) */
    .role-card-top {
        flex-wrap: wrap !important;
        gap: 12px !important;
        padding: 14px !important;
    }

    .role-card-heading {
        min-width: 0;
        flex: 1 1 calc(100% - 80px);
    }

    .role-card-title .badge {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .role-card-actions {
        width: 100%;
        justify-content: flex-end;
        border-top: 1px solid var(--border);
        padding-top: 10px;
        margin-top: 4px;
    }

    /* Overview tab mobile polish */
    .recent-item {
        padding: 12px 14px;
    }

    .overview-search-box {
        padding: 10px 14px;
    }

    .overview-courier-row {
        padding: 10px 14px;
    }

    .overview-sys-row {
        padding: 10px 14px;
    }

    .overview-activity-item {
        padding: 10px 14px;
    }

    /* Courier rating tab mobile */
    .cr-tabs {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        display: flex;
        scrollbar-width: none;
        box-sizing: border-box;
    }

    .cr-tabs::-webkit-scrollbar {
        display: none;
    }

    .cr-tab-btn {
        padding: 8px 14px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .cr-filter-item,
    .cr-filter-item select,
    .cr-filter-item .app-combo {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .cr-hist-filters {
        flex-direction: column;
        align-items: stretch;
    }

    /* MT Schedule calendar card on mobile */
    .mt-cal-card {
        padding: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mt-cal-grid {
        min-width: 580px;
    }
}

.shell,
.auth-wrap {
    animation: pageFade .15s ease both;
}

@keyframes pageFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.card,
.stat-card,
.auth-box {
    animation: cardIn .45s cubic-bezier(.2, .8, .2, 1) both;
}

.card:nth-child(2),
.stat-card:nth-child(2) {
    animation-delay: .05s;
}

.card:nth-child(3),
.stat-card:nth-child(3) {
    animation-delay: .1s;
}

.card:nth-child(4),
.stat-card:nth-child(4) {
    animation-delay: .15s;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.card,
.stat-card {
    transition:
        transform .25s ease,
        box-shadow .25s ease,
        border-color .25s ease;
}

.card:hover,
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 8px 25px rgba(15, 23, 42, .08);
}

.stat-card .val {
    animation: numberPop .5s ease both;
}

@keyframes numberPop {

    from {
        opacity: 0;
        transform: scale(.7);
    }

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

.nav-item {
    transition:
        background .2s ease,
        color .2s ease,
        padding-left .2s ease;
}

.nav-item:hover {
    padding-left: 25px;
}

.btn,
.auth-btn {
    position: relative;
    overflow: hidden;
    transition:
        box-shadow .18s ease,
        background .18s ease,
        transform .18s ease;
}

.btn:hover,
.auth-btn:hover {
    transform: none;
}

.btn:active,
.auth-btn:active {
    transform: scale(.97);
}

.btn::after,
.auth-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 80%;
    height: 100%;
    background:
        linear-gradient(120deg,
            transparent,
            rgba(255, 255, 255, .35),
            transparent);
    transition: left .5s ease;
}

.btn:hover::after,
.auth-btn:hover::after {
    left: 130%;
}

.flash {
    animation:
        flashIn .45s ease both,
        flashPulse 3s ease infinite;
}

@keyframes flashIn {

    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes flashPulse {

    0%,
    100% {
        box-shadow: 0 0 0 rgba(255, 51, 95, 0);
    }

    50% {
        box-shadow: 0 0 18px rgba(255, 51, 95, .12);
    }
}

input:not([type=checkbox]):not([type=radio]),
select,
textarea {
    transition:
        transform .2s ease,
        border-color .2s ease,
        box-shadow .2s ease;
}

input:not([type=checkbox]):not([type=radio]):focus,
select:focus,
textarea:focus {
    transform: translateY(-2px);
}

.upload-area {
    transition:
        transform .25s ease,
        border-color .25s ease,
        background .25s ease;
}

tbody tr {
    animation: rowShow .35s ease both;
}

tbody tr:nth-child(1) {
    animation-delay: .03s
}

tbody tr:nth-child(2) {
    animation-delay: .06s
}

tbody tr:nth-child(3) {
    animation-delay: .09s
}

tbody tr:nth-child(4) {
    animation-delay: .12s
}

tbody tr:nth-child(5) {
    animation-delay: .15s
}

@keyframes rowShow {

    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.badge {
    animation: badgePop .3s ease both;
}

@keyframes badgePop {

    from {
        opacity: 0;
        transform: scale(.8);
    }

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

.dots-loader span {
    box-shadow: 0 0 10px rgba(255, 51, 95, .35);
}

@keyframes expand {

    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        max-height: 1000px;
        transform: none;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 20px;
    transition: .2s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted2);
}

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

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

}

.cl-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cl-entry {
    display: flex;
    gap: 0;
}

.cl-spine {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 48px;
    flex-shrink: 0;
}

.cl-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg);
    flex-shrink: 0;
    margin-top: 3px;
    box-shadow: 0 0 0 2px var(--accent);
    z-index: 1;
}

.cl-dot.minor {
    background: var(--accent-b);
    box-shadow: 0 0 0 2px var(--accent-b);
}

.cl-dot.patch {
    background: var(--muted2);
    box-shadow: 0 0 0 2px var(--muted2);
}

.cl-dot.hotfix {
    background: var(--muted2);
    box-shadow: 0 0 0 2px var(--muted2);
}

.cl-line {
    width: 2px;
    background: var(--border2);
    flex: 1;
    margin-top: 2px;
}

.cl-entry:last-child .cl-line {
    display: none;
}

.cl-body {
    flex: 1;
    padding: 0 0 28px 16px;
}

.cl-version {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.cl-ver-tag {
    font-family: var(--mono);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.cl-date {
    font-size: 12px;
    color: var(--muted2);
    font-family: var(--mono);
}

.cl-type {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.cl-type.major {
    background: var(--status-red-bg);
    color: var(--status-red-text);
}

.cl-type.minor {
    background: var(--status-blue-bg);
    color: var(--status-blue-text);
}

.cl-type.patch {
    background: var(--status-neutral-bg);
    color: var(--status-neutral-text);
}

.cl-type.hotfix {
    background: var(--status-neutral-bg);
    color: var(--status-neutral-text);
}

.cl-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.cl-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cl-items li {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.55;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.cl-items li::before {
    content: "";
    display: block;
    margin-top: 7px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--border2);
}

.cl-items li.feat::before {
    background: var(--accent-g);
}

.cl-items li.fix::before {
    background: var(--accent);
}

.cl-items li.chore::before {
    background: var(--accent-b);
}

.cl-items li.break::before {
    background: var(--accent-o);
}

.cl-tag-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.cl-tag {
    font-size: 11px;
    font-family: var(--mono);
    background: var(--bg);
    border: 1px solid var(--border2);
    border-radius: 6px;
    padding: 2px 7px;
    color: var(--muted);
}

.cl-commit {
    font-size: 11px;
    font-family: var(--mono);
    color: var(--muted2);
    margin-top: 8px;
}

.cl-commit a {
    color: var(--accent-b);
    text-decoration: none;
}

.cl-commit a:hover {
    text-decoration: underline;
}

.cl-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
    font-size: 12px;
    color: var(--muted);
    align-items: center;
}

.cl-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    vertical-align: middle;
}

.sector-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow .2s
}

.sector-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08)
}

.sector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    gap: 12px
}

.sector-body {
    padding: 18px 22px
}

.sector-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--status-blue-bg);
    border: 1.5px solid var(--status-blue-border);
    color: var(--status-blue-text);
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    margin: 3px
}

.sector-ds-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--status-yellow-bg);
    border: 1.5px solid var(--status-yellow-border);
    color: var(--status-yellow-text);
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    margin: 3px
}

.ds-picker-wrap {
    border: 1px solid var(--border2);
    border-radius: var(--r);
    overflow: hidden;
    max-height: 340px;
    display: flex;
    flex-direction: column
}

.ds-picker-search {
    border: none;
    border-bottom: 1px solid var(--border2);
    border-radius: 0;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    background: var(--bg)
}

.ds-picker-list {
    overflow-y: auto;
    flex: 1;
    padding: 8px
}

.ds-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background .15s;
    font-size: 13px
}

.ds-picker-item:hover {
    background: var(--status-neutral-bg)
}

.ds-picker-item input[type=checkbox] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin: 0
}

.ds-picker-item.checked {
    background: var(--status-yellow-bg)
}

.ds-picker-counter {
    padding: 8px 14px;
    border-top: 1px solid var(--border2);
    font-size: 12px;
    color: var(--muted);
    background: var(--bg);
    font-family: var(--mono)
}

.sector-access-banner {
    background: var(--status-blue-bg);
    border: 1px solid var(--status-blue-border);
    border-radius: var(--r);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--status-blue-text);
    display: flex;
    align-items: center;
    gap: 10px
}

.stats-grid {
    display: flex;
    gap: 20px;
}

.stats-grid>.stat-card {
    flex: 1;
    aspect-ratio: 1;

    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;

    padding: 26px 22px;

    display: flex;
    flex-direction: column;

    transition: .18s;
}

.stats-grid>.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(30, 41, 59, .08);
}

.stat-card.yellow .val {
    color: var(--accent-y);
}

.stat-card.green .val {
    color: var(--accent-g);
}

.stat-card.orange .val {
    color: var(--accent-o);
}

.stat-card.purple .val {
    color: var(--accent-p);
}

.stat-card.red .val {
    color: var(--accent);
}

.stat-card .lbl {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;

    color: var(--muted);

    line-height: 1.2;
    margin-bottom: 10px;
}

.stat-card .sub {
    font-size: 13px;
    line-height: 1.35;
    color: var(--muted2);
}

@media (max-width:1200px) {

    .stats-grid {
        flex-wrap: wrap;
    }

    .stats-grid>.stat-card {
        flex: 1 1 calc(50% - 10px);
        aspect-ratio: 1;
    }
}

@media (max-width:700px) {

    .stats-grid>.stat-card {
        flex-basis: 100%;
        aspect-ratio: auto;
        min-height: 220px;
    }
}

.m-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999
}

.m-overlay.open {
    display: flex
}

.m-box {
    background: var(--surface);
    border-radius: 14px;
    padding: 26px 30px;
    width: min(420px, 93vw);
    position: relative;
    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .15)
}

.m-box h3 {
    font-size: 13px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
    letter-spacing: .04em;
    font-family: var(--display)
}

.m-box .m-sub {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 18px;
    line-height: 1.6
}

.m-box label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted2);
    margin-bottom: 4px;
    margin-top: 12px
}

.m-box input:not([type=checkbox]):not([type=radio]) {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 14px;
    padding: 10px 12px;
    outline: none;
    color: var(--text);
    transition: border-color .2s
}

.m-box input:not([type=checkbox]):not([type=radio]):focus {
    border-color: var(--accent)
}

.m-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px
}

.m-btn-primary {
    flex: 1;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: var(--display);
    font-size: 11px;
    font-weight: 700;
    padding: 11px;
    cursor: pointer;
    transition: opacity .2s;
    letter-spacing: .04em
}

.m-btn-primary:hover {
    opacity: .85
}

.m-btn-cancel {
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11px;
    padding: 11px 14px;
    cursor: pointer;
    transition: all .15s;
    font-family: var(--mono)
}

.m-btn-cancel:hover {
    color: var(--text);
    border-color: var(--muted)
}

.m-close {
    position: absolute;
    top: 13px;
    right: 15px;
    font-size: 22px;
    cursor: pointer;
    color: var(--muted);
    line-height: 1
}

.m-err {
    background: rgba(220, 38, 38, .08);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, .3);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 11px;
    margin-top: 8px;
    display: none
}

.extra-perms-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    cursor: help;
    transition: transform .15s ease, opacity .15s ease;
    user-select: none;
    box-sizing: border-box;
    flex-shrink: 0;
    border: 1px solid;
    animation: badgePop .3s ease both
}

.extra-perms-badge:hover {
    transform: scale(1.15);
    opacity: .85
}

.extra-perms-badge--add {
    background: var(--status-green-bg);
    color: var(--status-green-text);
    border-color: var(--status-green-border)
}

.extra-perms-badge--remove {
    background: var(--status-red-bg);
    color: var(--status-red-text);
    border-color: var(--status-red-border)
}

.m-box input.edit-perm-checkbox,
.edit-perm-checkbox {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    border: 1.5px solid var(--border2) !important;
    border-radius: 4px !important;
    background-color: var(--surface) !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    transition: border-color .15s ease, background-color .15s ease !important
}

.m-box input.edit-perm-checkbox:hover,
.edit-perm-checkbox:hover {
    border-color: var(--accent) !important
}

.m-box input.edit-perm-checkbox:checked,
.edit-perm-checkbox:checked {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3.5 8.5 6.5 11.5 12.5 4.5'/%3E%3C/svg%3E") !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-size: 11px 11px !important
}

.edit-perm-role-tag {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    line-height: 1.2
}

.week-reports-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.week-day-cell {
    border: 1px solid var(--border);
    border-radius: var(--r-sm, 10px);
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    background: var(--card);
    transition: transform .15s ease, box-shadow .15s ease;
}

.week-day-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
}

.week-day-cell.is-uploaded {
    background: var(--status-green-bg);
    border-color: var(--status-green-border);
}

.week-day-cell.is-missing {
    background: var(--status-red-bg);
    border-color: var(--status-red-border);
}

.week-day-cell.is-waiting {
    background: rgba(59, 130, 246, 0.04);
    border-color: rgba(59, 130, 246, 0.22);
}

.week-day-cell.is-future {
    background: var(--bg);
    border-color: var(--border);
    opacity: 0.85;
}

.week-day-cell.is-today {
    box-shadow: 0 0 0 2px var(--accent-b);
}

.week-day-badge-today {
    position: absolute;
    top: -9px;
    background: var(--accent-b);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 8px;
    letter-spacing: .02em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
}

.week-day-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 2px;
}

.week-day-date {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}

.week-day-status {
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
}

.week-day-cell.is-uploaded .week-day-status {
    color: var(--status-green-text);
    background: rgba(16, 185, 129, 0.12);
}

.week-day-cell.is-missing .week-day-status {
    color: var(--status-red-text);
    background: rgba(239, 68, 68, 0.12);
}

.week-day-cell.is-waiting .week-day-status {
    color: var(--accent-b, #2563eb);
    background: rgba(59, 130, 246, 0.12);
}

.week-day-cell.is-future .week-day-status {
    color: var(--muted);
    background: var(--border);
}

.week-day-meta {
    margin-top: 5px;
    font-size: 10.5px;
    color: var(--muted);
}

@media(max-width:900px) {
    .week-reports-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media(max-width:550px) {
    .week-reports-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.maint-box {
    max-width: 480px !important;
    text-align: center;
    padding: 38px 32px 30px;
    margin: 0 auto;
}

.maint-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: var(--text);
    background: transparent;
    border: none;
    box-shadow: none;
}

.maint-icon-badge svg {
    animation: maintPulse 3s ease-in-out infinite;
}

@keyframes maintPulse {

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

    50% {
        transform: scale(1.06);
        opacity: 1;
    }
}

.maint-title {
    font-family: var(--display);
    font-size: 21px;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 10px;
    letter-spacing: -0.01em;
    text-align: center;
}

.maint-desc {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.6;
    margin: 0 auto 22px;
    max-width: 390px;
    text-align: center;
}

.maint-user-card {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 14px;
    padding: 13px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
}

[data-theme="dark"] .maint-user-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.maint-user-meta {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 700;
}

.maint-user-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-top: 2px;
}

.maint-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.maint-note {
    font-size: 11.5px;
    color: var(--muted2);
    margin-top: 18px;
    line-height: 1.5;
    text-align: center;
}

.maint-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1050px) {
    .maint-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 580px) {
    .maint-stats-grid {
        grid-template-columns: 1fr;
    }
}

.maint-stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.maint-stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.maint-stat-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.maint-stat-num {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    font-family: var(--mono);
    line-height: 1.2;
    margin-top: 2px;
}

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

.maint-search-wrap {
    position: relative;
    flex: 1;
    min-width: 240px;
    max-width: 380px;
}

.maint-search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.maint-search-input {
    width: 100%;
    padding: 10px 14px 10px 38px !important;
    border-radius: var(--r-sm);
    border: 1px solid var(--border2);
    background: var(--surface);
    color: var(--text);
    font-size: 13.5px;
    outline: none;
    transition: border-color .15s;
}

.maint-search-input:focus {
    border-color: var(--accent);
}

.maint-filter-group {
    display: inline-flex;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
}

.maint-filter-btn {
    border: none;
    background: transparent;
    color: var(--muted);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    font-family: var(--sans);
}

.maint-filter-btn.active {
    background: var(--card);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.maint-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 51, 95, 0.1);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13.5px;
    flex-shrink: 0;
}

.dot-red {
    background: var(--accent, #ff335f);
    box-shadow: 0 0 6px rgba(255, 51, 95, 0.6);
}

.btn.btn-green,
.btn.btn-success {
    background: rgba(34, 197, 94, 0.1) !important;
    border: 1px solid rgba(34, 197, 94, 0.35) !important;
    color: #16a34a !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

.btn.btn-green:hover,
.btn.btn-success:hover {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35) !important;
}

.btn.btn-green svg,
.btn.btn-success svg {
    stroke: currentColor;
}

[data-theme="dark"] .btn.btn-green,
[data-theme="dark"] .btn.btn-success {
    background: rgba(34, 197, 94, 0.15) !important;
    border-color: rgba(34, 197, 94, 0.4) !important;
    color: #4ade80 !important;
}

[data-theme="dark"] .btn.btn-green:hover,
[data-theme="dark"] .btn.btn-success:hover {
    background: #22c55e !important;
    border-color: #22c55e !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4) !important;
}

.btn.btn-red,
.btn.btn-danger {
    background: rgba(255, 51, 95, 0.1) !important;
    border: 1px solid rgba(255, 51, 95, 0.35) !important;
    color: var(--accent, #ff335f) !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

.btn.btn-red:hover,
.btn.btn-danger:hover {
    background: var(--accent, #ff335f) !important;
    border-color: var(--accent, #ff335f) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(255, 51, 95, 0.35) !important;
}

.btn.btn-red svg,
.btn.btn-danger svg {
    stroke: currentColor;
}

[data-theme="dark"] .btn.btn-red,
[data-theme="dark"] .btn.btn-danger {
    background: rgba(255, 51, 95, 0.16) !important;
    border-color: rgba(255, 51, 95, 0.4) !important;
    color: #ff6b8b !important;
}

[data-theme="dark"] .btn.btn-red:hover,
[data-theme="dark"] .btn.btn-danger:hover {
    background: #ff335f !important;
    border-color: #ff335f !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(255, 51, 95, 0.45) !important;
}

.maint-btn-ghost {
    width: 100%;
    height: 44px;
    background: var(--surface);
    border: 1px solid var(--border2);
    color: var(--muted);
    border-radius: 12px;
    font-family: var(--sans);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all .16s ease;
    text-decoration: none;
}

.maint-btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255, 51, 95, 0.05);
}

[data-theme="dark"] .maint-btn-ghost {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .maint-btn-ghost:hover {
    background: rgba(255, 51, 95, 0.12);
    border-color: var(--accent);
    color: #ff6b8b;
}

.maint-btn-revert {
    width: 100%;
    background: linear-gradient(135deg, #ff335f 0%, #db1240 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: var(--sans);
    font-size: 14.5px;
    font-weight: 700;
    padding: 13px 20px;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 16px rgba(255, 51, 95, .38);
    letter-spacing: .01em;
    text-decoration: none;
}

.maint-btn-revert:hover {
    background: linear-gradient(135deg, #ff2654 0%, #c40a34 100%);
    box-shadow: 0 6px 22px rgba(255, 51, 95, .48);
    transform: translateY(-1px);
}

.maint-btn-revert:active {
    transform: translateY(0);
}

.wait-icon svg {
    animation: pop .3s ease-out .45s both;
}

.wait-icon .check {
    fill: none;
    stroke: #ff335f;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: draw .45s ease-out forwards;
}

@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes pop {
    0% {
        transform: scale(.85);
    }

    70% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

.cr-upload-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px
}

@media (max-width:992px) {
    .cr-upload-grid {
        grid-template-columns: 1fr
    }
}

.cr-drop {
    border: 2px dashed var(--border2);
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--bg)
}

.cr-drop:hover,
.cr-drop.drag-over {
    border-color: var(--accent);
    background: rgba(255, 51, 95, .04)
}

.cr-drop.loaded {
    border-color: #22c55e;
    border-style: solid;
    background: rgba(34, 197, 94, .05)
}

.cr-drop-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px
}

.cr-drop-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px
}

.cr-drop-hint {
    font-size: 12px;
    color: var(--muted)
}

.cr-drop-file {
    font-size: 12px;
    color: #22c55e;
    font-weight: 600;
    margin-top: 6px
}

.cr-period-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    flex-wrap: wrap
}

.cr-period-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em
}

.cr-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 14px;
    flex-wrap: wrap
}

.upload-area {
    border: 2px dashed var(--border2);
    border-radius: 12px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--bg)
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--accent);
    background: rgba(255, 51, 95, .04)
}

.up-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px
}

.up-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px
}

.up-sub {
    font-size: 12px;
    color: var(--muted)
}

.file-type-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    margin-bottom: 7px
}

.file-type-row .fname {
    flex: 1;
    font-size: 13px;
    font-family: var(--mono);
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.file-type-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
    white-space: nowrap
}

.file-type-badge.main {
    background: var(--status-blue-bg);
    color: var(--status-blue-text)
}

.file-type-badge.cancel {
    background: var(--status-yellow-bg);
    color: var(--status-yellow-text)
}

.file-type-badge.unknown {
    background: var(--status-neutral-bg);
    color: var(--status-neutral-text)
}

.file-type-label {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap
}

@keyframes progSlideInTop {
    0% {
        opacity: 0;
        transform: translate(-50%, -40px) scale(0.96);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

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

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

.prog-spin {
    animation: spinRing 0.9s linear infinite;
}

@keyframes progShimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(250%);
    }
}

.prog-shimmer-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.38) 50%, transparent 100%);
    animation: progShimmer 1.8s infinite;
}

.prog-floating-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translate(-50%, 0);
    width: min(540px, calc(100vw - 32px));
    z-index: 99999;
    pointer-events: auto;
    animation: progSlideInTop 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.prog-floating-toast.prog-closing {
    opacity: 0 !important;
    transform: translate(-50%, -45px) scale(0.96) !important;
    pointer-events: none !important;
}

.prog-toast-card {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.16), 0 4px 12px -2px rgba(15, 23, 42, 0.08);
}

[data-theme="dark"] .prog-toast-card {
    background: var(--card);
    border: 1px solid var(--border2);
    box-shadow: 0 16px 40px -4px rgba(0, 0, 0, 0.6), 0 4px 14px -2px rgba(0, 0, 0, 0.35);
}

.prog-btn-close {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background 0.15s ease;
    line-height: 1;
}

.prog-btn-close:hover {
    color: var(--text);
    background: rgba(255, 51, 95, 0.12);
}

.pagination-hidden {
    display: none !important;
}

.weekly-pagination-hidden {
    display: none !important;
}

.stats-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.global-rank-badge {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg);
    font-weight: 800;
    font-size: 12px;
    border: 1px solid var(--border);
}

.global-rank-badge.rank-gold {
    background: #fef9c3;
    color: #854d0e;
    border-color: #fde047;
}

.global-rank-badge.rank-silver {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

.global-rank-badge.rank-bronze {
    background: #ffedd5;
    color: #9a3412;
    border-color: #fed7aa;
}

[data-theme="dark"] .global-rank-badge.rank-gold {
    background: #422006;
    color: #fde047;
    border-color: #854d0e;
}

[data-theme="dark"] .global-rank-badge.rank-silver {
    background: #1e293b;
    color: #cbd5e1;
    border-color: #475569;
}

[data-theme="dark"] .global-rank-badge.rank-bronze {
    background: #431407;
    color: #fed7aa;
    border-color: #9a3412;
}

.btn-metrics-badge {
    background: var(--status-neutral-bg);
    color: var(--muted);
    border: 1px solid var(--border2);
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all var(--trans);
    font-family: var(--sans);
}

.btn-metrics-badge:hover {
    background: var(--status-blue-bg);
    color: var(--status-blue-text);
    border-color: var(--status-blue-border);
    transform: translateY(-1px);
}

.btn-metrics-badge.active {
    background: var(--accent-b);
    color: #fff;
    border-color: var(--accent-b);
}

.ds-details-toggle {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    user-select: none;
    transition: all var(--trans);
    text-decoration: none;
    display: inline-block;
}

.ds-details-toggle:hover {
    color: var(--accent-h);
    transform: translateY(-1px);
    text-decoration: none;
}

.ds-details-toggle:active {
    transform: translateY(0);
}

.ds-details-drawer {
    padding: 16px 20px;
    background: var(--hover);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    animation: drawerSlideDown .24s cubic-bezier(.16, 1, .3, 1);
}

@keyframes drawerSlideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

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

.ds-detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 11px 13px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
}

.dir-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.dir-custom-select {
    border: 1px solid var(--border2);
    border-radius: 20px;
    padding: 5px 32px 5px 12px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--sans);
    color: var(--text);
    cursor: pointer;
    outline: none;
    transition: all var(--trans);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.dir-custom-select:hover {
    border-color: var(--accent);
}

.dir-custom-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 51, 95, .1);
}

.dir-custom-select.is-desc {
    background-color: var(--status-green-bg);
    color: var(--status-green-text);
    border-color: var(--status-green-border);
}

.dir-custom-select.is-asc {
    background-color: var(--status-blue-bg);
    color: var(--status-blue-text);
    border-color: var(--status-blue-border);
}

.stats-filters {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.stats-filter {
    min-width: 210px;
}

.stats-filter.grow {
    flex: 1;
}

.stats-filter label {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.stats-filter select {
    width: 100%;
}

.stats-page .stats-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stats-page .stat-card {
    position: relative;
    overflow: hidden;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    box-shadow: 0 8px 25px rgba(15, 23, 42, .06);
}

.stats-page .stat-card::after {
    content: "";
    position: absolute;
    right: -25px;
    bottom: -35px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 51, 95, .06);
}

.stats-page .stat-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.stats-page .stat-value {
    margin-top: 8px;
    font-size: 27px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--text);
}

.stats-page .stat-sub {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
}

.stats-page .stat-change {
    font-weight: 800;
}

.stats-page .stat-change.up {
    color: var(--accent-g);
}

.stats-page .stat-change.down {
    color: var(--accent);
}

.stats-page .stats-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 20px;
    align-items: stretch;
    margin-bottom: 24px;
}

.stats-page .stats-grid>.card {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    height: 100%;
}

.stats-page .stats-grid>.card>.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.stats-page .stats-chart {
    position: relative;
    flex: 1 1 0;
    width: 100%;
    min-height: 320px;
    height: 100%;
}

.stats-page .stats-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

.stats-page .stats-table {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
}

.stats-page .stats-table td {
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

.stats-page .stats-table td:last-child {
    text-align: right;
    font-weight: 800;
    padding-right: 24px;
}

.stats-page .ds-rank {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-page .ds-rank-num {
    width: 27px;
    height: 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg);
    font-size: 12px;
    font-weight: 800;
}

.stats-page .ds-rank-selected {
    background: var(--status-blue-bg);
}

.stats-page .ds-rank-selected .ds-rank-num {
    background: var(--accent-b);
    color: #fff;
}

.stats-page .ds-rank-selected td {
    color: var(--status-blue-text);
    font-weight: 700;
}

.stats-page .ds-rank-outside td {
    border-top: 2px dashed var(--border2);
}

@media(max-width:1000px) {
    .stats-page .stats-kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-page .stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-page .stats-chart {
        height: 340px;
    }
}

@media(max-width:600px) {
    .stats-page .stats-kpis {
        grid-template-columns: 1fr;
    }

    .stats-page .stats-chart {
        height: 260px;
    }
}

.cl-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding: 6px 8px;
    background: var(--surface2, var(--surface));
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    transition: background var(--trans), border-color var(--trans), box-shadow var(--trans), transform var(--trans);
}

.cl-item-row.cl-dragging {
    opacity: 0.45;
    border-style: dashed;
    background: var(--hover);
}

.cl-item-row.cl-drag-over {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 51, 95, 0.2);
    transform: translateY(-2px);
}

.cl-drag-handle {
    cursor: grab;
    color: var(--muted);
    font-size: 15px;
    padding: 2px 4px;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--trans);
}

.cl-drag-handle:hover {
    color: var(--text);
}

.cl-drag-handle:active {
    cursor: grabbing;
}

.cl-btn-reorder {
    padding: 4px 7px;
    font-size: 11px;
    line-height: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--trans);
}

.cl-btn-reorder:hover:not(:disabled) {
    background: var(--hover);
    color: var(--text);
    border-color: var(--border2);
}

.cl-btn-reorder:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.cr-tabs {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-bottom: 24px;
    background: var(--card);
    border-radius: 12px;
    padding: 4px;
    width: fit-content;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    user-select: none;
    font-family: var(--sans)
}

.cr-tabs-glider {
    position: absolute;
    top: 4px;
    left: 0;
    height: calc(100% - 8px);
    background: var(--accent);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(255, 51, 95, .35);
    pointer-events: none;
    z-index: 1;
    will-change: transform, width;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transition: transform .24s cubic-bezier(0.25, 1, 0.5, 1), width .24s cubic-bezier(0.25, 1, 0.5, 1), opacity .16s ease;
    opacity: 0
}

.cr-tab-btn {
    position: relative;
    z-index: 2;
    padding: 9px 20px;
    border-radius: 8px;
    font-family: var(--sans);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    background: transparent !important;
    border: none;
    cursor: pointer;
    transition: color .22s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    outline: none
}

.cr-tab-btn.active {
    color: #fff !important
}

.cr-tab-btn:hover:not(.active) {
    color: var(--text)
}

.mt-section {
    display: none;
}

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

.mt-tabs-glider {
    box-shadow: var(--shadow-sm) !important;
}

.mt-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.mt-legend-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    margin-bottom: 20px;
    font-size: 12.5px;
}

.mt-legend-items {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.mt-legend-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-left: auto;
}

.ui-toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.ui-toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    margin: 0;
}

.ui-toggle-slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
    background-color: var(--border2, #e5e7eb);
    border: 1px solid var(--border, #d1d5db);
    border-radius: 9999px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
    box-sizing: border-box;
}

.ui-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ui-toggle-switch input[type="checkbox"]:checked + .ui-toggle-slider {
    background-color: var(--accent);
    border-color: var(--accent-h, var(--accent));
}

.ui-toggle-switch input[type="checkbox"]:checked + .ui-toggle-slider::after {
    transform: translateX(16px);
}

.ui-toggle-switch:hover .ui-toggle-slider {
    border-color: var(--muted2, #94a3b8);
}

.ui-toggle-label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
    line-height: 1;
}

[data-theme="dark"] .ui-toggle-slider {
    background-color: #334155;
    border-color: #475569;
}

[data-theme="dark"] .ui-toggle-slider::after {
    background-color: #f8fafc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .ui-toggle-switch input[type="checkbox"]:checked + .ui-toggle-slider {
    background-color: var(--accent);
    border-color: var(--accent-h, var(--accent));
}

.mt-cal-card.mt-hide-rejected .mt-chip.rejected {
    display: none !important;
}

.mt-legend-bar.mt-hide-rejected .mt-legend-item.legend-rejected {
    opacity: 0.45;
    transition: opacity 0.2s ease;
}

/* Фильтр «Оставить только запросы»: видны только ожидающие */
.mt-cal-card.mt-only-requests .mt-chip:not(.pending) {
    display: none !important;
}

.mt-legend-bar.mt-only-requests .mt-legend-item:not(.legend-pending) {
    opacity: 0.45;
    transition: opacity 0.2s ease;
}

.mt-legend-bar.mt-only-requests .mt-hide-rejected-control {
    display: none !important;
}

.mt-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 500;
}

.mt-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.mt-legend-swatch.free {
    background: var(--card);
    border: 1px dashed var(--border2);
}

.mt-legend-swatch.pending {
    background: var(--status-yellow-bg);
    border: 1px solid var(--status-yellow-border);
}

.mt-legend-swatch.approved {
    background: var(--status-green-bg);
    border: 1px solid var(--status-green-border);
}

.mt-legend-swatch.rejected {
    background: var(--status-red-bg);
    border: 1px solid var(--status-red-border);
}

.mt-legend-swatch.cancelled {
    background: var(--status-neutral-bg);
    border: 1px solid var(--status-neutral-border);
}

.mt-legend-swatch.covered {
    background: var(--status-purple-bg);
    border: 1px solid var(--status-purple-border);
}

.mt-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.mt-kpi-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mt-kpi-val {
    font-size: 22px;
    font-weight: 800;
    font-family: var(--display);
    color: var(--text);
}

.mt-kpi-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .03em;
}

.mt-cal-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.mt-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.mt-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    width: 100%;
}

.mt-cal-header-cell {
    padding: 8px 6px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.mt-cal-header-cell.weekend {
    color: var(--status-red-text);
}

.mt-cal-cell {
    min-height: 115px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background .15s ease, border-color .15s ease;
    position: relative;
}

.mt-cal-cell.other-month {
    opacity: 0.38;
    background: var(--bg);
}

.mt-cal-cell.today {
    border: 1.5px solid var(--accent-b);
}

.mt-cal-cell.selectable {
    cursor: pointer;
}

.mt-cal-cell.selectable:hover {
    background: var(--hover);
    border-color: var(--border2);
}

.mt-cal-cell.is-selected {
    background: rgba(37, 99, 235, 0.08);
    border: 1.5px solid var(--accent-b);
}

.mt-cal-day-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.mt-cal-day-num {
    font-size: 13px;
    font-weight: 700;
    font-family: var(--sans);
    color: var(--text);
    line-height: 1;
}

.mt-cal-day-top .today-badge {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--status-blue-bg);
    color: var(--status-blue-text);
}

.mt-cal-chips {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.mt-chip {
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    text-align: left;
    transition: opacity .15s ease, transform .12s ease;
    border: 1px solid transparent;
    word-break: break-word;
    display: block;
    text-decoration: none;
}

.mt-chip:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.mt-chip.full-cell {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 10px;
    box-sizing: border-box;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
    border-radius: 6px;
}

.mt-chip.full-cell:hover {
    transform: none !important;
    opacity: 0.88;
}

.mt-chip.view-only {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 10px;
    box-sizing: border-box;
    cursor: default;
    transform: none !important;
    opacity: 1 !important;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
}

.mt-chip.view-only:hover {
    transform: none !important;
    opacity: 1 !important;
}

.mt-chip.pending {
    background: var(--status-yellow-bg);
    color: var(--status-yellow-text);
    border-color: var(--status-yellow-border);
}

.mt-chip.approved {
    background: var(--status-green-bg);
    color: var(--status-green-text);
    border-color: var(--status-green-border);
}

.mt-chip.rejected {
    background: var(--status-red-bg);
    color: var(--status-red-text);
    border-color: var(--status-red-border);
}

.mt-chip.cancelled {
    background: var(--status-neutral-bg);
    color: var(--status-neutral-text);
    border-color: var(--status-neutral-border);
}

.mt-chip.covered {
    background: var(--status-purple-bg);
    color: var(--status-purple-text);
    border-color: var(--status-purple-border);
    word-break: normal;
    overflow-wrap: normal;
}

.mt-chip.full-cell.covered {
    font-size: 10.5px;
    padding-left: 5px;
    padding-right: 5px;
    white-space: nowrap;
    overflow: hidden;
}

.mt-chip-more {
    font-size: 10px;
    color: var(--muted);
    font-weight: 600;
    padding: 2px 4px;
    cursor: pointer;
}

.mt-chip.is-draggable {
    cursor: grab;
    user-select: none;
}

.mt-chip.is-draggable:active {
    cursor: grabbing;
}

.mt-chip.is-dragging {
    opacity: 0.45;
}

.mt-chip.drop-target {
    outline: 2px dashed var(--accent, #3b82f6) !important;
    outline-offset: 1px;
    background: var(--surface-2, rgba(0, 0, 0, 0.05)) !important;
}

.mt-vacation-badge {
    margin-left: 0 !important;
    cursor: pointer;
    user-select: none;
    transition: opacity .15s ease;
}

.mt-vacation-badge:hover {
    opacity: 0.85;
}

.mt-selected-dates-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px dashed var(--border2);
    border-radius: var(--r-sm);
}

.mt-selected-dates-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

@media (max-width: 640px) {
    .mt-selected-dates-grid {
        grid-template-columns: 1fr;
    }
}

.mt-selected-date-chip {
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--mono);
    background: var(--status-blue-bg);
    color: var(--status-blue-text);
    border: 1px solid var(--status-blue-border);
    user-select: none;
    line-height: 1.3;
}

.mt-selected-date-chip .mt-chip-del {
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    color: var(--status-blue-text);
    opacity: 0.7;
    transition: opacity .15s ease, color .15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0 1px;
}

.mt-selected-date-chip .mt-chip-del:hover {
    opacity: 1;
    color: var(--status-red-text);
}

/* Floating Action Bar (Bottom Right) */
.mt-floating-bar {
    position: fixed;
    bottom: 24px;
    right: 28px;
    z-index: 1900;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 40px;
    padding: 8px 10px 8px 16px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
    animation: mtFloatSlideUp .22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mtFloatSlideUp {
    from {
        transform: translateY(20px) scale(0.96);
        opacity: 0;
    }

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

.mt-floating-info {
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.mt-floating-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    font-size: 11.5px;
    font-weight: 700;
    font-family: var(--mono);
    background: var(--status-blue-bg);
    color: var(--status-blue-text);
    border: 1px solid var(--status-blue-border);
}

/* Drawer Slide-over Panel */
.mt-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .24s ease;
}

.mt-drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.mt-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 760px;
    max-width: 95vw;
    background: var(--surface);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    transition: transform .26s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--sans);
}

.mt-drawer.open {
    transform: translateX(0);
}

.mt-drawer-header {
    padding: 16px 22px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mt-drawer-header h3 {
    margin: 0;
    font-size: 16.5px;
    font-weight: 700;
    color: var(--text);
}

.mt-drawer-close-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    line-height: 1;
    border-radius: 6px;
    transition: color .15s ease, background .15s ease;
}

.mt-drawer-close-btn:hover {
    color: var(--text);
    background: var(--hover);
}

.mt-drawer-nav-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 22px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.mt-drawer-nav-tab {
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all .16s ease;
}

.mt-drawer-nav-tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.mt-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mt-period-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    gap: 10px;
}

.mt-ds-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
    transition: border-color .18s ease;
}

.mt-ds-card.is-active-ds {
    border-color: var(--accent);
}

.mt-ds-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.mt-ds-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.mt-timeline-grid {
    display: grid;
    gap: 6px;
    width: 100%;
}

.mt-timeline-day-col {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 80px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.mt-timeline-day-col:hover {
    border-color: var(--border2);
    background: var(--surface);
}

.mt-timeline-day-col.is-active {
    border: 2px solid var(--accent);
    background: var(--surface2);
}

.mt-timeline-day-col.is-center:not(.is-active) {
    border-color: var(--accent-b);
}

.mt-timeline-day-header {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    padding-bottom: 3px;
}

.mt-timeline-box {
    padding: 4px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
    word-break: break-word;
    transition: opacity .15s ease;
}

.mt-timeline-box:hover {
    opacity: 0.85;
}

.mt-timeline-box.pending {
    background: var(--status-yellow-bg);
    color: var(--status-yellow-text);
    border: 1px solid var(--status-yellow-border);
}

.mt-timeline-box.approved {
    background: var(--status-green-bg);
    color: var(--status-green-text);
    border: 1px solid var(--status-green-border);
}

.mt-timeline-box.rejected {
    background: var(--status-red-bg);
    color: var(--status-red-text);
    border: 1px solid var(--status-red-border);
}

.mt-timeline-box.cancelled {
    background: var(--status-neutral-bg);
    color: var(--status-neutral-text);
    border: 1px solid var(--status-neutral-border);
}

.mt-timeline-box.covered {
    background: var(--status-purple-bg);
    color: var(--status-purple-text);
    border: 1px solid var(--status-purple-border);
    padding-left: 2px;
    padding-right: 2px;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    word-break: normal;
}

.mt-date-action-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.mt-history-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.mt-history-item:last-child {
    border-bottom: none;
}

/* Employee rows and inactive styling */
.mt-emp-row {
    transition: background .15s ease, opacity .15s ease;
}

.mt-emp-row.is-inactive {
    opacity: 0.65;
    background: var(--surface-2, rgba(0, 0, 0, 0.025)) !important;
    color: var(--muted) !important;
}

.mt-emp-row.is-inactive td {
    color: var(--muted) !important;
}

/* Vacation Modal */
.mt-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    z-index: 2050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.mt-modal-dialog {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    width: 100%;
    overflow: hidden;
    animation: mtFadeIn 0.18s ease-out;
    border-radius: 20px;
}

@keyframes mtFadeIn {
    from {
        opacity: 0;
        transform: scale(0.97);
    }

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

.chat-mode-tabs {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-bottom: 16px;
    background: var(--bg);
    border-radius: var(--r-sm);
    padding: 3px;
    width: fit-content;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    user-select: none;
    font-family: var(--sans);
}

.chat-mode-glider {
    position: absolute;
    top: 3px;
    left: 0;
    height: calc(100% - 6px);
    background: var(--accent);
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(255, 51, 95, .35);
    pointer-events: none;
    z-index: 1;
    will-change: transform, width;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transition: transform .24s cubic-bezier(0.25, 1, 0.5, 1), width .24s cubic-bezier(0.25, 1, 0.5, 1), opacity .16s ease;
    opacity: 0;
}

.chat-mode-btn {
    position: relative;
    z-index: 2;
    padding: 6px 14px;
    border-radius: 6px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    background: transparent !important;
    border: none;
    cursor: pointer;
    transition: color .22s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    outline: none;
}

.chat-mode-btn.active {
    color: #fff !important;
}

.chat-mode-btn:hover:not(.active) {
    color: var(--text);
}

.cr-section {
    display: none
}

.cr-section.active {
    display: block
}

.cr-upload-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px
}

.cr-drop {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 26px 20px;
    text-align: center;
    cursor: pointer;
    transition: all .25s;
    min-height: 115px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--surface, #181825)
}

.cr-drop:hover,
.cr-drop.drag-over {
    border-color: var(--accent);
    background: rgba(99, 102, 241, .08)
}

.cr-drop.loaded {
    border-color: #22c55e;
    border-style: solid;
    background: rgba(34, 197, 94, .06)
}

.cr-drop-icon {
    font-size: 30px
}

.cr-drop-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text)
}

.cr-drop-hint {
    font-size: 11.5px;
    color: var(--muted)
}

.cr-drop-file {
    font-size: 11.5px;
    color: #22c55e;
    font-weight: 600;
    margin-top: 4px
}

.cr-period-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    flex-wrap: wrap
}

.cr-period-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em
}

.cr-radio-group {
    display: flex;
    gap: 8px
}

.cr-radio-btn {
    padding: 7px 18px;
    border-radius: 7px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid var(--border);
    cursor: pointer;
    background: transparent;
    color: var(--muted);
    transition: all .2s
}

.cr-radio-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(99, 102, 241, .1)
}

.cr-period-extra {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1
}

.cr-period-extra select,
.cr-period-extra input[type=date] {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--input-bg, #1e1e2e);
    color: var(--text);
    font-size: 13px;
    min-width: 280px
}

.cr-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    flex-wrap: wrap
}

.cr-hist-filters {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border)
}

.cr-filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.cr-filter-item label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em
}

.cr-hist-filters select {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--input-bg, #1e1e2e);
    color: var(--text);
    font-size: 13px;
    height: 38px;
    box-sizing: border-box
}

#hist-sector-sel {
    min-width: 240px;
    width: 260px;
    max-width: 100%;
}

#hist-ds-sel,
#cr-send-ds-sel {
    min-width: 280px;
    width: 300px;
    max-width: 100%;
}

#hist-week-sel,
#cr-send-yw-sel,
#cr-send-all-yw-sel {
    min-width: 380px;
    width: 420px;
    max-width: 100%;
}

#hist-type-sel {
    min-width: 220px;
    width: 240px;
    max-width: 100%;
}

.cr-hist-filters .btn {
    height: 38px;
    padding: 8px 16px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px
}

.cr-no-history {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
    font-size: 14px
}

.cr-metrics-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px
}

.cr-metrics-tbl th {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid var(--border)
}

.cr-metrics-tbl th:first-child,
.cr-metrics-tbl td:first-child {
    text-align: center;
    width: 48px
}

.cr-metrics-tbl td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle
}

.cr-metrics-tbl input[type=checkbox] {
    margin: 0 auto;
    display: inline-block;
    vertical-align: middle
}

.cr-metrics-tbl tr:last-child td {
    border-bottom: none
}

.cr-metrics-tbl tr:hover td {
    background: rgba(255, 255, 255, .02)
}

.cr-metrics-tbl input[type=text],
.cr-metric-name-inp {
    height: 32px;
    min-height: 32px;
    box-sizing: border-box;
    padding: 0 10px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: var(--input-bg, #1e1e2e);
    color: var(--text);
    font-size: 12.5px;
    line-height: normal;
}

.cr-metrics-tbl input[type=number],
.cr-weight-inp {
    width: 60px;
    height: 32px;
    min-height: 32px;
    box-sizing: border-box;
    padding: 0 6px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: var(--input-bg, #1e1e2e);
    color: var(--text);
    text-align: center;
    font-size: 13px;
    line-height: normal;
}

select.cr-col-combo-select {
    width: 280px;
    max-width: 320px;
    height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: var(--input-bg, #1e1e2e);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    outline: none;
    transition: border-color .15s;
    box-sizing: border-box;
}

select.cr-col-combo-select:focus {
    border-color: var(--accent);
}

.app-combo.cr-col-combo-select {
    width: 280px;
    max-width: 320px;
}

.app-combo.cr-col-combo-select .app-combo-trigger {
    min-height: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 12.5px;
    border-radius: 6px;
    box-sizing: border-box;
}

.cr-col-manual-inp {
    height: 32px;
    min-height: 32px;
    box-sizing: border-box;
    padding: 0 10px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: var(--input-bg, #1e1e2e);
    color: var(--text);
    font-size: 12px;
    line-height: normal;
}

.cr-col-toggle-btn {
    height: 32px;
    min-height: 32px;
    box-sizing: border-box;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .2s;
}

.cr-col-toggle-btn.btn-icon {
    width: 32px;
    min-width: 32px;
    padding: 0;
}

.cr-col-toggle-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.cr-col-combo-select optgroup {
    font-weight: 700;
    color: var(--accent);
    background: var(--card-bg, #24273a);
}

.cr-col-combo-select option {
    font-weight: normal;
    color: var(--text);
    background: var(--input-bg, #1e1e2e);
    padding: 4px 8px;
}

.cr-dir-btn {
    height: 32px;
    min-height: 32px;
    box-sizing: border-box;
    padding: 0 12px;
    border-radius: 6px;
    font-family: var(--sans);
    font-size: 11.5px;
    font-weight: 700;
    border: 1.5px solid var(--border);
    cursor: pointer;
    background: transparent;
    transition: all .2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1;
    width: auto;
}

.cr-dir-btn.less {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255, 51, 95, .08);
}

.cr-dir-btn.less:hover {
    background: rgba(255, 51, 95, .16);
    border-color: var(--accent);
}

.cr-dir-btn.more {
    border-color: var(--accent-g, #22c55e);
    color: var(--accent-g, #22c55e);
    background: rgba(34, 197, 94, .08);
}

.cr-dir-btn.more:hover {
    background: rgba(34, 197, 94, .16);
}

.cr-del-btn {
    height: 32px;
    min-height: 32px;
    width: 32px;
    min-width: 32px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1.5px solid transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 15px;
    padding: 0;
    border-radius: 6px;
    transition: all .2s;
}

.cr-del-btn:hover:not(:disabled) {
    color: #ef4444;
    background: rgba(239, 68, 68, .15)
}

.cr-del-btn:disabled {
    opacity: .25;
    cursor: not-allowed
}

.cr-add-col-btn {
    font-size: 12px;
    padding: 6px 14px
}

.cr-del-rating-btn {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(255, 51, 95, .25) !important
}

.cr-del-rating-btn:hover {
    background: var(--accent-h, #e0183e) !important;
    border-color: var(--accent-h, #e0183e) !important;
    box-shadow: 0 4px 12px rgba(255, 51, 95, .35) !important
}

select.cr-pen-select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: var(--input-bg, #1e1e2e);
    color: var(--text);
    font-size: 12.5px;
    cursor: pointer;
    outline: none;
    transition: border-color .15s
}

select.cr-pen-select:focus {
    border-color: var(--accent)
}

.app-combo.cr-pen-select .app-combo-trigger {
    min-height: 34px;
    height: 34px;
    padding: 0 10px;
    font-size: 12.5px;
    border-radius: 6px;
}

.cr-pen-input {
    height: 32px;
    min-height: 32px;
    box-sizing: border-box;
    padding: 0 10px;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: var(--input-bg, #1e1e2e);
    color: var(--text);
    font-size: 12.5px;
    outline: none;
    transition: border-color .15s;
    -moz-appearance: textfield;
    appearance: textfield;
}

.cr-pen-input::-webkit-inner-spin-button,
.cr-pen-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cr-pen-input:focus {
    border-color: var(--accent)
}

.cr-penalty-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(239, 68, 68, .12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, .3);
    margin-left: 5px;
    vertical-align: middle;
    cursor: help;
    white-space: nowrap
}

.cr-penalty-badge.bonus {
    background: rgba(34, 197, 94, .12);
    color: #22c55e;
    border-color: rgba(34, 197, 94, .3)
}

.cr-pen-dyn-label {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer !important;
    user-select: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: var(--muted) !important;
}

.cr-pen-dyn-label input[type=checkbox] {
    margin: 0 !important;
    padding: 0 !important;
    width: 13px !important;
    height: 13px !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    vertical-align: middle !important;
    accent-color: var(--accent) !important;
    cursor: pointer !important;
}

.cr-pen-dyn-label span {
    text-transform: none !important;
    letter-spacing: normal !important;
    font-size: 11px !important;
    color: var(--muted) !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.cr-rating-table-h {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px
}

.cr-rating-table-h th {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 12px 8px;
    text-align: left;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: color .15s
}

.cr-rating-table-h th:hover {
    color: var(--accent)
}

.cr-rating-table-h th.cr-th-center {
    text-align: center
}

.cr-rating-table-h th.cr-th-rank,
.cr-rating-table-h td.cr-td-rank {
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    text-align: center;
    padding: 10px 4px;
    box-sizing: border-box
}

.cr-rating-table-h th.cr-th-name,
.cr-rating-table-h td.cr-td-name {
    width: 220px;
    min-width: 170px;
    max-width: 250px;
    text-align: left;
    padding: 10px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box
}

.cr-rating-table-h th.cr-th-type,
.cr-rating-table-h td.cr-td-type {
    width: 85px;
    min-width: 85px;
    max-width: 90px;
    text-align: center;
    padding: 10px 4px;
    box-sizing: border-box
}

.cr-rating-table-h th.cr-th-score,
.cr-rating-table-h td.cr-td-score {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
    text-align: center;
    padding: 10px 6px;
    box-sizing: border-box
}

.cr-rating-table-h th.cr-th-metric,
.cr-rating-table-h td.cr-td-metric {
    width: 115px;
    min-width: 108px;
    text-align: center;
    padding: 10px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    box-sizing: border-box
}

.cr-rating-table-h th.cr-th-del,
.cr-rating-table-h td.cr-td-del {
    width: 46px;
    min-width: 46px;
    max-width: 46px;
    text-align: center;
    padding: 8px 4px;
    box-sizing: border-box
}

.cr-courier-del-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: all .2s ease;
    outline: none
}

.cr-courier-del-btn:hover {
    color: var(--accent);
    background: rgba(255, 51, 95, .1);
    border-color: rgba(255, 51, 95, .3)
}

.cr-courier-del-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    transition: transform .25s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(0deg);
    pointer-events: none
}

.cr-courier-del-btn.is-marked {
    color: var(--accent);
    background: rgba(255, 51, 95, .08);
    border-color: rgba(255, 51, 95, .25)
}

.cr-courier-del-btn.is-marked:hover {
    color: var(--accent);
    background: rgba(255, 51, 95, .18);
    border-color: var(--accent)
}

.cr-courier-del-btn.is-marked .cr-courier-del-icon {
    transform: rotate(45deg)
}

.cr-rating-table-h tr.cr-row-to-delete td {
    color: var(--muted) !important;
    opacity: .38;
    filter: grayscale(100%);
    transition: all .2s ease
}

.cr-rating-table-h tr.cr-row-to-delete td.cr-td-name .cr-name {
    text-decoration: line-through;
    color: var(--muted) !important
}

.cr-rating-table-h tr.cr-row-to-delete .cr-place,
.cr-rating-table-h tr.cr-row-to-delete .cr-score-bar-wrap,
.cr-rating-table-h tr.cr-row-to-delete .cr-type-badge,
.cr-rating-table-h tr.cr-row-to-delete .cr-late-badge {
    filter: grayscale(100%);
    opacity: .45
}

.cr-rating-table-h tr.cr-row-to-delete td.cr-td-del {
    opacity: 1 !important;
    filter: none !important
}

.cr-del-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding: 14px 20px;
    background: var(--card);
    border: 1.5px solid var(--accent);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    position: sticky;
    bottom: 16px;
    z-index: 30;
    backdrop-filter: blur(10px);
    animation: crSlideUp .25s cubic-bezier(0.16, 1, 0.3, 1)
}

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

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

.cr-del-bar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap
}

.cr-del-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--mono);
    box-shadow: 0 2px 6px rgba(255, 51, 95, .35)
}

.cr-del-bar-text {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text)
}

.cr-del-bar-text b {
    color: var(--accent)
}

.cr-del-bar-subtext {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px
}

.cr-del-bar-right {
    display: flex;
    align-items: center;
    gap: 10px
}

.cr-del-save-btn {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(255, 51, 95, .35) !important;
    font-weight: 700 !important;
    display: inline-flex;
    align-items: center;
    gap: 6px
}

.cr-del-save-btn:hover {
    background: var(--accent-h, #e0183e) !important;
    border-color: var(--accent-h, #e0183e) !important;
    box-shadow: 0 4px 14px rgba(255, 51, 95, .45) !important
}

.cr-rating-table-h td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap
}

.cr-rating-table-h td.cr-td-metric {
    font-weight: 600
}

.cr-rating-table-h tr:last-child td {
    border-bottom: none
}

.cr-rating-table-h tr:hover td {
    background: rgba(255, 255, 255, .03)
}

.cr-place {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, .06)
}

.cr-place.gold {
    background: rgba(255, 215, 0, .2);
    color: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, .3)
}

.cr-place.silver {
    background: rgba(192, 192, 192, .2);
    color: #94a3b8
}

.cr-place.bronze {
    background: rgba(176, 132, 83, .2);
    color: #a16207
}

.cr-score-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%
}

.cr-score-bar-bg {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .1);
    overflow: hidden
}

.cr-score-bar-fill {
    height: 6px;
    border-radius: 3px;
    transition: width .4s
}

.cr-score-val {
    font-size: 13px;
    font-weight: 700;
    min-width: 36px;
    text-align: right
}

.cr-late-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700
}

.cr-late-badge.ok {
    background: rgba(34, 197, 94, .15);
    color: #22c55e
}

.cr-late-badge.warn {
    background: rgba(245, 158, 11, .15);
    color: #f59e0b
}

.cr-late-badge.crit {
    background: rgba(239, 68, 68, .15);
    color: #ef4444
}

.cr-name {
    font-weight: 600;
    color: var(--text)
}

.cr-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700
}

.cr-type-badge.ebike {
    background: rgba(0, 68, 255, 0.15);
    color: rgba(4, 0, 248, 0.66);
}

.cr-type-badge.bike {
    background: rgba(40, 161, 85, 0.12);
    color: rgba(60, 117, 81, 1);
}

.cr-send-preview {
    width: 100%;
    min-height: 120px;
    background: var(--surface, #181825);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    font-size: 13.5px;
    font-family: var(--sans);
    color: var(--text);
    outline: none;
    line-height: 1.65;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-break: break-word
}

.cr-send-preview b,
.cr-send-preview strong {
    font-weight: 700;
    color: inherit
}

[data-theme="dark"] .cr-send-preview b,
[data-theme="dark"] .cr-send-preview strong {
    color: #ffffff
}

.cr-send-preview code {
    background: var(--hover);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 12px;
    color: inherit
}

.cr-send-cats-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px
}

.cr-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    background: rgba(99, 102, 241, .12);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, .25)
}

.cr-send-notice {
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
    line-height: 1.5
}

.cr-send-form-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap
}

.cr-send-sep {
    height: 1px;
    background: var(--border);
    margin: 24px 0
}

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

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

/* Schedule System Styles */
.sched-cal-builder {
    margin-top: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 16px;
}

.sched-cal-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 6px 12px;
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    margin-bottom: 12px;
}

.sched-cal-toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.sched-toolbar-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .03em;
}

.sched-preset-btn {
    font-size: 11px;
    padding: 3px 8px;
    height: 28px;
    line-height: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--trans);
}

.sched-preset-btn:hover {
    background: var(--hover);
    border-color: var(--border2);
}

.sched-toolbar-divider {
    width: 1px;
    height: 18px;
    background: var(--border);
}

select.sched-batch-select {
    width: 80px;
    height: 28px;
    padding: 2px 20px 2px 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 22px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background-color: var(--surface);
    color: var(--text);
    display: inline-block;
    cursor: pointer;
}

.app-combo.sched-batch-select {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    height: 28px !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    display: inline-flex !important;
    vertical-align: middle !important;
}

.app-combo.sched-batch-select .app-combo-trigger {
    width: 100% !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0 6px 0 8px !important;
    border-radius: 4px !important;
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    color: var(--text) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    transition: all var(--trans) !important;
}

.app-combo.sched-batch-select .app-combo-trigger:hover,
.app-combo.sched-batch-select.open .app-combo-trigger {
    border-color: var(--border2) !important;
    background: var(--hover) !important;
}

.app-combo.sched-batch-select .app-combo-text {
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    color: var(--text) !important;
    font-family: var(--mono), var(--sans) !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

.app-combo.sched-batch-select .app-combo-arrow {
    font-size: 11px !important;
    color: var(--muted) !important;
    display: inline-flex !important;
    align-items: center !important;
    margin-left: auto !important;
}

.app-combo.sched-batch-select .app-combo-arrow svg {
    width: 8px !important;
    height: 5px !important;
    flex-shrink: 0 !important;
}

.app-combo.sched-batch-select .app-combo-dropdown {
    min-width: 80px !important;
    width: 80px !important;
}

.app-combo.sched-batch-select .app-combo-item {
    padding: 4px 8px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    font-family: var(--mono), var(--sans) !important;
}

.sched-cal-builder-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: 12px;
}

@media (max-width: 1200px) {
    .sched-cal-builder-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 6px;
    }
}

@media (max-width: 900px) {
    .sched-cal-builder-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 550px) {
    .sched-cal-builder-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.sched-cal-col-header {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sched-cal-col-header.weekend {
    color: #f43f5e;
}

/* Inactive cell outside 14 days */
.sched-cal-builder-cell.is-inactive {
    background: var(--hover);
    border: 1px dashed var(--border);
    border-radius: var(--r-sm);
    padding: 10px;
    opacity: 0.45;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    user-select: none;
    cursor: not-allowed;
}

.sched-cal-builder-cell.is-inactive .sched-cal-cell-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sched-cal-builder-cell.is-inactive .sched-cal-num-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
}

/* Active 14-day template cell */
.sched-cal-builder-cell.is-template {
    border-radius: var(--r-sm);
    padding: 10px;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all var(--trans);
    cursor: pointer;
    position: relative;
    user-select: none;
}

/* When marked RED / WORKING */
.sched-cal-builder-cell.is-template.is-work {
    background: rgba(225, 29, 72, 0.05);
    border: 2px solid #e11d48;
}

.sched-cal-builder-cell.is-template.is-work .sched-cal-num-circle {
    background: #e11d48;
    color: #ffffff;
    font-weight: 700;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(225, 29, 72, 0.35);
}

.sched-cal-builder-cell.is-template.is-work .sched-cal-status-label {
    background: rgba(225, 29, 72, 0.15);
    color: #e11d48;
    font-weight: 700;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 4px;
}

/* When marked OFF / DAY OFF */
.sched-cal-builder-cell.is-template.is-off {
    background: var(--surface);
    border: 1px solid var(--border);
    opacity: 0.85;
}

.sched-cal-builder-cell.is-template.is-off:hover {
    border-color: var(--border2);
    opacity: 1;
}

.sched-cal-builder-cell.is-template.is-off .sched-cal-num-circle {
    background: var(--hover);
    color: var(--text);
    font-weight: 600;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 1px solid var(--border);
}

.sched-cal-builder-cell.is-template.is-off .sched-cal-status-label {
    background: var(--hover);
    color: var(--muted);
    font-weight: 600;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.sched-cal-cell-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}

.sched-cal-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    margin-left: 6px;
}

.sched-cal-dow-name {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
}

.sched-today-pill {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    white-space: nowrap;
}

.sched-past-pill {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--hover);
    color: var(--muted);
    border: 1px solid var(--border);
    white-space: nowrap;
}

/* Hours selection in cell */
.sched-cal-cell-body {
    margin-top: 10px;
}

.sched-cal-hours-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 8px;
}

.sched-time-input-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sched-time-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sched-mini-label {
    font-size: 10px;
    color: var(--muted);
    font-weight: 600;
}

.sched-time-select {
    width: 100%;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 4px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text);
    cursor: pointer;
}

.sched-time-div {
    font-size: 11px;
    color: var(--muted);
    margin-top: 12px;
}

.sched-cal-off-wrap {
    padding: 12px 6px;
    text-align: center;
    background: var(--hover);
    border: 1px dashed var(--border);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: all var(--trans);
}

.sched-cal-off-wrap:hover {
    background: rgba(225, 29, 72, 0.08);
    border-color: #e11d48;
}

.sched-off-badge {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.sched-cal-off-wrap:hover .sched-off-badge {
    color: #e11d48;
}

.sched-off-sub {
    font-size: 10px;
    color: var(--muted);
}

/* Analysis Box */
.sched-analysis-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 16px;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sched-stat-row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.sched-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--hover);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.sched-cycle-chain {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 4px;
}

.sched-cycle-item {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.sched-cycle-item.work {
    background: rgba(225, 29, 72, 0.1);
    color: #e11d48;
    border: 1px solid rgba(225, 29, 72, 0.3);
}

.sched-cycle-item.off {
    background: var(--hover);
    color: var(--muted);
    border: 1px solid var(--border);
}

.sched-key-display-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sched-key-code {
    font-family: var(--mono);
    font-size: 12px;
    padding: 6px 10px;
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    flex: 1;
    word-break: break-all;
}

/* Unified Schedule Preview Component */
.sched-preview-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    margin-top: 20px;
    overflow: hidden;
}

.sched-preview-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--hover);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}

.sched-preview-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.sched-preview-panel-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.sched-preview-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    align-items: stretch;
}

@media (max-width: 920px) {
    .sched-preview-grid {
        grid-template-columns: 1fr;
    }
}

.sched-preview-details {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sched-preview-cal-wrap {
    padding: 18px;
    border-left: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

@media (max-width: 920px) {
    .sched-preview-cal-wrap {
        border-left: none;
        border-top: 1px solid var(--border);
    }
}

.sched-preview-stats-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

.sched-month-stats {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 8px;
    align-items: stretch;
}

@media (max-width: 640px) {
    .sched-month-stats {
        grid-template-columns: 1fr;
    }
}

.sched-month-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    transition: background .15s ease, border-color .15s ease;
}

.sched-month-stat-card:hover {
    background: var(--hover);
    border-color: var(--border-hover, var(--border));
}

.sched-month-stat-val {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
}

.sched-month-stat-val.accent {
    color: #e11d48;
}

.sched-month-stat-lbl {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.sched-month-stat-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
    line-height: 1.2;
}

.sched-cal-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--muted);
}

.sched-legend-dot {
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
}

.sched-legend-dot.work {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e11d48;
}

.sched-legend-dot.off {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--hover);
    border: 1px solid var(--border);
}

.sched-legend-dot.today {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    border: 1.5px solid var(--accent);
}

.sched-calendar-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 16px;
    max-width: 380px;
    width: 100%;
    box-sizing: border-box;
}

.sched-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
}

.sched-cal-month-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
}

.sched-cal-nav-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: all var(--trans);
}

.sched-cal-nav-btn:hover {
    background: var(--hover);
    border-color: var(--border2);
}

.sched-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
    max-width: 340px;
    margin: 0 auto;
}

.sched-cal-dow {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    padding-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.sched-cal-day-cell {
    aspect-ratio: 1;
    max-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    position: relative;
    user-select: none;
    color: var(--text);
    justify-self: center;
}

.sched-cal-day-cell.other-month {
    opacity: 0.25;
}

.sched-cal-day-cell.is-work .sched-cal-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e11d48;
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(225, 29, 72, 0.35);
}

.sched-cal-day-cell.is-off {
    color: var(--text);
}

.sched-cal-day-cell.today-cell {
    border: 1px solid var(--accent);
}

/* Hover Popover */
.schedule-hover-popover {
    position: fixed;
    z-index: 99999;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 14px;
    width: 300px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    pointer-events: auto;
    animation: modalIn .15s ease-out;
}

.schedule-hover-popover .sched-cal-grid {
    gap: 3px;
    align-items: center;
}

.schedule-hover-popover .sched-cal-day-cell {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    border-radius: 50% !important;
    margin: 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    position: relative;
    user-select: none;
    border: 2px solid transparent;
    transition: background var(--trans), border-color var(--trans);
}

.schedule-hover-popover .sched-cal-day-cell:not(.other-month):hover {
    background: var(--hover);
}

.schedule-hover-popover .sched-cal-day-cell.is-work .sched-cal-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 11px;
}

.schedule-hover-popover .sched-cal-day-cell.is-today {
    border-color: var(--accent) !important;
    border-style: dashed !important;
}

.schedule-hover-popover .sched-cal-day-cell.is-selected {
    border-color: #000 !important;
    border-style: solid !important;
    color: #000;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.08);
}

.schedule-hover-popover .sched-cal-day-cell.is-work.is-selected {
    border-color: #000 !important;
    border-style: solid !important;
    color: #fff;
}

[data-theme="dark"] .schedule-hover-popover .sched-cal-day-cell.is-selected {
    border-color: #fff !important;
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .schedule-hover-popover .sched-cal-day-cell.is-work.is-selected {
    border-color: #fff !important;
    color: #fff;
}

.schedule-hover-popover .sched-cal-day-cell.other-month {
    cursor: default;
    pointer-events: none;
    opacity: 0.25;
}

.sched-hover-shift-box {
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sched-hover-shift-label-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    min-width: 0;
}

.sched-hover-shift-caption {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    font-weight: 600;
}

.sched-hover-shift-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sched-hover-shift-time {
    font-size: 13px;
    font-weight: 700;
    font-family: var(--mono);
    color: var(--text);
    white-space: nowrap;
}

.sched-hover-shift-time.is-work {
    color: var(--accent);
}

.sched-hover-shift-time.is-off {
    color: var(--muted);
    font-family: var(--sans);
    font-weight: 600;
}

/* Modal System */
.modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10000 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    box-sizing: border-box;
}

.modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(2px);
    z-index: 10001 !important;
}

.modal-dialog {
    position: relative !important;
    z-index: 10002 !important;
    width: 100%;
    margin: auto;
    animation: modalFadeIn .18s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-dialog .card {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(6px);
    }

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

/* ==========================================================================
   Overview Dashboard Styles
   ========================================================================== */
.overview-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-actions-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 12px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow-sm);
}

.quick-actions-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    margin-right: 4px;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: var(--r-sm);
    background: var(--surface);
    border: 1px solid var(--border2);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--trans);
}

.quick-action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--hover);
}

.overview-bound-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--r);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.overview-action-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--r);
    border: 1px solid var(--border);
    background: var(--card);
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
}

.overview-action-banner .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .overview-action-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .overview-action-banner .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

.overview-action-banner.yellow {
    background: var(--status-yellow-bg);
    border-color: var(--status-yellow-border);
    color: var(--status-yellow-text);
}

.overview-action-banner.red {
    background: var(--status-red-bg);
    border-color: var(--status-red-border);
    color: var(--status-red-text);
}

.overview-action-banner.green {
    background: var(--status-green-bg);
    border-color: var(--status-green-border);
    color: var(--status-green-text);
}

.overview-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(0, 1.25fr);
    gap: 20px;
    align-items: start;
    margin-bottom: 24px;
}

@media (max-width: 1080px) {
    .overview-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .overview-layout>div {
        min-width: 0;
        max-width: 100%;
    }
}

.overview-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.overview-search-input {
    width: 100%;
    padding: 8px 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border2);
    background: var(--card);
    color: var(--text);
    font-size: 13px;
    transition: border-color var(--trans);
}

.overview-search-input:focus {
    border-color: var(--accent);
    outline: none;
}

.overview-courier-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
}

.overview-courier-row:last-child {
    border-bottom: none;
}

.overview-courier-rank {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.overview-courier-rank.rank-1 {
    background: rgba(234, 179, 8, 0.15);
    color: var(--accent-y);
    border: 1px solid rgba(234, 179, 8, 0.4);
}

.overview-courier-rank.rank-2 {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.overview-courier-rank.rank-3 {
    background: rgba(217, 119, 6, 0.15);
    color: var(--accent-o);
    border: 1px solid rgba(217, 119, 6, 0.4);
}

.overview-courier-rank.rank-other {
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--border2);
}

.overview-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.overview-activity-item:last-child {
    border-bottom: none;
}

.overview-activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-b);
    margin-top: 6px;
    flex-shrink: 0;
}

.overview-sys-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
}

.overview-sys-row:last-child {
    border-bottom: none;
}

.overview-sys-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.overview-sys-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    user-select: none;
}

.overview-sys-icon img,
.overview-sys-icon svg {
    display: block;
    flex-shrink: 0;
}

.overview-sys-icon--tg {
    background: #40B3E0;
}

.overview-sys-icon--max {
    background: #23232a;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .overview-sys-icon--max {
    background: #1c1c22;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.overview-sys-icon--maint {
    background: linear-gradient(135deg, #ff9f0a 0%, #ff5e3a 100%);
}

.overview-sys-icon--report {
    background: linear-gradient(135deg, #007aff 0%, #0056b3 100%);
}

@media (max-width: 768px) {
    .ds-details-bars-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}

/* Minimalist upload week status blocks */
.upload-min-status-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r-sm, 8px);
    padding: 10px 14px 12px;
    margin-bottom: 18px;
}

.upload-min-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.upload-min-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.upload-min-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.upload-min-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.upload-min-nav {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 4px;
}

.upload-min-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 11px;
    line-height: 1;
    border-radius: 4px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease;
    cursor: pointer;
}

.upload-min-nav-btn:hover:not(.is-disabled) {
    background: var(--border);
    color: var(--text);
}

.upload-min-nav-btn.is-disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.upload-min-badge-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.upload-min-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid transparent;
}

.upload-min-badge.badge-green {
    background: var(--status-green-bg);
    color: var(--status-green-text);
    border-color: var(--status-green-border);
}

.upload-min-badge.badge-blue {
    background: var(--status-blue-bg);
    color: var(--status-blue-text);
    border-color: var(--status-blue-border);
}

.upload-min-badge.badge-red {
    background: var(--status-red-bg);
    color: var(--status-red-text);
    border-color: var(--status-red-border);
}

.upload-min-grid {
    display: grid;
    gap: 8px;
}

.upload-min-grid-7 {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.upload-min-cell {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 54px;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
    user-select: none;
}

.upload-min-cell:hover {
    border-color: var(--border2);
}

.upload-min-cell.is-uploaded {
    background: var(--status-green-bg);
    border-color: var(--status-green-border);
}

.upload-min-cell.is-missing {
    background: var(--status-red-bg);
    border-color: var(--status-red-border);
}

.upload-min-cell.is-waiting {
    background: rgba(59, 130, 246, 0.04);
    border-color: rgba(59, 130, 246, 0.22);
}

.upload-min-cell.is-future {
    background: var(--bg);
    border-color: var(--border);
    opacity: 0.7;
    cursor: default;
}

.upload-min-cell.is-today,
.upload-min-cell.is-current {
    border-color: var(--accent-b) !important;
}

.upload-min-cell.is-selected {
    outline: 2px solid var(--accent-b);
    outline-offset: -1px;
}

.upload-min-cell-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 2px;
}

.upload-min-cell-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.upload-min-cell-date {
    font-size: 10.5px;
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
}

.upload-min-cell-subdate {
    font-size: 10px;
    font-weight: 500;
    color: var(--muted);
    line-height: 1;
    margin-bottom: 3px;
}

.upload-min-tag-today,
.upload-min-tag-current {
    font-size: 9px;
    font-weight: 700;
    background: var(--accent-b);
    color: #fff;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.upload-min-cell-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-top: 3px;
}

.upload-min-cell-status {
    font-size: 10.5px;
    font-weight: 600;
    white-space: nowrap;
}

.upload-min-cell.is-uploaded .upload-min-cell-status {
    color: var(--status-green-text);
}

.upload-min-cell.is-missing .upload-min-cell-status {
    color: var(--status-red-text);
}

.upload-min-cell.is-waiting .upload-min-cell-status {
    color: var(--accent-b, #2563eb);
}

.upload-min-cell.is-future .upload-min-cell-status {
    color: var(--muted);
}

.upload-min-cell-meta {
    font-size: 9.5px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Weekday picker for periodic broadcasts */
.weekday-picker-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 16px 18px;
    margin-bottom: 14px;
}

.weekday-circles-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.weekday-circle-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    user-select: none;
    padding: 0;
}

.weekday-circle-btn:hover {
    background: var(--hover);
    color: var(--text);
}

.weekday-circle-btn.active {
    background: var(--accent);
    color: #ffffff;
    font-weight: 700;
}

.weekday-circle-btn.active:hover {
    background: var(--accent-h);
    color: #ffffff;
}

.weekday-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 4px;
}

.weekday-summary-text {
    font-size: 13.5px;
    color: var(--muted);
    line-height: 1.4;
    flex: 1;
    min-width: 200px;
}

.weekday-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.weekday-link-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s ease;
}

.weekday-link-btn:hover {
    color: var(--accent);
}

@media (max-width: 900px) {
    .upload-min-grid-7 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 550px) {
    .upload-min-grid-7 {
        grid-template-columns: 1fr;
    }

    .upload-min-cell-bottom {
        flex-wrap: wrap;
    }
}

/* Comprehensive Mobile & Overflow Fixes */
.msg-help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px 20px;
    padding-top: 10px;
    border-top: 1px solid rgba(37, 99, 235, 0.18);
}

@media (max-width: 800px) {

    /* Form grids and input constraints */
    .form-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .form-group {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .form-group select,
    .form-group input,
    .form-group textarea,
    .form-group .app-combo,
    .form-group .app-combo-trigger {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* System Info rows: clean mobile stacked layout */
    .info-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
        padding: 10px 0 !important;
    }

    .info-row .k {
        font-size: 12px !important;
        color: var(--muted) !important;
    }

    .info-row .v {
        font-size: 13px !important;
        text-align: left !important;
        width: 100% !important;
        word-break: break-word !important;
    }

    .info-row .v .badge {
        white-space: normal !important;
        max-width: 100% !important;
        height: auto !important;
        padding: 4px 10px !important;
    }

    /* Reports tab card header */
    .report-card-header {
        flex-wrap: wrap !important;
        padding: 12px 14px !important;
        gap: 10px !important;
    }

    .report-card-header>div:first-child {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .report-card-header .actions {
        flex-wrap: wrap !important;
        gap: 6px !important;
        width: 100% !important;
        justify-content: flex-start !important;
    }

    /* Courier rating upload grid */
    .cr-upload-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    /* Courier rating tabs */
    .cr-tabs {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        box-sizing: border-box !important;
    }

    .cr-tabs::-webkit-scrollbar {
        display: none !important;
    }

    .cr-tab-btn {
        flex: 1 0 auto !important;
        padding: 8px 10px !important;
        font-size: 12.5px !important;
        text-align: center !important;
        white-space: nowrap !important;
    }

    /* Courier rating and director filter selects */
    .cr-filter-item,
    .cr-filter-select,
    .cr-filter-item select:not(.app-combo-native),
    .cr-filter-item .app-combo,
    #hist-sector-sel,
    #hist-ds-sel,
    #cr-send-ds-sel,
    #hist-week-sel,
    #cr-send-yw-sel,
    #cr-send-all-yw-sel,
    #hist-type-sel {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .cr-hist-filters {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    /* Messages helper grid */
    .msg-help-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .tg-insert-code {
        display: inline-block !important;
        max-width: 100% !important;
        word-break: break-all !important;
    }

    /* Search input inside card headers */
    .card-header .search-input {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Telegram bubble preview */
    .tg-bubble {
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    /* Tables preservation */
    .table-responsive table,
    .table-wrap table {
        min-width: 600px;
    }

    .table-responsive th,
    .table-wrap th,
    .table-responsive td.mono,
    .table-wrap td.mono {
        white-space: nowrap;
    }
}

/* ===== График МТ: пилюли мобильных товароведов, цвета и поповер запросов дня ===== */

.mt-pills-card {
    margin-bottom: 24px;
}

.mt-pills-meta {
    margin-top: 3px;
    font-size: 12px;
    color: var(--muted);
}

.mt-pills-subtitle {
    margin: 0 0 14px;
    max-width: 900px;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--muted);
}

.mt-pills-count {
    font-size: 12px;
}

.mt-pills-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 40px;
}

.mt-pills-empty {
    font-size: 13px;
    color: var(--muted);
}

.mt-pill {
    --mt-pill-bg: #f1f5f9;
    --mt-pill-text: rgb(77, 82, 92);
    --mt-pill-border: #cbd5e1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 7px 12px;
    border: 1px solid var(--mt-pill-border);
    border-radius: 999px;
    background: var(--mt-pill-bg);
    color: var(--mt-pill-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    cursor: grab;
    user-select: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}

.mt-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, .18);
}

.mt-pill:active {
    cursor: grabbing;
}

.mt-pill.is-dragging {
    opacity: .45;
}

.mt-pill-label {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mt-pill-tag {
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .06);
    color: inherit;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.mt-pill.is-inactive {
    background: var(--status-neutral-bg);
    color: var(--status-neutral-text);
    border-color: var(--status-neutral-border);
    cursor: not-allowed;
    opacity: .55;
}

.mt-pill.mt-pill-reject {
    background: var(--status-red-bg);
    color: var(--status-red-text);
    border-color: var(--status-red-border);
}

.mt-pill.mt-pill-cancel {
    background: var(--status-neutral-bg);
    color: var(--status-neutral-text);
    border-color: var(--status-neutral-border);
}

.mt-pills-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 12px;
    font-size: 11.5px;
    color: var(--muted);
}

.mt-pills-legend-sep {
    opacity: .55;
}

.mt-pill-legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    vertical-align: -1px;
}

/* Цвет сотрудника в календаре: мягкие цвета как у ролей */
.mt-chip.has-emp-color,
.mt-overflow-pop .mt-chip.has-emp-color {
    background: var(--mt-emp-bg, rgba(107, 114, 128, .12));
    border-color: var(--mt-emp-border, rgba(107, 114, 128, .38));
    color: var(--mt-emp-text, rgb(77, 82, 92));
    box-shadow: none;
}

/* Подсветка слота при перетаскивании пилюли */
.mt-chip.mt-drop-ok {
    outline: 2px solid var(--accent-g, #16a34a);
    outline-offset: 1px;
}

.mt-chip.mt-drop-bad {
    outline: 2px solid var(--status-red-text, #ef4444);
    outline-offset: 1px;
}

.mt-cal-cell.mt-drop-cell-ok {
    border-color: var(--accent-g, #16a34a);
    background: rgba(22, 163, 74, .06);
}

.mt-cal-cell.mt-drop-cell-bad {
    border-color: var(--status-red-text, #ef4444);
    background: rgba(239, 68, 68, .06);
}

/* Колорпикер в разделе «Сотрудники» (как в ролях) */
.mt-color-cell {
    display: flex;
    align-items: center;
}

.mt-color-input {
    width: 34px;
    height: 34px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--card);
    cursor: pointer;
    overflow: hidden;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.mt-color-input:hover {
    border-color: var(--border2);
    box-shadow: 0 0 0 2px var(--hover);
}

.mt-color-input:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent);
}

.mt-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.mt-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

.mt-color-input::-moz-color-swatch {
    border: none;
    border-radius: 50%;
}

/* Поповер со всеми запросами дня (рисуется поверх календаря) */
.mt-overflow-pop {
    position: fixed;
    z-index: 1950;
    display: none;
    width: 300px;
    max-width: calc(100vw - 16px);
    max-height: 70vh;
    overflow: auto;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    color: var(--text);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .28);
    overscroll-behavior: contain;
}

.mt-overflow-pop.open {
    display: block;
}

.mt-overflow-head {
    margin-bottom: 8px;
}

.mt-overflow-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
}

.mt-overflow-sub {
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--muted);
}

.mt-overflow-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mt-overflow-pop .mt-pop-chip {
    width: 100%;
    padding: 7px 9px;
    font-size: 11.5px;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    cursor: pointer;
}

.mt-overflow-pop .mt-pop-chip.is-draggable {
    cursor: grab;
}

.mt-overflow-pop .mt-pop-chip.is-draggable:active {
    cursor: grabbing;
}

.mt-overflow-hint {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    font-size: 11px;
    color: var(--muted);
}

/* Перетаскиваемый «призрак» пилюли */
.mt-pill-drag-ghost {
    position: fixed;
    top: -9999px;
    left: -9999px;
    z-index: 999999;
    padding: 7px 14px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 999px;
    background: #6b7280;
    color: #ffffff;
    font-family: var(--sans, system-ui, sans-serif);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
}

.mt-pill-drag-ghost.is-reject {
    background: var(--status-red-bg);
    color: var(--status-red-text);
    border-color: var(--status-red-border);
}

.mt-pill-drag-ghost.is-cancel {
    background: var(--status-neutral-bg);
    color: var(--status-neutral-text);
    border-color: var(--status-neutral-border);
}

@media (max-width: 640px) {
    .mt-pill-label {
        max-width: 150px;
    }

    .mt-overflow-pop {
        width: 260px;
    }
}

/* Заголовок перехода от недели к деталям запросов в дневнике МТ */
.mt-details-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0 14px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}

.mt-details-heading::before {
    content: '';
    flex-shrink: 0;
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--accent);
}

.mt-details-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
