/* online5 — палитра rt.plus, mobile-first
   brand red #ee1c24, accent green #84bc30, sans: Arial/Helvetica/Tahoma */

:root {
    --rt-red: #ee1c24;
    --rt-red-dark: #c4151c;
    --rt-green: #84bc30;
    --rt-green-dark: #598527;
    --rt-text: #161616;
    --rt-muted: #555555;
    --rt-grey: #818181;
    --rt-border: #dcdcdc;
    --rt-bg: #f7f7f7;
    --rt-surface: #ffffff;
    --rt-error: #9d132a;
    --rt-error-bg: #fde8e8;
    --rt-ok: #598527;
    --rt-ok-bg: #eef6e3;
    --rt-font: Arial, Helvetica, Tahoma, sans-serif;
    --rt-hero-fallback: #9eb8c9;
    --rt-shadow: rgba(22, 22, 22, 0.1);
    --rt-login-box-bg: rgba(255, 255, 255, 0.97);
}

html[data-theme="dark"] {
    --rt-text: #f0f0f0;
    --rt-muted: #a6a6a6;
    --rt-grey: #8c8c8c;
    --rt-border: #333333;
    --rt-bg: #0f0f10;
    --rt-surface: #1a1a1c;
    --rt-error: #ff6b7a;
    --rt-error-bg: #3a1518;
    --rt-ok: #9fd24a;
    --rt-ok-bg: #1c2a12;
    --rt-green-dark: #a4d45a;
    --rt-hero-fallback: #0a0a0c;
    --rt-shadow: rgba(0, 0, 0, 0.45);
    --rt-login-box-bg: rgba(26, 26, 28, 0.94);
    color-scheme: dark;
}

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

body {
    margin: 0;
    font-family: var(--rt-font);
    font-size: 16px;
    line-height: 1.45;
    color: var(--rt-text);
    background: var(--rt-bg);
}

a {
    color: var(--rt-green);
}

a:hover {
    color: var(--rt-green-dark);
}

.page-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: var(--rt-bg);
}

.login-stage {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    width: 100%;
    max-width: 22rem;
    padding: 1.5rem 1.25rem;
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-top: 3px solid var(--rt-red);
}

.login-box .brand-logo {
    display: block;
    margin: 0 0 0.85rem;
}

.login-box .brand-logo-img,
.register-box .brand-logo-img {
    height: 2.25rem;
    width: auto;
    max-width: 11rem;
}

.register-box .brand-logo {
    display: block;
    margin: 0 0 0.75rem;
}

.login-box h1.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.brand-logo-img {
    display: block;
    height: 2rem;
    width: auto;
    max-width: 10rem;
    object-fit: contain;
}

.brand-logo-img.brand-logo-agency {
    height: auto;
    max-height: 3.5rem;
    max-width: 12rem;
}

.brand-logo-dark {
    display: none;
}

html[data-theme="dark"] .brand-logo-light {
    display: none;
}

html[data-theme="dark"] .brand-logo-dark {
    display: block;
}

.brand-logo-agency {
    display: block;
    max-height: 3.5rem;
    max-width: 12rem;
    width: auto;
    height: auto;
    object-fit: contain;
}

.agent-brand .brand-logo-agency {
    height: auto;
    max-height: 3.5rem;
    max-width: 12rem;
}

/* Переключатель темы */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--rt-border);
    background: var(--rt-surface);
    color: var(--rt-text);
    font-family: var(--rt-font);
    font-size: 0.85rem;
    cursor: pointer;
    line-height: 1;
}

.theme-toggle:hover {
    border-color: var(--rt-green);
    color: var(--rt-green-dark);
}

.theme-toggle-ico {
    display: inline-flex;
    width: 1.1rem;
    height: 1.1rem;
}

.theme-toggle-ico-sun {
    display: none;
}

html[data-theme="dark"] .theme-toggle-ico-moon {
    display: none;
}

html[data-theme="dark"] .theme-toggle-ico-sun {
    display: inline-flex;
}

.theme-toggle--float {
    position: fixed;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 60;
    box-shadow: 0 4px 16px var(--rt-shadow);
}

.theme-toggle--bar {
    padding: 0.35rem;
    border: none;
    background: transparent;
    box-shadow: none;
}

.theme-toggle--bar:hover {
    border: none;
    color: var(--rt-green-dark);
    background: transparent;
}

.theme-toggle--bar .theme-toggle-label {
    display: none;
}

.theme-toggle--sidebar {
    width: 100%;
    justify-content: flex-start;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .theme-toggle--float .theme-toggle-label {
        display: none;
    }
}

.login-box h1 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--rt-text);
}

.login-lead {
    margin: 0 0 1rem;
    color: var(--rt-muted);
    font-size: 0.95rem;
}

.login-note {
    margin: 0;
    font-size: 0.85rem;
    color: var(--rt-grey);
}

.login-error {
    margin: 0 0 1rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.9rem;
    color: var(--rt-error);
    background: var(--rt-error-bg);
    border: 1px solid #f0c0c0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.login-label {
    font-size: 0.85rem;
    color: var(--rt-muted);
}

.login-input {
    width: 100%;
    margin-bottom: 0.65rem;
    padding: 0.55rem 0.65rem;
    font-family: var(--rt-font);
    font-size: 1rem;
    color: var(--rt-text);
    border: 1px solid var(--rt-border);
    border-radius: 0;
    background: var(--rt-surface);
}

select.login-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.5rem;
    background-color: var(--rt-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555555' d='M1.1 1.1L6 6l4.9-4.9L12 2.2 6 8.2 0 2.2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.75rem auto;
    cursor: pointer;
}

select.login-input::-ms-expand {
    display: none;
}

html[data-theme="dark"] select.login-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23bbbbbb' d='M1.1 1.1L6 6l4.9-4.9L12 2.2 6 8.2 0 2.2z'/%3E%3C/svg%3E");
}

.login-input:focus {
    outline: none;
    border-color: var(--rt-red);
}

.login-btn {
    margin-top: 0.35rem;
    padding: 0.65rem 1rem;
    font-family: var(--rt-font);
    font-size: 1rem;
    color: #fff;
    background: var(--rt-red);
    border: none;
    cursor: pointer;
}

.login-btn:hover {
    background: var(--rt-red-dark);
}

.login-btn:active {
    background: #9d132a;
}

.login-footer {
    margin: 1rem 0 0;
    font-size: 0.9rem;
}

.login-link {
    color: var(--rt-green);
}

.login-link:hover {
    color: var(--rt-green-dark);
}

.login-success {
    margin: 0 0 1rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.95rem;
    color: var(--rt-ok);
    background: var(--rt-ok-bg);
    border: 1px solid #b6da7f;
}

.page-home,
.layout-admin {
    min-height: 100vh;
    background: var(--rt-bg);
    font-family: var(--rt-font);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    background: var(--rt-surface);
    border-bottom: 1px solid var(--rt-border);
    border-top: 3px solid var(--rt-red);
}

.topbar strong {
    color: var(--rt-text);
}

.topbar-link {
    color: var(--rt-green);
    font-size: 0.95rem;
    text-decoration: none;
}

.topbar-link:hover {
    color: var(--rt-green-dark);
    text-decoration: underline;
}

.home-box {
    max-width: 40rem;
    margin: 0 auto;
    padding: 1.25rem;
}

.home-box h1 {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
    color: var(--rt-text);
}

@media (min-width: 768px) {
    .login-box {
        padding: 2rem 1.75rem;
    }
}

/* Регистрация */
.page-register {
    min-height: 100vh;
    padding: 1rem;
    background: var(--rt-bg);
    overflow-x: hidden;
}

.register-stage {
    width: 100%;
}

.register-box {
    width: 100%;
    max-width: 40rem;
    margin: 0 auto;
    padding: 1.25rem 1rem;
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-top: 3px solid var(--rt-red);
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Фон входа / регистрации / восстановления — desktop: фото, форма по центру левой половины */
@media (min-width: 900px) {
    .page-hero {
        padding: 0;
        display: flex;
        justify-content: flex-start;
        align-items: stretch;
        overflow-x: hidden;
        background-color: var(--rt-hero-fallback);
        background-image: url("/assets/img/background_login.jpg");
        background-repeat: no-repeat;
        background-position: left center;
        background-size: cover;
        background-attachment: fixed;
    }

    .page-register.page-hero {
        background-color: var(--rt-hero-fallback);
        background-image: url("/assets/img/background_login.jpg");
        background-repeat: no-repeat;
        background-position: left center;
        background-size: cover;
        background-attachment: fixed;
    }

    html[data-theme="dark"] .page-hero,
    html[data-theme="dark"] .page-register.page-hero {
        background-color: #0a0a0c;
        background-image: url("/assets/img/background_login_black.jpg");
    }

    .page-hero .login-stage,
    .page-hero .register-stage {
        width: 50%;
        max-width: 50%;
        min-height: 100vh;
        margin: 0;
        padding: 2.5rem 1.5rem;
        box-sizing: border-box;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .page-hero .register-stage {
        align-items: flex-start;
        padding-top: 2rem;
        padding-bottom: 2.5rem;
    }

    .page-hero .login-box,
    .page-hero .register-box {
        margin: 0;
        width: 100%;
        max-width: 22rem;
        background: var(--rt-login-box-bg);
        border-color: var(--rt-border);
        box-shadow: 0 8px 32px var(--rt-shadow);
    }

    .page-hero .register-box {
        max-width: 36rem;
    }
}

.register-box h1 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
}

.register-form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.reg-fieldset {
    margin: 1.5rem 0 0;
    padding: 0;
    border: none;
}

.reg-fieldset:first-of-type {
    margin-top: 1rem;
}

.reg-fieldset legend {
    display: block;
    float: none;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 0.85rem;
    padding: 0.4rem 0 0.5rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.2;
    color: var(--rt-green-dark);
    background: linear-gradient(90deg, var(--rt-ok-bg) 0%, transparent 100%);
    border: none;
    border-left: 3px solid var(--rt-green);
}

html[data-theme="dark"] .reg-fieldset legend {
    color: #d4ef9a;
    background: linear-gradient(90deg, rgba(132, 188, 48, 0.28) 0%, transparent 100%);
    border-left-color: var(--rt-green);
}

.reg-fieldset::after {
    content: none;
}

.captcha-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
    margin: 0.25rem 0 0.5rem;
    max-width: 100%;
    min-width: 0;
    clear: both;
}

.captcha-img {
    display: block;
    flex: 0 0 auto;
    width: 8rem;
    height: 2.75rem;
    max-width: 8rem;
    min-width: 6rem;
    object-fit: contain;
    border: 1px solid var(--rt-border);
    background: #fff;
}

.captcha-input {
    flex: 1 1 auto;
    min-width: 4rem;
    max-width: 8rem;
    width: auto;
    margin-bottom: 0 !important;
}

.captcha-reload {
    width: 2.75rem;
    min-width: 2.75rem;
    max-width: 2.75rem;
    height: 2.75rem;
    margin-top: 0;
    padding: 0;
    font-size: 1.25rem;
    line-height: 2.75rem;
    flex: 0 0 auto;
}

@media (min-width: 480px) {
    .captcha-img {
        width: 10rem;
        max-width: 10rem;
        height: 2.75rem;
    }

    .captcha-input {
        max-width: 7rem;
    }
}

.reg-fieldset-captcha {
    margin-top: 1rem;
    max-width: 100%;
    min-width: 0;
}

.reg-fieldset-captcha legend {
    margin-bottom: 0.65rem;
}

#captchaHint {
    margin: 0 0 0.5rem;
    min-height: 0;
    color: #9d132a;
}

.inn-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.inn-row .inn-input {
    flex: 1 1 10rem;
    margin-bottom: 0;
    min-width: 0;
}

.inn-find {
    margin-top: 0;
    width: auto;
    flex: 0 0 auto;
    padding: 0.55rem 1rem;
    white-space: nowrap;
}

#innHint,
#bikHint {
    margin: -0.35rem 0 0.75rem;
}

.addr-block {
    margin: 1rem 0 0.5rem;
    padding: 0.75rem 0 0;
    border-top: 1px dashed var(--rt-border);
}

.addr-block-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.addr-block-title {
    font-size: 0.95rem;
    color: var(--rt-text);
}

.addr-same-label {
    margin: 0;
    font-size: 0.85rem;
}

.addr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.65rem;
}

.addr-cell .login-input {
    margin-bottom: 0.35rem;
}

.addr-cell-index {
    grid-column: 1 / 2;
}

.addr-cell-region,
.addr-cell-city,
.addr-cell-street {
    grid-column: 1 / -1;
}

.addr-cell-house,
.addr-cell-block,
.addr-cell-flat {
    grid-column: auto;
}

.addr-input-sm {
    max-width: 100%;
}

@media (min-width: 640px) {
    .addr-grid {
        grid-template-columns: 6rem 1fr 1fr 1fr;
    }
    .addr-cell-index {
        grid-column: 1;
    }
    .addr-cell-region {
        grid-column: 2 / -1;
    }
    .addr-cell-city,
    .addr-cell-street {
        grid-column: 1 / -1;
    }
}

textarea.login-input {
    min-height: 3rem;
    resize: vertical;
    font-family: var(--rt-font);
}

.topbar-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.admin-box {
    max-width: 56rem;
    margin: 0 auto;
    padding: 1.25rem;
}

.admin-box h1 {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
}

.admin-sub {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.1rem;
}

.admin-filters {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--rt-border);
}

.admin-check,
.rt-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.35rem 0;
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
}

.admin-check input[type="checkbox"],
.rt-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-sizing: border-box;
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    flex: 0 0 auto;
    border: 1.5px solid var(--rt-border);
    border-radius: 0;
    background: var(--rt-surface);
    cursor: pointer;
    position: relative;
    vertical-align: middle;
}

.admin-check input[type="checkbox"]:focus,
.rt-check input[type="checkbox"]:focus {
    outline: none;
    border-color: var(--rt-red);
}

.admin-check input[type="checkbox"]:checked,
.rt-check input[type="checkbox"]:checked {
    background: var(--rt-green);
    border-color: var(--rt-green);
}

.admin-check input[type="checkbox"]:checked::after,
.rt-check input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 0.32rem;
    top: 0.08rem;
    width: 0.28rem;
    height: 0.55rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

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

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

.admin-table th,
.admin-table td {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid var(--rt-border);
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    font-weight: 700;
    color: var(--rt-text);
}

.admin-table tr.is-pending td {
    background: #fff8e8;
}

.admin-table tr.is-dropped td {
    opacity: 0.55;
}

.agent-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.agent-card {
    margin: 0;
    border: 1px solid var(--rt-border);
    border-left: 3px solid var(--rt-green);
    background: var(--rt-surface);
}

.agent-card.is-pending {
    border-left-color: #d4a017;
    background: #fff8e8;
}

.agent-card.is-dropped {
    opacity: 0.55;
    border-left-color: var(--rt-grey);
}

.agent-card-link {
    display: block;
    padding: 0.75rem 0.85rem;
    color: inherit;
    text-decoration: none;
}

.agent-card-link:hover {
    background: #fafafa;
    color: inherit;
}

html[data-theme="dark"] .agent-card-link:hover {
    background: #2a2a2c;
    color: inherit;
}

html[data-theme="dark"] .agent-card.is-pending {
    background: #2a2418;
}

.agent-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
}

.agent-card-id {
    font-weight: 700;
    color: var(--rt-text);
}

.agent-card-login {
    color: var(--rt-green-dark);
    font-size: 0.95rem;
}

.agent-card-name {
    font-size: 0.95rem;
    line-height: 1.35;
    word-break: break-word;
}

.agent-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--rt-muted);
}

.muted {
    color: #666;
    font-size: 0.85rem;
}

.badge-ok,
.badge-warn {
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.1rem 0.35rem;
}

.badge-ok {
    color: var(--rt-ok);
    background: var(--rt-ok-bg);
}

.badge-warn {
    color: #a35b00;
    background: #fff0d6;
}

html[data-theme="dark"] .badge-warn {
    color: #e8c86a;
    background: #2a2412;
}

.admin-form {
    margin-top: 0.5rem;
}

.dash-lead {
    margin: 0.35rem 0 0;
    font-size: 0.95rem;
    color: var(--rt-muted);
}

.admin-page .admin-filters {
    margin-bottom: 1.25rem;
    max-width: 28rem;
}

.admin-page .login-btn {
    width: auto;
    min-width: 8rem;
}

.admin-list-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem 1rem;
}

.admin-export-btn {
    text-decoration: none;
    text-align: center;
    display: inline-block;
    padding: 0.55rem 1rem;
}

.admin-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1.25rem;
    margin: 1.25rem 0 0.5rem;
}

.admin-pager-link {
    color: var(--rt-green);
    text-decoration: none;
    font-weight: 600;
}

.admin-pager-link:hover {
    text-decoration: underline;
}

.admin-pager-link.is-disabled {
    color: var(--rt-muted);
    font-weight: 500;
    pointer-events: none;
}

.admin-pager-info {
    font-size: 0.9rem;
    color: var(--rt-muted);
    font-variant-numeric: tabular-nums;
}

.dash-kpi--agencies .dash-kpi-stack,
.dash-kpi .dash-kpi-stack {
    margin-top: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dash-kpi-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
}

.dash-kpi-line:hover .dash-kpi-line-value {
    color: var(--rt-green);
}

/* Три стиля плашек: заголовок / подпись / цифры */
.dash-kpi-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--rt-muted);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.3;
}

.dash-kpi-line-label,
.dash-rate-code {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--rt-muted);
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.3;
}

.dash-kpi-line-value,
.dash-kpi-value,
.dash-kpi-rates {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rt-text);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.dash-kpi-line-value {
    text-align: right;
    min-width: 2.5ch;
    flex: 0 0 auto;
}

.dash-kpi-line--primary .dash-kpi-line-label {
    color: var(--rt-text);
}

.dash-kpi--open .dash-kpi-stack,
.dash-kpi--month .dash-kpi-stack,
.dash-kpi--agencies .dash-kpi-stack {
    margin-top: 0.35rem;
}

.admin-branding {
    margin-top: 2rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--rt-border);
}

.admin-branding .branding-head {
    margin-bottom: 0.75rem;
}

.admin-branding .branding-item-title {
    font-size: 1rem;
}

.admin-actions {
    margin-top: 1.25rem;
}

.admin-danger {
    color: var(--rt-red) !important;
}

.admin-menu {
    margin: 1rem 0 0;
    padding-left: 1.25rem;
    line-height: 1.7;
}

.admin-managers {
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.6;
}

.agent-staff-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 0.85rem 0 1.25rem;
}

.agent-staff-card {
    border-left-color: var(--rt-green);
}

.agent-staff-card--new {
    border-left-color: var(--rt-red);
    margin-bottom: 1rem;
}

.agent-staff-card .staff-card-title {
    font-size: 1rem;
}

.agent-staff-form {
    margin-top: 0.65rem;
}

.agent-staff-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 1rem;
    margin: 0 0 0.75rem;
}

.agent-staff-grid .users-field {
    max-width: none;
    width: 100%;
    margin: 0;
    grid-template-columns: 1fr;
}

.agent-staff-grid .users-field .login-label {
    margin: 0 0 0.25rem;
}

.agent-staff-field--full {
    grid-column: 1 / -1;
}

.agent-staff-flags {
    margin-bottom: 0.85rem;
}

.agent-staff-perms-title {
    margin: 0.35rem 0 0.45rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--rt-muted);
}

.agent-staff-grid--avia {
    margin-bottom: 0.75rem;
}

.agent-staff-actions {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--rt-border);
}

.agent-staff-actions .login-btn {
    margin-top: 0;
}

@media (max-width: 700px) {
    .agent-staff-grid {
        grid-template-columns: 1fr;
    }
}

.cabinet-enter {
    margin: 0 0 1.25rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--rt-border);
    border-left: 3px solid var(--rt-green);
    background: #f7faf2;
}

html[data-theme="dark"] .cabinet-enter {
    background: #1c2418;
    color: var(--rt-text);
}

.cabinet-creds {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0.75rem 0;
}

.cabinet-creds div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    align-items: baseline;
}

.cabinet-creds dt {
    margin: 0;
    font-size: 0.85rem;
    color: var(--rt-muted);
    min-width: 4.5rem;
}

.cabinet-creds dd {
    margin: 0;
}

.cabinet-creds code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.95rem;
    word-break: break-all;
}

.cabinet-enter-form .login-input {
    max-width: 24rem;
}

.cabinet-enter-form .login-btn {
    width: auto;
    margin-top: 0.5rem;
}

/* —— Кабинет агента: сайдбар + mobile —— */
.layout-agent {
    min-height: 100vh;
    background: var(--rt-bg);
    font-family: var(--rt-font);
}

body.agent-nav-lock {
    overflow: hidden;
}

.agent-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(22, 22, 22, 0.4);
    backdrop-filter: blur(1px);
}

.agent-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.agent-sidebar {
    --sidebar-pad-x: 0.9rem;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: min(220px, 90vw);
    height: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--rt-text);
    background:
        linear-gradient(165deg, rgba(238, 28, 36, 0.06) 0%, transparent 28%),
        linear-gradient(195deg, rgba(132, 188, 48, 0.08) 0%, transparent 36%),
        var(--rt-bg);
    border-right: 1px solid var(--rt-border);
    box-shadow: 8px 0 28px var(--rt-shadow);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
}

.agent-sidebar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--rt-red) 0%, var(--rt-green) 100%);
    pointer-events: none;
}

.agent-shell.is-nav-open .agent-sidebar {
    transform: translateX(0);
}

.agent-sidebar-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem var(--sidebar-pad-x) 0.85rem;
    flex: 0 0 auto;
}

.agent-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.agent-brand .brand-logo-img:not(.brand-logo-agency) {
    height: 1.85rem;
    max-width: 8.5rem;
}

.agent-brand .brand-logo-img.brand-logo-agency {
    height: auto;
    width: auto;
    max-height: 3.5rem;
    max-width: 12rem;
    object-fit: contain;
}

.agent-brand-mark {
    flex: 0 0 auto;
    width: 0.55rem;
    height: 1.85rem;
    background: var(--rt-red);
}

.agent-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.agent-brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--rt-text);
}

.agent-brand-sub {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--rt-muted);
}

.agent-sidebar-close {
    position: absolute;
    top: 0.75rem;
    right: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    margin-top: -0.1rem;
    padding: 0;
    border: 1px solid var(--rt-border);
    background: var(--rt-surface);
    color: var(--rt-muted);
    cursor: pointer;
}

.agent-sidebar-close:hover {
    color: var(--rt-text);
    border-color: var(--rt-grey);
}

.agent-identity {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    flex: 0 0 auto;
}

.agent-avatar {
    flex: 0 0 auto;
    width: 2.4rem;
    height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: var(--rt-green);
    line-height: 1;
}

.agent-identity-body {
    min-width: 0;
    flex: 1;
}

.agent-identity-name {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--rt-text);
    word-break: break-word;
}

.agent-identity-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
    margin-top: 0.3rem;
}

.agent-identity-user {
    font-size: 0.8rem;
    color: var(--rt-muted);
    word-break: break-word;
}

.agent-role {
    display: inline-block;
    padding: 0.12rem 0.4rem;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--rt-green-dark);
    background: var(--rt-ok-bg);
    border: 1px solid #cfe6a8;
}

.agent-identity-id {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: var(--rt-grey);
    font-variant-numeric: tabular-nums;
}

.agent-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.85rem var(--sidebar-pad-x) 1.25rem calc(var(--sidebar-pad-x) + 0.15rem);
    overflow-y: auto;
    flex: 1 1 auto;
}

.agent-nav-label {
    margin: 0.55rem 0 0.3rem 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rt-grey);
}

.agent-nav-label-soon {
    margin-top: 1rem;
}

.agent-nav-link,
.agent-nav-soon,
.agent-nav-logout {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 2.55rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--rt-text);
    font-size: 0.92rem;
    line-height: 1.2;
}

.agent-nav-ico {
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--rt-muted);
}

.agent-nav-txt {
    flex: 1 1 auto;
    min-width: 0;
}

.agent-nav-link:hover {
    background: var(--rt-surface);
    border-color: var(--rt-border);
}

.agent-nav-link:hover .agent-nav-ico {
    color: var(--rt-green-dark);
}

.agent-nav-link.is-active {
    background: var(--rt-surface);
    border-color: #d7e8b8;
    box-shadow: inset 3px 0 0 var(--rt-green);
    font-weight: 700;
}

html[data-theme="dark"] .agent-nav-link.is-active {
    border-color: #3a4a28;
}

.agent-nav-link.is-active .agent-nav-ico {
    color: var(--rt-green-dark);
}

.agent-nav-soon {
    color: var(--rt-grey);
    cursor: default;
    opacity: 0.72;
}

.agent-nav-badge {
    flex: 0 0 auto;
    padding: 0.1rem 0.35rem;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--rt-muted);
    background: var(--rt-bg);
    border: 1px solid var(--rt-border);
}

.agent-sidebar-foot {
    display: none;
    flex: 0 0 auto;
    padding: 0.45rem var(--sidebar-pad-x) 0.75rem;
    border-top: 1px solid var(--rt-border);
}

.agent-nav-collapse {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
    width: 100%;
    height: 2.1rem;
    margin: 0;
    padding: 0 0.55rem;
    color: var(--rt-muted);
    background: transparent;
    border: 1px solid var(--rt-border);
    cursor: pointer;
    box-sizing: border-box;
}

.agent-nav-collapse:hover {
    color: var(--rt-text);
    border-color: var(--rt-green);
}

.agent-nav-collapse-ico {
    display: block;
    flex: 0 0 auto;
    transition: transform 0.18s ease;
}

.agent-nav-collapse.is-collapsed .agent-nav-collapse-ico {
    transform: rotate(180deg);
}

.agent-nav-collapse-txt {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--rt-font);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-nav-logout {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 2.55rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--rt-red);
    font-size: 0.92rem;
}

.agent-nav-logout .agent-nav-ico {
    color: var(--rt-red);
}

.agent-nav-logout:hover {
    background: var(--rt-error-bg);
    border-color: var(--rt-red);
}

.agent-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.agent-topbar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.85rem;
    background: var(--rt-surface);
    border-bottom: 1px solid var(--rt-border);
    border-top: 3px solid var(--rt-red);
    position: sticky;
    top: 0;
    z-index: 30;
}

.agent-topbar-who {
    flex: 1;
    min-width: 0;
}

.agent-topbar-agency {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--rt-text);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-topbar-userline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.55rem;
    margin-top: 0.1rem;
    min-width: 0;
}

.agent-topbar-user {
    font-size: 0.82rem;
    color: var(--rt-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.agent-topbar-role {
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: var(--rt-green-dark);
    white-space: nowrap;
}

.agent-identity-dogovor,
.agent-identity-status {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: var(--rt-muted);
}

.agent-identity-status--ok {
    color: var(--rt-ok);
}

.agent-identity-status--warn {
    color: #7a5a00;
}

html[data-theme="dark"] .agent-identity-status--warn {
    color: #e8c86a;
}

.agent-topbar-status {
    display: none;
}

.agent-status-chip {
    display: none;
}

.agent-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex: 0 0 auto;
    margin-left: auto;
}

.agent-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--rt-text);
    text-decoration: none;
    cursor: pointer;
}

.agent-icon-btn:hover {
    color: var(--rt-green-dark);
}

.agent-profile {
    position: relative;
}

.agent-profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: var(--rt-green);
    line-height: 1;
}

.agent-profile-pop {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 45;
    width: min(18.5rem, calc(100vw - 1.5rem));
    padding: 0.9rem;
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    box-shadow: 0 10px 28px var(--rt-shadow);
}

.agent-profile-pop .agent-identity {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--rt-border);
}

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

.agent-profile-link {
    display: block;
    padding: 0.55rem 0.15rem;
    color: var(--rt-text);
    text-decoration: none;
    font-size: 0.92rem;
}

button.agent-profile-link {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    font: inherit;
    font-size: 0.92rem;
    cursor: pointer;
}

.agent-profile-link:hover {
    color: var(--rt-green-dark);
}

.agent-profile-link--out {
    color: var(--rt-red);
}

.agent-profile-link--out:hover {
    color: var(--rt-red-dark);
}

.agent-menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.28rem;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0.5rem;
    border: 1px solid var(--rt-border);
    background: var(--rt-surface);
    cursor: pointer;
}

.agent-menu-toggle span {
    display: block;
    height: 2px;
    background: var(--rt-text);
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.agent-shell.is-nav-open .agent-menu-toggle span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

.agent-shell.is-nav-open .agent-menu-toggle span:nth-child(2) {
    opacity: 0;
}

.agent-shell.is-nav-open .agent-menu-toggle span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

.agent-topbar-logout {
    color: var(--rt-muted);
}

.agent-topbar-logout:hover {
    color: var(--rt-red);
}

.agent-content {
    flex: 1;
    padding: 1rem;
    max-width: 72rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.layout-agent--dash .agent-content {
    max-width: 72rem;
}

.layout-agent--wide .agent-content {
    max-width: none;
}

.dash-title {
    margin: 0;
    font-size: 1.4rem;
    color: var(--rt-text);
}

.dash-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1.15rem;
}

.dash-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.dash-kpi {
    padding: 0.85rem 0.9rem;
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-top: 3px solid var(--rt-green);
}

.dash-kpi.is-warn {
    border-top-color: var(--rt-red);
}

.dash-kpi--rates {
    border-top-color: var(--rt-red);
}

.dash-kpi-rates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.15rem;
    margin-top: 0.35rem;
    justify-content: flex-end;
}

.dash-rate-code {
    margin-right: 0.2rem;
}

.dash-kpi-value {
    margin-top: 0.25rem;
    word-break: break-word;
    text-align: right;
}

.dash-kpi-note {
    margin: 0.45rem 0 0;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--rt-muted);
    text-transform: none;
    letter-spacing: 0;
}

.dash-kpi--month.is-up {
    border-top-color: var(--rt-green);
}

.dash-kpi--month.is-down {
    border-top-color: #c47a2c;
}

.dash-charts {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.dash-panels {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.dash-card {
    padding: 1rem;
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-top: 3px solid var(--rt-green);
}

.dash-card-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.dash-card-note {
    margin: 0 0 0.85rem;
    font-size: 0.85rem;
    color: var(--rt-muted);
}

.dash-period {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin: 0 0 0.85rem;
}

.dash-period.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.dash-period-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    border: 1px solid var(--rt-border);
    background: var(--rt-surface);
    color: var(--rt-text);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.dash-period-btn:hover:not(:disabled) {
    border-color: var(--rt-green);
    color: var(--rt-green-dark);
}

.dash-period-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.dash-period-label {
    min-width: 11rem;
    text-align: center;
    font-size: 0.95rem;
    color: var(--rt-text);
    font-variant-numeric: tabular-nums;
}

.dash-cost-empty {
    margin-top: 0.5rem;
}

.dash-chart {
    min-height: 220px;
}

.dash-chart--heat {
    min-height: 0;
    height: 200px;
    overflow: hidden;
    padding-left: 0.15rem;
}

.dash-heat-tip {
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
    line-height: 1.35;
}

.dash-heat-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.85rem;
    margin-top: 0.55rem;
    font-size: 0.75rem;
    color: var(--rt-muted);
}

.dash-heat-legend[hidden] {
    display: none;
}

.dash-heat-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.dash-heat-legend-swatch {
    width: 0.75rem;
    height: 0.75rem;
    flex: 0 0 auto;
    border: 1px solid var(--rt-border);
    box-sizing: border-box;
}

html[data-theme="dark"] .dash-heat-legend-swatch {
    border-color: rgba(255, 255, 255, 0.28);
}

.dash-empty {
    margin: 0;
    color: var(--rt-muted);
    font-size: 0.95rem;
}

.dash-pay-list,
.dash-bday-list,
.dash-flight-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.dash-flight-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 720px) {
    .dash-flight-list {
        grid-template-columns: 1fr 1fr;
        gap: 0 1.25rem;
    }
}

.dash-flight-item {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 0.65rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--rt-border);
}

.dash-flight-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dash-flight-date {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--rt-text);
    font-variant-numeric: tabular-nums;
}

.dash-flight-item.status-today .dash-flight-date {
    color: var(--rt-red);
}

.dash-flight-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
}

.dash-flight-kind {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--rt-text);
}

.dash-flight-item.kind-depart .dash-flight-kind {
    color: var(--rt-green-dark);
}

.dash-flight-item.kind-arrive .dash-flight-kind {
    color: #3b82f6;
}

.dash-flight-meta {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: var(--rt-muted);
}

.dash-panel-wide {
    grid-column: 1 / -1;
}

.dash-pay-item {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 0.65rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--rt-border);
}

.dash-pay-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dash-pay-date {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--rt-text);
    font-variant-numeric: tabular-nums;
}

.dash-pay-item.status-overdue .dash-pay-date {
    color: var(--rt-red);
}

.dash-pay-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
}

.dash-pay-kind {
    font-size: 0.9rem;
    color: var(--rt-text);
}

.dash-pay-sum {
    font-variant-numeric: tabular-nums;
}

.dash-pay-meta,
.dash-bday-meta {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: var(--rt-muted);
}

.dash-bday-item {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--rt-border);
}

.dash-bday-item:last-child {
    border-bottom: none;
}

.dash-bday-item.is-today {
    padding-left: 0.55rem;
    border-left: 3px solid var(--rt-green);
}

.dash-bday-fio {
    font-weight: 700;
    font-size: 0.95rem;
}

.dash-tag {
    display: inline-block;
    padding: 0.05rem 0.35rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dash-tag-danger {
    color: var(--rt-red);
    background: var(--rt-error-bg);
}

.dash-tag-warn {
    color: #7a5a00;
    background: #fff8e6;
}

html[data-theme="dark"] .dash-tag-warn {
    color: #e8c86a;
    background: #2a2412;
}

.dash-tag-ok {
    color: var(--rt-ok);
    background: var(--rt-ok-bg);
}

.dash-note {
    margin: 0;
    font-size: 0.9rem;
    color: var(--rt-muted);
}

.dash-grid {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.dash-dl {
    margin: 0;
    display: grid;
    gap: 0.55rem;
}

.dash-dl div {
    display: grid;
    gap: 0.1rem;
}

.dash-dl dt {
    margin: 0;
    font-size: 0.8rem;
    color: var(--rt-muted);
}

.dash-dl dd {
    margin: 0;
    font-size: 0.95rem;
    word-break: break-word;
}

.dash-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.profile-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem 1.25rem;
    margin-bottom: 1.25rem;
}

.profile-lead {
    margin: 0.35rem 0 0;
    max-width: 36rem;
    font-size: 0.95rem;
    color: var(--rt-muted);
}

.profile-dogovor {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 0.95rem;
    background: var(--rt-green);
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
}

.profile-dogovor:hover {
    background: var(--rt-green-dark);
    color: #fff;
}

.profile-dogovor svg {
    flex: 0 0 auto;
}

.profile-form .login-input {
    max-width: none;
    width: 100%;
}

.profile-fieldset {
    margin: 0 0 1.75rem;
    padding: 0;
    border: none;
    background: transparent;
}

.profile-fieldset legend {
    padding: 0;
    margin: 0 0 0.85rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--rt-text);
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem 1rem;
}

.profile-field .login-label {
    display: block;
    margin-bottom: 0.3rem;
}

.profile-hint {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    color: var(--rt-muted);
}

.profile-actions {
    margin: 0 0 2rem;
}

.profile-actions .login-btn {
    width: auto;
    min-width: 12rem;
}

.profile-dl {
    margin: 0;
}

.profile-requisites-mail {
    margin: 1.1rem 0 0;
}

.profile-mail-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 0.95rem;
    background: var(--rt-green);
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
}

.profile-mail-btn:hover {
    background: var(--rt-green-dark);
    color: #fff;
}

.profile-mail-btn svg {
    flex: 0 0 auto;
}

.profile-row {
    display: grid;
    gap: 0.15rem;
    margin-bottom: 0.65rem;
}

.profile-row:last-child {
    margin-bottom: 0;
}

.profile-label {
    font-size: 0.85rem;
    color: var(--rt-muted);
}

.profile-value {
    margin: 0;
    font-size: 0.95rem;
    color: var(--rt-text);
    word-break: break-word;
}

.profile-value--mono {
    font-variant-numeric: tabular-nums;
}

.branding-head {
    margin-bottom: 1.25rem;
}

.branding-lead {
    margin: 0.4rem 0 0;
    max-width: 38rem;
    font-size: 0.95rem;
    color: var(--rt-muted);
}

.branding-flash {
    margin: 0 0 1rem;
}

.branding-list {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
    border-top: 1px solid var(--rt-border);
}

.branding-item {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1fr);
    gap: 1.1rem;
    align-items: stretch;
    min-height: 9rem;
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--rt-border);
}

.branding-item.is-removing,
.branding-item.is-saving,
.branding-item.is-applying {
    pointer-events: none;
}

.branding-thumbs {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 9rem;
    flex: 0 0 auto;
}

.branding-preview,
.branding-src {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0.5rem;
    border: 1px solid var(--rt-border);
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
    color: inherit;
    font: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.branding-preview {
    width: 9rem;
    height: 9rem;
    min-width: 9rem;
    min-height: 9rem;
    max-width: 9rem;
    max-height: 9rem;
}

.branding-preview,
.branding-src,
.branding-modal-stage {
    background:
        linear-gradient(45deg, #ececec 25%, transparent 25%) 0 0 / 10px 10px,
        linear-gradient(-45deg, #ececec 25%, transparent 25%) 0 5px / 10px 10px,
        linear-gradient(45deg, transparent 75%, #ececec 75%) 5px -5px / 10px 10px,
        linear-gradient(-45deg, transparent 75%, #ececec 75%) -5px 0 / 10px 10px,
        #fff;
}

html[data-theme="dark"] .branding-preview,
html[data-theme="dark"] .branding-src,
html[data-theme="dark"] .branding-modal-stage {
    background:
        linear-gradient(45deg, #2a2a2a 25%, transparent 25%) 0 0 / 10px 10px,
        linear-gradient(-45deg, #2a2a2a 25%, transparent 25%) 0 5px / 10px 10px,
        linear-gradient(45deg, transparent 75%, #2a2a2a 75%) 5px -5px / 10px 10px,
        linear-gradient(-45deg, transparent 75%, #2a2a2a 75%) -5px 0 / 10px 10px,
        #1a1a1a;
}

.branding-preview:disabled,
.branding-src:disabled,
.branding-preview.is-empty,
.branding-src.is-empty {
    cursor: default;
}

.branding-src {
    width: 9rem;
    height: 3.6rem;
    min-height: 3.6rem;
    padding: 0.3rem;
}

.branding-preview-tag {
    position: absolute;
    left: 0.3rem;
    bottom: 0.3rem;
    z-index: 2;
    padding: 0.1rem 0.3rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--rt-muted);
    background: rgba(255, 255, 255, 0.88);
    pointer-events: none;
}

html[data-theme="dark"] .branding-preview-tag {
    background: rgba(0, 0, 0, 0.72);
}

.branding-busy {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--rt-text);
    background: rgba(255, 255, 255, 0.78);
}

html[data-theme="dark"] .branding-busy {
    background: rgba(0, 0, 0, 0.72);
}

.branding-busy[hidden] {
    display: none !important;
}

.branding-busy-spin {
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid var(--rt-border);
    border-top-color: var(--rt-green);
    border-radius: 50%;
    animation: branding-spin 0.7s linear infinite;
}

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

.branding-preview img,
.branding-src img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.branding-drop-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.35rem;
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.25;
    color: var(--rt-muted);
}

.branding-drop-hint svg {
    opacity: 0.7;
}

.branding-meta {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.75rem;
    min-width: 0;
    min-height: 9rem;
}

.branding-item-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.branding-item-hint {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: var(--rt-muted);
}

.branding-status {
    margin: 0.45rem 0 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--rt-green-dark, var(--rt-green));
}

.branding-status.is-active {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.branding-status[hidden] {
    display: none !important;
}

.branding-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.branding-item-tune {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem 0.85rem;
    align-items: end;
    padding-top: 0.15rem;
    max-width: 22rem;
}

.branding-item-tune.is-disabled {
    opacity: 0.45;
}

.branding-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.15rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    text-decoration: none;
}

.branding-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.branding-btn--primary {
    background: var(--rt-green);
    color: #fff;
}

.branding-btn--primary:hover:not(:disabled) {
    background: var(--rt-green-dark);
    color: #fff;
}

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

.branding-btn--ghost:hover {
    color: var(--rt-text);
    border-color: var(--rt-grey);
}

.branding-remove:hover {
    color: var(--rt-red);
    border-color: var(--rt-red);
}

.branding-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

/* Камера — только кабинет агента на узком/touch экране */
.branding-btn--camera {
    display: none;
}

@media (max-width: 900px) {
    .layout-agent:not(.layout-admin-cabinet) .branding-btn--camera {
        display: inline-flex;
    }
}

@media (hover: none) and (pointer: coarse) {
    .layout-agent:not(.layout-admin-cabinet) .branding-btn--camera {
        display: inline-flex;
    }
}

.branding-slider {
    display: block;
}

.branding-slider-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.branding-slider-label em {
    font-style: normal;
    font-variant-numeric: tabular-nums;
    color: var(--rt-muted);
    font-weight: 500;
}

.branding-slider-scale {
    display: flex;
    justify-content: space-between;
    margin: 0.1rem 0 0.25rem;
    font-size: 0.7rem;
    color: var(--rt-muted);
}

.branding-slider input[type="range"] {
    width: 100%;
    accent-color: var(--rt-green);
}

.branding-item-tune .branding-apply {
    justify-self: start;
}

body.branding-modal-open {
    overflow: hidden;
}

.branding-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.branding-modal[hidden] {
    display: none !important;
}

.branding-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 20, 0.62);
}

.branding-modal-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(92vw, 56rem);
    max-height: 92vh;
    background: var(--rt-surface, #fff);
    border: 1px solid var(--rt-border);
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.28);
}

.branding-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--rt-border);
}

.branding-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.branding-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    border: 1px solid var(--rt-border);
    background: var(--rt-surface);
    color: var(--rt-muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.branding-modal-close:hover {
    color: var(--rt-text);
}

.branding-modal-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 16rem;
    max-height: calc(92vh - 3.5rem);
    padding: 1rem;
    overflow: auto;
}

.branding-modal-stage img {
    display: block;
    max-width: 100%;
    max-height: calc(92vh - 5.5rem);
    width: auto;
    height: auto;
    object-fit: contain;
}

.branding-modal-loader {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--rt-text);
    background: rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .branding-modal-loader {
    background: rgba(0, 0, 0, 0.55);
}

.branding-modal-loader[hidden] {
    display: none !important;
}

.branding-modal-loader .branding-busy-spin {
    width: 1.6rem;
    height: 1.6rem;
}

@media (min-width: 720px) {
    .branding-item {
        grid-template-columns: 10rem minmax(0, 1fr);
        min-height: 10rem;
        gap: 1.35rem;
        padding: 1.25rem 0;
    }

    .branding-thumbs {
        width: 10rem;
    }

    .branding-preview {
        width: 10rem;
        height: 10rem;
        min-width: 10rem;
        min-height: 10rem;
        max-width: 10rem;
        max-height: 10rem;
    }

    .branding-src {
        width: 10rem;
        height: 4rem;
        min-height: 4rem;
    }

    .branding-meta {
        min-height: 10rem;
    }

    .branding-item-actions {
        flex-shrink: 0;
    }

    .branding-item-tune {
        grid-template-columns: 1fr 1fr auto;
        max-width: none;
        align-items: end;
    }

    .branding-item[data-mode="logo"] .branding-item-tune {
        grid-template-columns: minmax(8rem, 14rem) auto;
    }
}

.req {
    color: var(--rt-red);
}

@media (min-width: 720px) {
    .profile-grid {
        grid-template-columns: 1fr 1fr;
    }

    .profile-field--wide {
        grid-column: 1 / -1;
    }

    .profile-row {
        grid-template-columns: 12rem 1fr;
        align-items: baseline;
        gap: 0.75rem;
        margin-bottom: 0.5rem;
    }
}

@media (min-width: 900px) {
    .agent-backdrop {
        display: none !important;
    }

    .agent-shell {
        flex-direction: row;
    }

    .agent-sidebar {
        position: sticky;
        top: 0;
        transform: none;
        width: 220px;
        flex: 0 0 220px;
        height: 100vh;
        box-shadow: none;
        overflow: visible;
        transition: width 0.18s ease, flex-basis 0.18s ease;
    }

    .agent-sidebar-foot {
        display: block;
        position: relative;
        z-index: 60;
        overflow: visible;
    }

    .agent-nav-collapse {
        position: relative;
        overflow: visible;
    }

    html.is-nav-collapsed .agent-nav-collapse-txt {
        display: none;
    }

    html.is-nav-collapsed .agent-nav-collapse {
        justify-content: center;
        padding: 0;
    }

    html.is-nav-collapsed .agent-nav-collapse::after {
        content: attr(title);
        position: absolute;
        left: calc(100% + 0.45rem);
        top: 50%;
        transform: translateY(-50%);
        z-index: 70;
        padding: 0.35rem 0.55rem;
        font-size: 0.78rem;
        font-weight: 600;
        line-height: 1.2;
        white-space: nowrap;
        color: #fff;
        background: #222;
        border: 1px solid #111;
        box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.28);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    html.is-nav-collapsed .agent-nav-collapse:hover::after,
    html.is-nav-collapsed .agent-nav-collapse:focus-visible::after {
        opacity: 1;
        visibility: visible;
    }

    html[data-theme="dark"].is-nav-collapsed .agent-nav-collapse::after {
        color: var(--rt-text);
        background: var(--rt-surface);
        border-color: var(--rt-border);
        box-shadow: 2px 2px 10px var(--rt-shadow);
    }

    .agent-sidebar-close,
    .agent-menu-toggle {
        display: none;
    }

    html.is-nav-collapsed .agent-sidebar {
        --sidebar-pad-x: 0;
        width: 40px;
        flex: 0 0 40px;
        overflow: visible;
        z-index: 60;
    }

    html.is-nav-collapsed .agent-sidebar-head {
        display: none;
    }

    html.is-nav-collapsed .agent-nav {
        padding: 0.35rem 0 0.5rem;
        align-items: stretch;
        overflow: visible;
    }

    html.is-nav-collapsed .agent-nav-label {
        display: none;
    }

    html.is-nav-collapsed .agent-nav-link,
    html.is-nav-collapsed .agent-nav-soon,
    html.is-nav-collapsed .agent-nav-logout {
        position: relative;
        justify-content: center;
        gap: 0;
        min-height: 2.4rem;
        padding: 0.4rem 0;
        overflow: visible;
    }

    html.is-nav-collapsed .agent-nav-badge {
        display: none;
    }

    html.is-nav-collapsed .agent-nav-txt {
        display: block;
        position: absolute;
        left: calc(100% + 0.45rem);
        top: 50%;
        transform: translateY(-50%);
        z-index: 70;
        flex: none;
        width: max-content;
        max-width: 14rem;
        margin: 0;
        padding: 0.35rem 0.55rem;
        font-size: 0.78rem;
        font-weight: 600;
        line-height: 1.2;
        white-space: nowrap;
        color: #fff;
        background: #222;
        border: 1px solid #111;
        box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.28);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.12s ease, visibility 0.12s ease;
    }

    html.is-nav-collapsed .agent-nav-link:hover .agent-nav-txt,
    html.is-nav-collapsed .agent-nav-link:focus-visible .agent-nav-txt,
    html.is-nav-collapsed .agent-nav-link:focus .agent-nav-txt {
        opacity: 1;
        visibility: visible;
    }

    html[data-theme="dark"].is-nav-collapsed .agent-nav-txt {
        color: var(--rt-text);
        background: var(--rt-surface);
        border-color: var(--rt-border);
        box-shadow: 2px 2px 10px var(--rt-shadow);
    }

    html.is-nav-collapsed .agent-nav-link.is-active {
        box-shadow: inset 3px 0 0 var(--rt-green);
    }

    html.is-nav-collapsed .agent-sidebar-foot {
        padding: 0.35rem 0 0.55rem;
        overflow: visible;
    }

    html.is-nav-collapsed .agent-nav-collapse {
        width: 100%;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }

    .agent-topbar {
        border-top: none;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .agent-content {
        padding: 1.5rem 1.75rem 2rem;
    }

    .layout-agent--dash .agent-content {
        max-width: 72rem;
    }

    .layout-agent--wide .agent-content {
        max-width: none;
    }

    .dash-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dash-charts {
        grid-template-columns: 1fr 1fr;
    }

    .dash-chart-card--wide {
        grid-column: 1 / -1;
    }

    .dash-panels {
        grid-template-columns: 1.4fr 1fr;
        align-items: start;
    }

    .dash-grid {
        grid-template-columns: 1fr 1fr;
    }

    .profile-row {
        grid-template-columns: 12rem 1fr;
        align-items: baseline;
        gap: 0.75rem;
    }
}

/* Курсы валют по туроператорам */
.rates-toolbar {
    margin: 0 0 1.25rem;
    max-width: none;
}

.rates-toolbar > .login-label {
    display: block;
    margin-bottom: 0.35rem;
}

.rates-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
}

.rates-toolbar-row > .login-input,
.rates-toolbar-row > .login-btn,
.rates-toolbar-row > .rates-chip {
    box-sizing: border-box;
    height: 2.5rem;
    margin: 0;
    padding: 0 0.85rem;
    font-family: var(--rt-font);
    font-size: 0.95rem;
    line-height: 1;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.rates-toolbar .login-btn {
    width: auto;
    min-width: 7rem;
    margin-top: 0;
}

.rates-date-input {
    width: auto;
    min-width: 10.5rem;
    max-width: 12.5rem;
    margin-bottom: 0 !important;
}

.rates-chip {
    color: var(--rt-green);
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--rt-border);
    background: var(--rt-surface);
    white-space: nowrap;
}

.rates-chip:hover {
    border-color: var(--rt-green);
}

.rates-archive-note {
    margin: 0.55rem 0 0;
}

.rates-block {
    margin-bottom: 1.5rem;
}

.rates-caption {
    margin: 0 0 0.55rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--rt-text);
}

.rates-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--rt-border);
    background: var(--rt-surface);
}

.rates-table {
    width: 100%;
    min-width: 40rem;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.rates-table th,
.rates-table td {
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid var(--rt-border);
    text-align: center;
    font-size: 0.9rem;
}

.rates-table th {
    background: var(--rt-bg);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--rt-muted);
    white-space: nowrap;
}

.rates-table .rates-name {
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.rates-row--cbr td {
    font-weight: 700;
    background: rgba(42, 107, 28, 0.08);
}

.rates-delta--plus {
    color: #2a6b1c;
    font-weight: 700;
}

.rates-delta--minus {
    color: var(--rt-red);
    font-weight: 700;
}

html[data-theme="dark"] .rates-delta--plus {
    color: #7dcc6a;
}

html[data-theme="dark"] .rates-row--cbr td {
    background: rgba(125, 204, 106, 0.12);
}

.rates-mobile {
    margin-top: 0.25rem;
}

.rates-card--cbr {
    background: rgba(42, 107, 28, 0.08);
}

html[data-theme="dark"] .rates-card--cbr {
    background: rgba(125, 204, 106, 0.12);
}

.rates-card-name {
    white-space: normal;
}

.rates-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.55rem;
}

.rates-card-currency {
    min-width: 0;
    padding: 0.55rem 0.6rem;
    border: 1px solid var(--rt-border);
    background: var(--rt-surface);
}

.rates-card--cbr .rates-card-currency {
    background: transparent;
}

.rates-card-currency-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--rt-muted);
}

.rates-card-rate {
    margin: 0.2rem 0 0.45rem;
    font-size: 1.15rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--rt-text);
}

.rates-card-meta {
    margin: 0;
}

.rates-card-meta dd {
    font-variant-numeric: tabular-nums;
}

/* Сотрудники / туристы */
.staff-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--rt-border);
    background: var(--rt-surface);
    max-width: 100%;
    min-width: 0;
}

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

.staff-table:not(.tourists-table):not(.orders-table):not(.access-table):not(.operators-table):not(.op-pass-table):not(.company-table):not(.dicts-table):not(.hotels-table):not(.news-table):not(.users-table):not(.managers-table):not(.order-pay-table):not(.order-tourists-table):not(.order-services-table):not(.order-route-sheet):not(.order-living-sheet):not(.order-client-table):not(.order-money-table):not(.order-meta-table) {
    table-layout: fixed;
}

.staff-table:not(.tourists-table):not(.orders-table):not(.access-table):not(.operators-table):not(.op-pass-table):not(.company-table):not(.dicts-table):not(.hotels-table):not(.news-table):not(.users-table):not(.managers-table):not(.order-pay-table):not(.order-tourists-table):not(.order-services-table):not(.order-route-sheet):not(.order-living-sheet):not(.order-client-table):not(.order-money-table):not(.order-meta-table) th:nth-child(1),
.staff-table:not(.tourists-table):not(.orders-table):not(.access-table):not(.operators-table):not(.op-pass-table):not(.company-table):not(.dicts-table):not(.hotels-table):not(.news-table):not(.users-table):not(.managers-table):not(.order-pay-table):not(.order-tourists-table):not(.order-services-table):not(.order-route-sheet):not(.order-living-sheet):not(.order-client-table):not(.order-money-table):not(.order-meta-table) td:nth-child(1) {
    width: 36%;
}

.staff-table:not(.tourists-table):not(.orders-table):not(.access-table):not(.operators-table):not(.op-pass-table):not(.company-table):not(.dicts-table):not(.hotels-table):not(.news-table):not(.users-table):not(.managers-table):not(.order-pay-table):not(.order-tourists-table):not(.order-services-table):not(.order-route-sheet):not(.order-living-sheet):not(.order-client-table):not(.order-money-table):not(.order-meta-table) th:nth-child(2),
.staff-table:not(.tourists-table):not(.orders-table):not(.access-table):not(.operators-table):not(.op-pass-table):not(.company-table):not(.dicts-table):not(.hotels-table):not(.news-table):not(.users-table):not(.managers-table):not(.order-pay-table):not(.order-tourists-table):not(.order-services-table):not(.order-route-sheet):not(.order-living-sheet):not(.order-client-table):not(.order-money-table):not(.order-meta-table) td:nth-child(2) {
    width: 32%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.staff-table:not(.tourists-table):not(.orders-table):not(.access-table):not(.operators-table):not(.op-pass-table):not(.company-table):not(.dicts-table):not(.hotels-table):not(.news-table):not(.users-table):not(.managers-table):not(.order-pay-table):not(.order-tourists-table):not(.order-services-table):not(.order-route-sheet):not(.order-living-sheet):not(.order-client-table):not(.order-money-table):not(.order-meta-table) th:nth-child(3),
.staff-table:not(.tourists-table):not(.orders-table):not(.access-table):not(.operators-table):not(.op-pass-table):not(.company-table):not(.dicts-table):not(.hotels-table):not(.news-table):not(.users-table):not(.managers-table):not(.order-pay-table):not(.order-tourists-table):not(.order-services-table):not(.order-route-sheet):not(.order-living-sheet):not(.order-client-table):not(.order-money-table):not(.order-meta-table) td:nth-child(3) {
    width: 32%;
    min-width: 18rem;
}

.staff-table th,
.staff-table td {
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid var(--rt-border);
    text-align: left;
    vertical-align: middle;
}

.staff-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--rt-muted);
    background: var(--rt-bg);
    white-space: nowrap;
}

.staff-table tr.is-hidden td {
    opacity: 0.55;
}

/* flex нельзя вешать на td — ломает border и соседние колонки */
.staff-actions {
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
}

.staff-actions-inner {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    max-width: 100%;
}

.staff-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0.35rem 0.65rem;
    font-family: var(--rt-font);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    color: var(--rt-text);
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-radius: 0;
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
    flex: 0 0 auto;
}

.staff-btn:hover {
    text-decoration: none;
    border-color: var(--rt-green);
    color: var(--rt-green-dark);
}

.staff-btn--edit {
    color: #fff;
    background: var(--rt-green);
    border-color: var(--rt-green);
}

.staff-btn--edit:hover {
    color: #fff;
    filter: brightness(0.94);
}

.staff-btn--access {
    color: var(--rt-text);
    background: var(--rt-bg);
    border-color: var(--rt-border);
}

.staff-btn--access:hover {
    border-color: var(--rt-muted);
    color: var(--rt-text);
}

.staff-btn--danger {
    color: #fff;
    background: var(--rt-red);
    border-color: var(--rt-red);
}

.staff-btn--danger:hover {
    color: #fff;
    filter: brightness(0.94);
}

.staff-btn--muted {
    background: var(--rt-muted);
    border-color: var(--rt-muted);
    color: #fff;
}

.staff-actions a {
    margin-right: 0;
}

@media (max-width: 720px) {
    .staff-actions {
        text-align: left;
    }

    .staff-actions-inner {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
}

/* Мобильные карточки вместо таблицы (сотрудники / туристы) */
.staff-desktop {
    display: none;
    min-width: 0;
    max-width: 100%;
}

.staff-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.staff-card {
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-left: 4px solid var(--rt-green);
    padding: 0.85rem 1rem;
}

.staff-card.is-hidden {
    opacity: 0.55;
}

.staff-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.staff-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--rt-text);
    text-decoration: none;
}

a.staff-card-title:hover {
    color: var(--rt-green-dark);
    text-decoration: underline;
}

.staff-card-sub {
    margin: 0 0 0.45rem;
    font-size: 0.9rem;
}

.staff-card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 0.75rem;
    margin: 0.55rem 0 0;
}

.staff-card-meta div {
    min-width: 0;
}

.staff-card-meta-full {
    grid-column: 1 / -1;
}

.staff-card-meta dt {
    margin: 0;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--rt-muted);
}

.staff-card-meta dd {
    margin: 0.1rem 0 0;
    font-size: 0.9rem;
    color: var(--rt-text);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.staff-card-actions {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--rt-border);
}

@media (min-width: 900px) {
    .staff-desktop {
        display: block;
    }

    .staff-mobile {
        display: none;
    }
}

.staff-form .login-btn {
    width: auto;
    min-width: 8rem;
    margin-top: 1rem;
}

/* Менеджеры агентства — 3 колонки; min-width → скролл wrap, не сжатие кнопок */
.staff-table.managers-table {
    table-layout: auto;
    width: 100%;
    min-width: 40rem;
}

.staff-table.managers-table th:nth-child(1),
.staff-table.managers-table td:nth-child(1) {
    width: 28%;
    overflow-wrap: break-word;
    word-break: normal;
}

.staff-table.managers-table th:nth-child(2),
.staff-table.managers-table td:nth-child(2) {
    width: auto;
    overflow-wrap: break-word;
    word-break: normal;
}

.staff-table.managers-table th:last-child,
.staff-table.managers-table td.staff-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
    overflow: visible;
}

/* Пользователи платформы — auto + min-width → горизонтальный скролл wrap при узком экране */
.staff-table.users-table {
    table-layout: auto;
    width: 100%;
    min-width: 48rem;
}

.staff-table.users-table .users-col-login { width: 22%; }
.staff-table.users-table .users-col-contacts { width: 22%; }
.staff-table.users-table .users-col-group { width: auto; }
.staff-table.users-table .users-col-actions { width: 1%; }

.staff-table.users-table .users-cell-login,
.staff-table.users-table .users-cell-contacts,
.staff-table.users-table .users-cell-group {
    vertical-align: middle;
    overflow-wrap: break-word;
    word-break: normal;
}

.staff-table.users-table .users-cell-group {
    min-width: 8rem;
}

.staff-table.users-table .users-cell-actions,
.staff-table.users-table th:last-child {
    white-space: nowrap;
    text-align: right;
    vertical-align: middle;
}

.staff-table.users-table td.staff-actions {
    overflow: visible;
}

/* Форма новости — широкие поля и редактор на всю ширину контента */
.news-form {
    display: block;
    width: 100%;
    max-width: 72rem;
}

.news-form .news-field {
    display: grid;
    grid-template-columns: 10.5rem minmax(0, 1fr);
    gap: 0.4rem 1.1rem;
    align-items: start;
    margin: 0 0 1rem;
    width: 100%;
    max-width: none;
}

.news-form .news-field .login-label {
    display: block;
    margin: 0.55rem 0 0;
    line-height: 1.3;
}

.news-form .news-field-control {
    min-width: 0;
    width: 100%;
}

.news-form .news-field .login-input,
.news-form .news-field select.login-input,
.news-form .news-field textarea.login-input {
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
}

.news-form .news-field--editor {
    grid-template-columns: 1fr;
}

.news-form .news-field--editor .login-label {
    margin: 0 0 0.35rem;
}

.news-form .news-editor-wrap {
    width: 100%;
}

.news-form .news-editor-wrap .cke {
    width: 100% !important;
}

.news-form .news-file-input {
    padding: 0.45rem 0;
    border: none;
    background: transparent;
}

.news-form .news-file-current {
    margin: 0.45rem 0 0;
}

.news-form .news-file-preview {
    margin: 0.65rem 0 0;
    max-width: 32rem;
    border: 1px solid var(--rt-border);
    background: var(--rt-bg);
    padding: 0.5rem;
}

.news-form .news-file-preview.is-empty {
    display: none;
}

.news-form .news-file-preview img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 22rem;
    object-fit: contain;
}

@media (max-width: 640px) {
    .news-form .news-field {
        grid-template-columns: 1fr;
    }

    .news-form .news-field .login-label {
        margin-top: 0;
    }
}

/* Новости — auto-layout; колонка действий width:1% */
.staff-table.news-table {
    table-layout: auto;
    width: 100%;
    min-width: 56rem;
}

.staff-table.news-table .news-col-date { width: 6.5rem; }
.staff-table.news-table .news-col-title { width: auto; }
.staff-table.news-table .news-col-author { width: 11rem; }
.staff-table.news-table .news-col-hits { width: 5.5rem; }
.staff-table.news-table .news-col-actions { width: 1%; }

.staff-table.news-table .news-cell-date,
.staff-table.news-table .news-cell-hits {
    white-space: nowrap;
    vertical-align: middle;
}

.staff-table.news-table .news-cell-title {
    overflow-wrap: anywhere;
    word-break: break-word;
    vertical-align: middle;
}

.staff-table.news-table .news-cell-author {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    vertical-align: middle;
    max-width: 12rem;
}

.staff-table.news-table .news-cell-hits {
    text-align: right;
}

.staff-table.news-table .news-cell-actions,
.staff-table.news-table th:last-child {
    white-space: nowrap;
    text-align: right;
    vertical-align: middle;
}

.staff-table.news-table .staff-actions-inner {
    flex-wrap: nowrap;
    justify-content: flex-end;
}

/* —— Новости агента: лента, просмотр, баннер в заявках —— */
.news-feed {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 0.75rem 0 1.25rem;
}

.news-feed-card {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 0.85rem 1rem;
    align-items: stretch;
    padding: 0.75rem;
    text-decoration: none;
    color: inherit;
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-left: 4px solid var(--rt-green);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.news-feed-card:hover {
    border-color: #c8c8c8;
    background: #fcfcfc;
}

html[data-theme="dark"] .news-feed-card:hover {
    border-color: #4a4a4e;
    background: #2a2a2c;
}

.news-feed-media {
    width: 7.5rem;
    height: 5.5rem;
    overflow: hidden;
    background: var(--rt-bg);
    border: 1px solid var(--rt-border);
}

.news-feed-media.is-empty {
    background:
        linear-gradient(135deg, rgba(238, 28, 36, 0.08), transparent 55%),
        linear-gradient(225deg, rgba(132, 188, 48, 0.12), var(--rt-bg));
}

.news-feed-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-feed-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.news-feed-date {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--rt-muted);
}

.news-feed-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--rt-text);
}

.news-feed-card:hover .news-feed-title {
    color: var(--rt-green-dark);
}

.news-feed-announce {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--rt-muted);
}

.news-feed-more {
    margin-top: auto;
    padding-top: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--rt-green-dark);
}

.news-view-date {
    color: var(--rt-muted);
    font-weight: 600;
}

.news-view-hero {
    margin: 0 0 1.1rem;
    background: var(--rt-bg);
    border: 1px solid var(--rt-border);
    overflow: hidden;
}

.news-view-hero a {
    display: block;
}

.news-view-hero img {
    display: block;
    width: 100%;
    max-height: 28rem;
    height: auto;
    object-fit: contain;
    background: #111;
}

.news-view-body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--rt-text);
    overflow-wrap: break-word;
    word-break: normal;
}

.news-view-body p {
    margin: 0 0 0.75rem;
}

.news-view-body img {
    max-width: 100%;
    height: auto;
}

.instr-visible {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.instr-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

html[data-theme="dark"] span.cke_skin_kama {
    border-color: #333;
    background: #1a1a1c;
}

html[data-theme="dark"] .cke_skin_kama .cke_wrapper {
    background-color: #1a1a1c !important;
    background-image: none !important;
}

html[data-theme="dark"] .cke_skin_kama .cke_toolgroup,
html[data-theme="dark"] .cke_skin_kama .cke_rcombo a,
html[data-theme="dark"] .cke_skin_kama .cke_rcombo a:hover,
html[data-theme="dark"] .cke_skin_kama .cke_rcombo a:active {
    background-color: #2a2a2c !important;
    background-image: none !important;
    border-color: #3a3a3e !important;
}

html[data-theme="dark"] .cke_skin_kama .cke_button .cke_icon,
html[data-theme="dark"] .cke_skin_kama .cke_button .cke_buttonarrow,
html[data-theme="dark"] .cke_skin_kama .cke_rcombo .cke_openbutton {
    filter: invert(1);
}

html[data-theme="dark"] .cke_skin_kama .cke_rcombo .cke_text,
html[data-theme="dark"] .cke_skin_kama .cke_rcombo .cke_inline_label,
html[data-theme="dark"] .cke_skin_kama .cke_button .cke_label,
html[data-theme="dark"] .cke_skin_kama .cke_path a {
    color: #f0f0f0 !important;
}

html[data-theme="dark"] .cke_skin_kama .cke_button a.cke_on,
html[data-theme="dark"] .cke_skin_kama .cke_button a:hover.cke_on {
    background-color: #3a4a28 !important;
}

html[data-theme="dark"] .cke_skin_kama .cke_button a:hover.cke_off,
html[data-theme="dark"] .cke_skin_kama .cke_button a:focus.cke_off,
html[data-theme="dark"] .cke_skin_kama .cke_button a:active.cke_off {
    background-color: #333336 !important;
}

html[data-theme="dark"] .cke_skin_kama .cke_contents iframe,
html[data-theme="dark"] .cke_skin_kama textarea.cke_source {
    background-color: #141416 !important;
    color: #f0f0f0 !important;
}

/* Скин CKEditor 3 рассчитан на content-box. Глобальный border-box сжимает диалог. */
.cke_skin_kama,
.cke_skin_kama *,
.cke_skin_kama *::before,
.cke_skin_kama *::after {
    box-sizing: content-box;
}

html[data-theme="dark"] .cke_skin_kama .cke_dialog_body {
    background-color: #1a1a1c !important;
    border-color: #3a3a3e !important;
    color: #f0f0f0 !important;
}

html[data-theme="dark"] .cke_skin_kama .cke_dialog_title {
    color: #f0f0f0 !important;
    border-bottom-color: #333 !important;
}

html[data-theme="dark"] .cke_skin_kama .cke_dialog_contents,
html[data-theme="dark"] .cke_skin_kama .cke_dialog_footer {
    background-color: #1a1a1c !important;
    border-color: #333 !important;
    color: #f0f0f0 !important;
}

html[data-theme="dark"] .cke_skin_kama .cke_dialog_contents label,
html[data-theme="dark"] .cke_skin_kama .cke_dialog_ui_labeled_label {
    color: #f0f0f0 !important;
}

html[data-theme="dark"] .cke_skin_kama a.cke_dialog_tab,
html[data-theme="dark"] .cke_skin_kama a:link.cke_dialog_tab,
html[data-theme="dark"] .cke_skin_kama a:hover.cke_dialog_tab,
html[data-theme="dark"] .cke_skin_kama a:visited.cke_dialog_tab {
    background-image: none !important;
    background-color: #2a2a2c !important;
    color: #d6d6d6 !important;
    border: 1px solid #3a3a3e;
    border-bottom: 0;
}

html[data-theme="dark"] .cke_skin_kama a.cke_dialog_tab_selected,
html[data-theme="dark"] .cke_skin_kama a:link.cke_dialog_tab_selected,
html[data-theme="dark"] .cke_skin_kama a:hover.cke_dialog_tab_selected,
html[data-theme="dark"] .cke_skin_kama a:visited.cke_dialog_tab_selected {
    background-image: none !important;
    background-color: #1a1a1c !important;
    color: #fff !important;
    border-color: #5a5a60;
}

html[data-theme="dark"] .cke_skin_kama div.cke_dialog_ui_input_text,
html[data-theme="dark"] .cke_skin_kama div.cke_dialog_ui_input_password,
html[data-theme="dark"] .cke_skin_kama div.cke_dialog_ui_input_textarea {
    background-color: #101012 !important;
    border: 1px solid #5a5a60 !important;
    padding: 3px 6px !important;
}

html[data-theme="dark"] .cke_skin_kama input.cke_dialog_ui_input_text,
html[data-theme="dark"] .cke_skin_kama input.cke_dialog_ui_input_password,
html[data-theme="dark"] .cke_skin_kama textarea.cke_dialog_ui_input_textarea {
    background: transparent !important;
    color: #f0f0f0 !important;
    border: 0 !important;
    height: 18px !important;
    line-height: 18px !important;
    padding: 0 !important;
}

html[data-theme="dark"] .cke_skin_kama select.cke_dialog_ui_input_select {
    background-color: #101012 !important;
    color: #f0f0f0 !important;
    border: 1px solid #5a5a60 !important;
    height: 24px;
    max-width: 100%;
}

html[data-theme="dark"] .cke_skin_kama .cke_dialog #ImagePreviewBox,
html[data-theme="dark"] .cke_skin_kama .cke_dialog #FlashPreviewBox {
    background-color: #101012 !important;
    border: 1px solid #5a5a60 !important;
    overflow: auto;
}

html[data-theme="dark"] .cke_skin_kama a.cke_dialog_ui_button,
html[data-theme="dark"] .cke_skin_kama a.cke_dialog_ui_button_ok,
html[data-theme="dark"] .cke_skin_kama a.cke_dialog_ui_button_cancel {
    background-image: none !important;
    border-radius: 4px;
}

html[data-theme="dark"] .cke_skin_kama a.cke_dialog_ui_button_ok {
    background-color: #3d7a1e !important;
}

html[data-theme="dark"] .cke_skin_kama a.cke_dialog_ui_button_cancel {
    background-color: #b42318 !important;
}

html[data-theme="dark"] .cke_skin_kama a.cke_dialog_ui_button span,
html[data-theme="dark"] .cke_skin_kama a.cke_dialog_ui_button_ok span,
html[data-theme="dark"] .cke_skin_kama a.cke_dialog_ui_button_cancel span {
    background: none !important;
    color: #fff !important;
}

html[data-theme="dark"] .cke_skin_kama .cke_dialog_close_button {
    background: none !important;
    filter: none;
}

html[data-theme="dark"] .cke_skin_kama .cke_dialog_close_button::after {
    content: "×";
    display: block;
    color: #f0f0f0;
    font-size: 18px;
    line-height: 18px;
    text-align: center;
}

.instr-files-title {
    margin: 1.25rem 0 0.5rem;
    font-size: 1rem;
}

.instr-files {
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
}

.instr-files li {
    margin: 0 0 0.65rem;
}

.instr-files img {
    display: block;
    max-width: 12rem;
    max-height: 8rem;
    margin: 0 0 0.25rem;
}

.instr-file-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.instr-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.instr-list-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.9rem 1rem;
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-radius: 0.6rem;
    color: inherit;
    text-decoration: none;
}

.instr-list-card:hover {
    border-color: #c8c8c8;
    background: #fcfcfc;
}

html[data-theme="dark"] .instr-list-card:hover {
    border-color: #4a4a4e;
    background: #2a2a2c;
}

.instr-list-title {
    font-weight: 600;
}

.instr-list-announce,
.instr-list-slug {
    color: var(--rt-muted, #6b6b70);
    font-size: 0.92rem;
}

.instr-view-page {
    max-width: 1040px;
    width: 100%;
}

.instr-view-tools {
    margin: 0 0 0.75rem;
}

.instr-view-block {
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-radius: 0.6rem;
    padding: 1.25rem 1.35rem;
}

.instr-view-block .news-view-body img {
    max-width: 100% !important;
    height: auto !important;
}

.news-view-file,
.news-view-back {
    margin: 1rem 0 0;
}

.news-orders-banner {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    height: 6.25rem; /* ~100px ≈ 1.5 topbar */
    margin: 0 0 1rem;
    padding: 0;
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-left: 4px solid var(--rt-red);
    overflow: hidden;
    box-sizing: border-box;
}

.news-orders-banner-media {
    flex: 0 0 7.5rem;
    align-self: stretch;
    display: block;
    overflow: hidden;
    background: var(--rt-bg);
    border-right: 1px solid var(--rt-border);
}

.news-orders-banner-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-orders-banner-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    padding: 0.35rem 0;
}

.news-orders-banner-link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    min-width: 0;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.news-orders-banner-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--rt-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-orders-banner-link:hover .news-orders-banner-title {
    color: var(--rt-red);
}

.news-orders-banner-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 0.85rem;
    line-height: 1.35;
    color: var(--rt-muted);
}

.news-orders-banner-close {
    flex: 0 0 auto;
    align-self: flex-start;
    margin: 0.35rem 0.4rem 0 0;
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    background: transparent;
    color: var(--rt-muted);
    cursor: pointer;
}

.news-orders-banner-close:hover {
    color: var(--rt-text);
    border-color: var(--rt-border);
    background: var(--rt-bg);
}

@media (max-width: 640px) {
    .news-feed-card {
        grid-template-columns: 1fr;
    }

    .news-feed-media {
        width: 100%;
        height: 10rem;
    }

    .news-orders-banner {
        height: auto;
        min-height: 5.5rem;
    }

    .news-orders-banner-media {
        flex-basis: 5.5rem;
    }
}

/* Группы доступа — auto-layout; у «Права» нельзя word-break:break-word в узкой колонке (текст встаёт вертикально) */
.staff-table.access-table {
    table-layout: auto;
    width: 100%;
    min-width: 54rem;
}

.staff-table.access-table .access-col-id { width: 3.25rem; }
.staff-table.access-table .access-col-name { width: 22%; }
.staff-table.access-table .access-col-code { width: 6.5rem; }
.staff-table.access-table .access-col-perms { width: auto; }
.staff-table.access-table .access-col-users { width: 4.5rem; }
.staff-table.access-table .access-col-actions { width: 1%; }

.staff-table.access-table .access-cell-id,
.staff-table.access-table .access-cell-code,
.staff-table.access-table .access-cell-users {
    white-space: nowrap;
    vertical-align: top;
}

.staff-table.access-table .access-cell-name {
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.staff-table.access-table .access-cell-perms,
.staff-table.access-table .access-perms-cell {
    vertical-align: top;
    min-width: 14rem;
    max-width: 28rem;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
}

.staff-table.access-table .access-cell-users {
    text-align: center;
}

.staff-table.access-table .access-cell-actions,
.staff-table.access-table th:last-child {
    white-space: nowrap;
    text-align: right;
    vertical-align: top;
}

.staff-table.access-table td.staff-actions {
    overflow: visible;
}

.access-perms-cell {
    font-size: 0.85rem;
    color: var(--rt-muted);
}

body.access-delete-modal-open {
    overflow: hidden;
}

.access-delete-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.access-delete-modal[hidden] {
    display: none !important;
}

.access-delete-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 20, 20, 0.62);
}

.access-delete-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(92vw, 28rem);
    background: var(--rt-surface, #fff);
    border: 1px solid var(--rt-border);
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.28);
}

.access-delete-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--rt-border);
}

.access-delete-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.access-delete-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    border: 1px solid var(--rt-border);
    background: var(--rt-surface);
    color: var(--rt-muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.access-delete-modal-close:hover {
    color: var(--rt-text);
}

.access-delete-modal-body {
    padding: 1rem 0.9rem 1.1rem;
}

.access-delete-modal-text {
    margin: 0 0 0.9rem;
    color: var(--rt-text);
    line-height: 1.4;
}

.access-delete-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.dicts-hub-list {
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
}

.dicts-hub-list li {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--rt-border);
}

.dicts-hub-list li:last-child {
    border-bottom: 0;
}

.dicts-hub-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.dicts-hub-list a {
    font-weight: 600;
    color: var(--rt-text);
    text-decoration: none;
    min-width: 0;
}

.dicts-hub-list a:hover {
    color: var(--rt-green-dark);
    text-decoration: underline;
}

.dicts-hub-kind {
    flex: 0 0 auto;
    font-size: 0.85rem;
    text-align: right;
    white-space: nowrap;
}

.dicts-hub-source {
    font-size: 0.8rem;
    word-break: break-all;
}

.staff-table.dicts-table {
    table-layout: auto;
    width: 100%;
}

.staff-table.dicts-table th,
.staff-table.dicts-table td {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.staff-table.dicts-table th:first-child,
.staff-table.dicts-table td:first-child {
    width: 4.5rem;
    white-space: nowrap;
}

.staff-table.dicts-table th:nth-last-child(2),
.staff-table.dicts-table td:nth-last-child(2) {
    width: 7.5rem;
    white-space: nowrap;
    text-align: left;
}

.staff-table.dicts-table th:last-child,
.staff-table.dicts-table td.staff-actions {
    width: 1%;
    white-space: nowrap;
    text-align: left;
    overflow: visible;
}

.staff-table.dicts-table .staff-actions-inner {
    justify-content: flex-start;
}

.company-office-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
    margin: 0 0 0.75rem;
}

.company-office-row .users-field {
    flex: 1 1 10rem;
    margin: 0;
    min-width: 9rem;
}

.company-office-row .users-field:first-child {
    flex: 1 1 14rem;
}

.company-dogovor-row {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    max-width: 28rem;
    gap: 0.85rem;
}

.company-dogovor-row .users-field,
.company-dogovor-row .users-field:first-child {
    flex: none;
    width: 100%;
    min-width: 0;
}

.staff-table.company-table {
    table-layout: auto;
    width: 100%;
    min-width: 56rem;
}

.staff-table.company-table th,
.staff-table.company-table td {
    overflow-wrap: anywhere;
    word-break: break-word;
    vertical-align: middle;
}

.staff-table.company-table td:not(.staff-actions) {
    overflow: hidden;
}

.staff-table.company-table td.staff-actions {
    width: 1%;
    min-width: 15rem;
    padding-left: 0.85rem;
    white-space: nowrap;
    overflow: visible;
    text-align: left;
}

.staff-table.company-table .staff-actions-inner {
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.staff-table.company-table--legal th:nth-child(1),
.staff-table.company-table--legal td:nth-child(1) {
    width: 5rem;
    white-space: nowrap;
}

.staff-table.company-table--legal th:nth-child(2),
.staff-table.company-table--legal td:nth-child(2) {
    min-width: 7rem;
    max-width: 12rem;
}

.staff-table.company-table--legal th:nth-child(3),
.staff-table.company-table--legal td:nth-child(3) {
    min-width: 14rem;
}

.staff-table.company-table--legal th:nth-child(4),
.staff-table.company-table--legal td:nth-child(4) {
    width: 7.5rem;
    white-space: nowrap;
}

.staff-table.company-table--legal th:nth-child(5),
.staff-table.company-table--legal td:nth-child(5) {
    min-width: 10rem;
    max-width: 16rem;
}

.staff-table.company-table--accounts th:nth-child(1),
.staff-table.company-table--accounts td:nth-child(1) {
    width: 3.5rem;
    white-space: nowrap;
}

.staff-table.company-table--accounts th:nth-child(2),
.staff-table.company-table--accounts td:nth-child(2) {
    min-width: 8rem;
    max-width: 14rem;
}

.staff-table.company-table--accounts th:nth-child(3),
.staff-table.company-table--accounts td:nth-child(3) {
    min-width: 7rem;
    max-width: 12rem;
}

.staff-table.company-table--accounts th:nth-child(4),
.staff-table.company-table--accounts td:nth-child(4) {
    min-width: 10rem;
}

.staff-table.company-table--accounts th:nth-child(5),
.staff-table.company-table--accounts td:nth-child(5) {
    width: 6.5rem;
    white-space: nowrap;
}

.staff-table.company-table--accounts th:nth-child(6),
.staff-table.company-table--accounts td:nth-child(6) {
    min-width: 10rem;
    font-variant-numeric: tabular-nums;
}

.staff-table.company-table--offices th:nth-child(1),
.staff-table.company-table--offices td:nth-child(1) {
    width: 3.5rem;
    white-space: nowrap;
}

.staff-table.company-table--offices th:nth-child(2),
.staff-table.company-table--offices td:nth-child(2) {
    min-width: 10rem;
}

.staff-table.company-table--office-links {
    min-width: 36rem;
}

.staff-table.company-table--office-links th:nth-child(1),
.staff-table.company-table--office-links td:nth-child(1) {
    min-width: 12rem;
}

.staff-table.company-table--office-links th:nth-child(2),
.staff-table.company-table--office-links td:nth-child(2) {
    min-width: 16rem;
}

.staff-table.company-table--office-links th:nth-child(3),
.staff-table.company-table--office-links td:nth-child(3) {
    width: 6rem;
}

.staff-table.company-table--office-links select.login-input {
    width: 100%;
    margin: 0;
    max-width: 28rem;
}

.office-link-row--locked {
    opacity: 0.48;
}

.office-link-row--locked select.login-input {
    pointer-events: none;
    cursor: default;
    background: var(--rt-bg, #f3f4f6);
    color: var(--rt-muted, #6b7280);
}

.office-link-row--locked .office-link-remove {
    opacity: 1;
    pointer-events: auto;
}

.office-link-add-form {
    margin: 1.25rem 0 1.5rem;
    max-width: 28rem;
}

.office-link-add-form .users-section {
    margin-top: 0.5rem;
}

.office-link-add-form .users-field {
    margin-bottom: 0.85rem;
}

.office-link-add-form .staff-btn {
    margin-top: 0.15rem;
}

.office-links-help {
    margin: 0 0 1rem;
    max-width: 48rem;
}

.office-links-help p {
    margin: 0 0 0.55rem;
}

.office-links-help p:last-child {
    margin-bottom: 0;
}

.login-input--readonly {
    display: block;
    margin: 0;
    padding: 0.55rem 0.75rem;
    background: var(--rt-bg, #f3f4f6);
    color: var(--rt-muted, #6b7280);
    border: 1px solid var(--rt-border);
    min-height: 2.4rem;
    box-sizing: border-box;
}

.dict-color-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dict-color-picker {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--rt-border);
    background: var(--rt-surface);
    cursor: pointer;
    flex: 0 0 auto;
}

.dict-color-text {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0 !important;
}

.users-section {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0.5rem 1rem;
    width: 100%;
    clear: both;
    margin: 1.25rem 0 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--rt-border);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--rt-muted);
}

.users-section-title {
    flex: 0 0 auto;
}

.users-section-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-left: auto;
}

.users-select-link {
    margin-left: 0;
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    text-decoration: none;
}

.users-select-link:hover {
    text-decoration: underline;
}

.users-form {
    display: block;
    width: 100%;
    max-width: 56rem;
}

.users-field {
    display: grid;
    grid-template-columns: 9.5rem minmax(0, 22rem);
    gap: 0.35rem 1rem;
    align-items: start;
    margin: 0 0 0.75rem;
    width: 100%;
    max-width: 36rem;
}

.users-field .login-label {
    display: block;
    margin: 0.55rem 0 0;
    line-height: 1.3;
    text-align: left;
}

.users-field .login-input,
.users-field select.login-input {
    width: 100%;
    max-width: none;
    margin: 0;
}

.users-field-control {
    min-width: 0;
}

.users-access-comment {
    margin: 0.4rem 0 0;
}

@media (max-width: 560px) {
    .users-field {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .users-field .login-label {
        margin-top: 0;
    }

    .users-section-actions {
        margin-left: 0;
    }
}

.users-check-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem 1.25rem;
    margin: 0 0 0.75rem;
    padding: 0.75rem 0.85rem;
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
}

.users-check-grid--flags {
    grid-template-columns: 1fr;
    padding: 0;
    background: transparent;
    border: none;
}

.users-check-grid .admin-check {
    margin: 0;
    min-width: 0;
    align-items: flex-start;
}

.users-check-grid .admin-check input[type="checkbox"] {
    margin-top: 0.15rem;
}

@media (min-width: 640px) {
    .users-check-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .users-check-grid--flags {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 960px) {
    .users-check-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .users-check-grid--countries {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.users-field--wide {
    grid-template-columns: 9.5rem minmax(0, 1fr);
    max-width: 48rem;
}

.users-field--wide textarea.login-input {
    min-height: 4.5rem;
    resize: vertical;
}

@media (max-width: 560px) {
    .users-field--wide {
        grid-template-columns: 1fr;
    }
}

.tourists-search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.5rem;
}

.tourists-search-row .login-input {
    flex: 1 1 12rem;
    min-width: 0;
    margin: 0;
}

.tourists-filters .tourists-search-row .login-btn {
    width: auto;
    min-width: 7rem;
    margin-top: 0;
    flex: 0 0 auto;
}

.tourists-filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.65rem;
    margin: 0.35rem 0 0.5rem;
}

.tourists-table {
    table-layout: fixed;
    width: 100%;
}

.tourists-table th {
    white-space: normal;
}

.tourists-table th:nth-child(1),
.tourists-table td:nth-child(1) { width: 24%; }
.tourists-table th:nth-child(2),
.tourists-table td:nth-child(2) { width: 12%; }
.tourists-table th:nth-child(3),
.tourists-table td:nth-child(3) { width: 14%; }
.tourists-table th:nth-child(4),
.tourists-table td:nth-child(4) { width: 12%; }
.tourists-table th:nth-child(5),
.tourists-table td:nth-child(5) { width: 10%; }
.tourists-table th:nth-child(6),
.tourists-table td:nth-child(6) { width: 14%; }
.tourists-table th:nth-child(7),
.tourists-table td:nth-child(7) { width: 14%; }

.tourists-orders {
    white-space: nowrap;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
}

.tourists-orders a {
    text-decoration: none;
}

.tourists-orders a:hover {
    text-decoration: underline;
    color: var(--rt-green-dark);
}

.tourists-table td {
    word-break: break-word;
}

.admin-page .orders-filters {
    max-width: none;
    margin-bottom: 0.85rem;
}

.orders-filters .login-label {
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--rt-muted);
}

.orders-filters .login-input {
    margin-bottom: 0;
    height: 2.125rem;
    min-height: 2.125rem;
    padding: 0.3rem 0.55rem;
    font-size: 0.875rem;
    line-height: 1.25;
    box-sizing: border-box;
}

.orders-filters select.login-input {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

.orders-filters input[type="date"].login-input {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.orders-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.45rem 0.65rem;
    margin-bottom: 0.5rem;
}

.orders-filter-grid--meta {
    grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
    align-items: end;
}

.orders-filter-pair {
    grid-column: span 2;
    min-width: 0;
}

.orders-date-pair {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.orders-date-pair .login-input {
    flex: 1 1 0;
    min-width: 0;
}

.orders-date-sep {
    color: var(--rt-muted);
    flex: 0 0 auto;
}

.orders-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem 0.75rem;
    margin: 0.25rem 0 0.35rem;
}

.orders-status-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.orders-status-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin: 0 0 0.65rem;
    padding: 0.4rem 0.55rem;
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
}

.orders-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--rt-text);
}

.orders-legend-swatch {
    width: 0.85rem;
    height: 0.85rem;
    flex: 0 0 auto;
    border: 1px solid var(--rt-border);
    box-sizing: border-box;
}

html[data-theme="dark"] .orders-legend-swatch {
    border-color: rgba(255, 255, 255, 0.28);
}

html[data-theme="dark"] .orders-chip--status {
    border-color: rgba(255, 255, 255, 0.22);
    background-color: var(--status-bg-dark, var(--status-bg, transparent)) !important;
    color: #f0f0f0;
}

html[data-theme="dark"] .orders-chip--status:not([style*="--status-bg-dark"]) {
    color: #161616;
}

html[data-theme="dark"] .orders-chip--status[style*="--status-bg-dark"] span {
    color: #f0f0f0;
}

html[data-theme="dark"] .orders-chip--status:not([style*="--status-bg-dark"]) span {
    color: #161616;
}

html[data-theme="dark"] .orders-chip--status input:checked + span {
    color: #ffffff;
}

/* Тёмная тема: color_dark_theme на всю строку.
   Фон у tr в border-collapse не перекрывает ячейки, поэтому красим td.
   Если тёмного цвета нет — остаётся светлый color и тёмный текст. */
html[data-theme="dark"] .orders-table tbody tr[class*="order-status-"],
html[data-theme="dark"] .order-card[class*="order-status-"] {
    color: #f2f2f2;
    background-color: var(--status-bg-dark, var(--status-bg, transparent)) !important;
    background-image: none;
}

html[data-theme="dark"] .orders-table tbody tr[class*="order-status-"] > td {
    background-color: var(--status-bg-dark, var(--status-bg, transparent)) !important;
    background-image: none;
}

html[data-theme="dark"] .orders-table tbody tr[class*="order-status-"]:not([style*="--status-bg-dark"]),
html[data-theme="dark"] .order-card[class*="order-status-"]:not([style*="--status-bg-dark"]) {
    color: #161616;
}

html[data-theme="dark"] .orders-table tbody tr[class*="order-status-"]:not([style*="--status-bg-dark"]) a,
html[data-theme="dark"] .order-card[class*="order-status-"]:not([style*="--status-bg-dark"]) a {
    color: #2f6b12;
}

html[data-theme="dark"] .orders-table tbody tr[class*="order-status-"]:not([style*="--status-bg-dark"]) .muted,
html[data-theme="dark"] .order-card[class*="order-status-"]:not([style*="--status-bg-dark"]) .muted,
html[data-theme="dark"] .order-card[class*="order-status-"]:not([style*="--status-bg-dark"]) .order-card-label,
html[data-theme="dark"] .order-card[class*="order-status-"]:not([style*="--status-bg-dark"]) dt {
    color: #444444;
}

html[data-theme="dark"] .orders-table td[style*="--status-bg"]:not([style*="--status-bg-dark"]) {
    color: #161616;
}

html[data-theme="dark"] .orders-table tbody tr[class*="order-status-"]:not([style*="--status-bg-dark"]):not([style*="--status-bg"]),
html[data-theme="dark"] .order-card[class*="order-status-"]:not([style*="--status-bg-dark"]):not([style*="--status-bg"]) {
    background-image: linear-gradient(rgba(15, 15, 16, 0.58), rgba(15, 15, 16, 0.58));
}

html[data-theme="dark"] .orders-table tbody tr[class*="order-status-"] > td[style*="--status-bg"] {
    background-color: var(--status-bg-dark, var(--status-bg)) !important;
}

html[data-theme="dark"] .order-card[class*="order-status-"][style*="--status-bg-dark"] {
    border-left-color: var(--status-bg-dark);
}

html[data-theme="dark"] .orders-table tbody tr[class*="order-status-"] a,
html[data-theme="dark"] .order-card[class*="order-status-"] a {
    color: #b8e86a;
}

html[data-theme="dark"] .orders-table tbody tr[class*="order-status-"] .muted,
html[data-theme="dark"] .order-card[class*="order-status-"] .muted,
html[data-theme="dark"] .order-card[class*="order-status-"] .order-card-label,
html[data-theme="dark"] .order-card[class*="order-status-"] dt {
    color: #c8c8c8;
}

/* Корзина агентств (Dictionaries::$cartAgencies) — только у группы admin, тускло */
.orders-table tbody tr.is-cart-agency,
.order-card.is-cart-agency {
    opacity: 0.42;
    filter: grayscale(0.4);
}

.orders-table tbody tr.is-cart-agency:hover,
.order-card.is-cart-agency:hover {
    opacity: 0.72;
    filter: grayscale(0.15);
}

.orders-pay-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.15rem;
}

.orders-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    height: 2.125rem;
    min-height: 2.125rem;
    padding: 0 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--rt-text);
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    box-sizing: border-box;
    cursor: pointer;
    user-select: none;
}

.orders-chip--status {
    color: #161616;
    border-color: rgba(22, 22, 22, 0.18);
}

.orders-chip--status span {
    color: #161616;
    text-decoration: none;
}

.orders-chip input {
    margin: 0;
    width: 0.85rem;
    height: 0.85rem;
    flex: 0 0 auto;
}

.orders-chip input:checked + span {
    color: var(--rt-text);
    text-decoration: none;
}

.orders-chip--status input:checked + span {
    color: #161616;
    text-decoration: none;
}

.orders-chip input:checked {
    accent-color: var(--rt-green);
}

.orders-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem 0.65rem;
    margin-left: auto;
    flex: 0 0 auto;
}

.orders-filter-actions--end {
    margin: 0.35rem 0 0.5rem;
    width: 100%;
}

.orders-filter-actions .login-btn,
.orders-filter-actions .staff-btn {
    margin-top: 0;
    width: auto;
    height: 2.125rem;
    min-height: 2.125rem;
    padding: 0 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    box-sizing: border-box;
}

.orders-filter-actions .login-btn {
    min-width: 5.5rem;
}

@media (max-width: 720px) {
    .orders-filter-pair {
        grid-column: span 1;
    }
}

.orders-table {
    width: 100%;
    table-layout: auto;
    font-size: 0.78rem;
}

.orders-table--full {
    min-width: 64rem;
}

.orders-table--link {
    min-width: 72rem;
}

.orders-table--pre {
    min-width: 52rem;
}

.preorder-form {
    margin-top: 0.75rem;
}

.preorder-form .order-form-h {
    margin: 1.25rem 0 0.65rem;
}

.preorder-grid,
.preorder-contact-add,
.preorder-contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
}

.preorder-contact-add,
.preorder-contact {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--rt-border);
}

.preorder-form .preorder-span,
.preorder-grid .preorder-span,
.preorder-contact-add .preorder-span,
.preorder-contact .preorder-span {
    grid-column: 1 / -1;
}

.preorder-short {
    max-width: 7rem;
}

.preorder-family {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    align-items: flex-start;
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--rt-border);
}

.preorder-family:first-child {
    margin-top: 0.35rem;
    padding-top: 0;
    border-top: 0;
}

.preorder-ages {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
}

.preorder-age {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.preorder-age .login-input {
    width: 8rem;
    max-width: 8rem;
}

.preorder-ages-empty {
    margin: 0 0 0.35rem;
}

.preorder-variant-head,
.preorder-variant {
    display: grid;
    grid-template-columns: 5.5rem 1.3fr 1fr 4.5rem 1fr 1.2fr auto;
    gap: 0.45rem;
    align-items: center;
}

.preorder-variant-head {
    margin-bottom: 0.35rem;
    color: var(--rt-muted);
    font-size: 0.75rem;
}

.preorder-variant {
    margin-bottom: 0.45rem;
}

.preorder-variant .login-input {
    width: 100%;
    max-width: 100%;
}

.preorder-pick {
    display: flex;
    justify-content: center;
}

.preorder-marks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
}

.preorder-marks label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 400;
}

.preorder-refusal.is-hidden,
.preorder-from-other.is-hidden {
    display: none;
}

.preorder-from-other {
    margin-top: 0.45rem;
}

.preorder-contact-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.45rem;
}

.preorder-form .login-input,
.preorder-form select.login-input,
.preorder-form textarea.login-input,
.preorder-contact-add .login-input,
.preorder-contact .login-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.preorder-actions .login-btn {
    width: auto;
    min-width: 8rem;
}

.preorder-marks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.9rem;
    margin-bottom: 0.45rem;
}

.preorder-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.preorder-stay {
    margin-top: 0.85rem;
    padding: 0.75rem;
    border: 1px solid var(--rt-border);
}

.preorder-stay-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
    margin-bottom: 0.65rem;
}

.preorder-stay-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 5rem 1.2fr 0.9fr;
    gap: 0.5rem 0.75rem;
}

.preorder-room {
    display: grid;
    grid-template-columns: 7rem 1fr 0.8fr 0.7fr 0.8fr 0.8fr auto;
    gap: 0.4rem;
    margin-top: 0.45rem;
}

.preorder-msg {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--rt-border);
}

.preorder-msg-meta {
    margin: 0 0 0.35rem;
    color: var(--rt-muted, #66707a);
    font-size: 0.85rem;
}

.preorder-msg-body {
    white-space: pre-wrap;
}

.preorder-shot {
    max-width: 100%;
    height: auto;
    max-height: 24rem;
}

.preorder-msg-add {
    margin-top: 0.85rem;
}

@media (max-width: 700px) {
    .preorder-grid,
    .preorder-contact-add,
    .preorder-contact,
    .preorder-variant-head,
    .preorder-variant {
        grid-template-columns: 1fr;
    }

    .preorder-variant-head {
        display: none;
    }

    .preorder-stay-grid,
    .preorder-room {
        grid-template-columns: 1fr;
    }
}

.search-page {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}

.search-brief {
    display: grid;
    gap: 0.55rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--rt-border);
    border-radius: 8px;
    background: var(--rt-surface);
}

.search-brief-row,
.search-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.search-chip,
.search-hint {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.28rem 0.6rem;
    border: 1px solid var(--rt-border);
    border-radius: 999px;
    background: var(--rt-bg);
    font-size: 0.88rem;
    line-height: 1.35;
}

.search-hint {
    border-radius: 6px;
    border-left: 3px solid var(--rt-green);
    background: var(--rt-ok-bg);
}

.search-brief-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--rt-muted);
}

.search-tastes {
    margin: 0;
    color: var(--rt-text);
    font-size: 0.92rem;
    line-height: 1.4;
}

.search-work {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
    min-width: 0;
}

.search-dock {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.search-dock-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    width: 100%;
    border: 1px solid var(--rt-border);
    background: var(--rt-surface);
    color: var(--rt-text);
    border-radius: 6px;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.search-dock-count {
    display: inline-flex;
    min-width: 1.25rem;
    justify-content: center;
    border-radius: 999px;
    background: var(--rt-green);
    color: #fff;
    font-size: 0.75rem;
    padding: 0 0.35rem;
}

.search-dock.is-collapsed .search-dock-panel {
    display: none;
}

.search-dock-panel {
    width: auto;
    max-width: 100%;
    border: 1px solid var(--rt-border);
    background: var(--rt-surface);
    border-radius: 8px;
    padding: 0.75rem;
}

.search-dock-kicker,
.search-dock-h {
    margin: 0 0 0.35rem;
    font-size: 0.8rem;
}

.search-dock-h {
    margin-top: 0.75rem;
}

.search-picks {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-pick {
    padding: 0.55rem 0;
    border-top: 1px solid var(--rt-border);
}

.search-pick-head,
.search-pick-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.45rem;
    align-items: center;
}

.search-pick-actions form {
    margin: 0;
}

.search-pick-detail {
    margin: 0.45rem 0 0;
}

.search-pick-detail div {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 0.2rem 0.45rem;
    font-size: 0.85rem;
}

.search-pick-detail dt {
    color: var(--rt-muted);
}

.rt-search-take {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    margin: 14px 0 0;
    padding: 14px 16px;
    background: #2e9e4f;
    color: #fff;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.TVTourCardActionControl,
.TVTourCardActionButtonsControl,
.TVTourCardActionButtonsControl .tv-button-main-content {
    width: 100%;
}

.search-toast {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    z-index: 100000010;
    max-width: 28rem;
    width: calc(100% - 2rem);
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #2e9e4f;
    color: #fff;
    box-shadow: 0 8px 24px var(--rt-shadow);
    transform: translateX(-50%);
    font-size: 0.95rem;
    line-height: 1.35;
}

.search-toast.is-error {
    background: var(--rt-red-dark);
}

.search-widget {
    min-width: 0;
    overflow: visible;
}

#sletat-tour-card-iframe {
    top: 4.5rem !important;
    height: calc(100vh - 4.5rem) !important;
    max-height: calc(100vh - 4.5rem) !important;
}

@media (min-width: 901px) {
    .search-work {
        grid-template-columns: minmax(0, 1fr) 22.5rem;
    }

    .search-dock {
        position: sticky;
        top: 0.75rem;
        max-height: calc(100vh - 6rem);
        overflow: auto;
    }

    .search-dock-toggle {
        display: none;
    }

    .search-dock.is-collapsed .search-dock-panel {
        display: block;
    }
}

.orders-kind-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.85rem;
    border-bottom: 1px solid var(--rt-border);
}

.orders-kind-tab {
    display: inline-block;
    padding: 0.45rem 0.85rem;
    margin-bottom: -1px;
    color: var(--rt-muted);
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.orders-kind-tab:hover {
    color: var(--rt-text);
}

.orders-kind-tab.is-active {
    color: var(--rt-text);
    background: var(--rt-surface);
    border-color: var(--rt-border);
    font-weight: 600;
}

.orders-link {
    white-space: nowrap;
}

.order-card-foot .orders-link {
    flex: 1 0 100%;
}

.orders-pre-status {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: var(--rt-bg);
    border: 1px solid var(--rt-border);
}

.orders-pre-status--1 {
    border-color: #1e456e;
}

.orders-pre-status--2 {
    border-color: var(--rt-green);
}

.orders-pre-status--3 {
    border-color: #6b2424;
    color: #6b2424;
}

html[data-theme="dark"] .orders-pre-status--3 {
    color: #e8b4b4;
}

.orders-table-scroll {
    overflow-x: auto;
    width: 100%;
}

.orders-scrollhead {
    position: fixed;
    z-index: 35;
    box-sizing: border-box;
    background: var(--rt-surface);
    border-bottom: 1px solid var(--rt-border);
    box-shadow: 0 8px 18px var(--rt-shadow);
}

.orders-scrollhead[hidden] {
    display: none;
}

.orders-scrollhead-tools {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.4rem 0.25rem;
}

.orders-scrollhead-pager {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.orders-scrollhead-up {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    padding: 0;
    color: var(--rt-text);
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    cursor: pointer;
}

.orders-scrollhead-up:hover {
    border-color: var(--rt-green);
    color: var(--rt-green-dark);
}

.orders-scrollhead-clip {
    overflow: hidden;
}

.orders-table.orders-scrollhead-table {
    width: auto;
    min-width: 0;
    margin: 0;
    table-layout: fixed;
}

.orders-table.orders-scrollhead-table th {
    max-width: none;
    box-sizing: border-box;
    background: var(--rt-bg);
}

.orders-table th,
.orders-table td {
    word-break: normal;
    overflow-wrap: normal;
    vertical-align: top;
    border: 1px solid var(--rt-border, #dcdcdc);
}

.orders-table td {
    white-space: nowrap;
    max-width: none;
}

.orders-table th {
    white-space: normal;
    max-width: 6.5rem;
    font-size: 0.68rem;
    line-height: 1.2;
    vertical-align: bottom;
    hyphens: auto;
}

/* Цветовые метки строк по статусу (как в online2) */
.orders-table tbody tr.order-status-1 {
    background-color: #ffffff;
}

.orders-table tbody tr.order-status-2 {
    background-color: #ccffff;
}

.orders-table tbody tr.order-status-3 {
    background-color: #c0c0c0;
}

.orders-table tbody tr[class*="order-status-"] {
    color: #161616;
}

.orders-table tbody tr[class*="order-status-"] a {
    color: #2a6b12;
}

.orders-table tbody tr[class*="order-status-"] .muted {
    color: #555555;
}

.order-card.order-status-1 {
    background-color: #ffffff;
}

.order-card.order-status-2 {
    background-color: #ccffff;
}

.order-card.order-status-3 {
    background-color: #c0c0c0;
}

.order-card[class*="order-status-"] {
    color: #161616;
}

.order-card[class*="order-status-"] a {
    color: #2a6b12;
}

.order-card[class*="order-status-"] .muted,
.order-card[class*="order-status-"] .order-card-label,
.order-card[class*="order-status-"] dt {
    color: #555555;
}

.orders-terms {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.orders-dates {
    white-space: normal;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
}

.orders-oper {
    white-space: normal;
    line-height: 1.35;
}

.orders-oper-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.orders-oper-link:hover {
    color: var(--rt-green-dark);
}

.orders-client {
    white-space: normal;
    line-height: 1.35;
}

.orders-agency {
    max-width: 200px;
    width: 200px;
    white-space: normal;
    line-height: 1.35;
    overflow: hidden;
}

.orders-clip {
    display: inline-flex;
    align-items: baseline;
    max-width: 200px;
    min-width: 0;
    overflow: hidden;
    vertical-align: bottom;
}

.orders-agency .orders-clip {
    display: flex;
}

.orders-clip-text {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.orders-clip-end {
    display: none;
    flex: 0 0 auto;
}

.orders-clip.is-cut .orders-clip-end {
    display: inline;
}

.orders-id {
    white-space: nowrap;
}

.orders-id-flags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.2rem;
}

.orders-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 1.4rem;
    min-height: 1.25rem;
    padding: 0.1rem 0.35rem;
    color: #fff;
    background: var(--rt-red);
    animation: orders-lock-blink 1.1s ease-in-out infinite;
}

.orders-lock svg {
    display: block;
    width: 0.85rem;
    height: 0.85rem;
}

@keyframes orders-lock-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.orders-msg-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 1.4rem;
    min-height: 1.25rem;
    padding: 0.1rem 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: var(--rt-green);
}

.order-card-num .orders-id-flags {
    display: flex;
    margin-top: 0.25rem;
    margin-left: 0;
}

.order-card-foot--triple {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

.order-card-foot--triple .order-card-debt:last-child {
    grid-column: 1 / -1;
    text-align: left;
}

.orders-num {
    white-space: normal;
    font-variant-numeric: tabular-nums;
}

.orders-price {
    white-space: normal;
    line-height: 1.35;
}

.orders-num.is-debt {
    color: var(--rt-red);
    font-weight: 700;
}

.orders-num.is-overpay,
.orders-num.is-overpay strong,
.order-card-debt.is-overpay strong {
    color: var(--rt-green-dark) !important;
    font-weight: 700;
}

html[data-theme="dark"] .orders-num.is-overpay,
html[data-theme="dark"] .orders-num.is-overpay strong,
html[data-theme="dark"] .order-card-debt.is-overpay strong {
    color: var(--rt-green) !important;
}

.orders-desktop {
    display: none;
}

.orders-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.order-card {
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    border-left: 4px solid var(--rt-green);
    padding: 0.85rem 1rem;
}

.order-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.order-card-num {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--rt-text);
}

.order-card-status {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--rt-muted);
    text-align: right;
}

.order-card-client {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.order-card-agency {
    margin-bottom: 0.45rem;
    font-size: 0.9rem;
}

.order-card-agency a {
    color: var(--rt-green);
    text-decoration: none;
    font-weight: 600;
}

.order-card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 0.75rem;
    margin: 0.55rem 0;
}

.order-card-meta div {
    min-width: 0;
}

.order-card-meta dt {
    margin: 0;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--rt-muted);
}

.order-card-meta dd {
    margin: 0.1rem 0 0;
    font-size: 0.9rem;
    word-break: break-word;
}

.order-card-foot {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--rt-border);
}

.order-card-foot--admin {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem 0.75rem;
}

.order-card-foot--admin .order-card-debt {
    text-align: left;
}

.order-card-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--rt-muted);
    margin-bottom: 0.1rem;
}

.order-card-debt {
    text-align: right;
}

.order-card-debt.is-debt strong {
    color: var(--rt-red);
}

.order-card-debt.is-overpay strong {
    font-weight: 700;
}

.order-card-oper {
    margin-top: 0.45rem;
    font-size: 0.85rem;
}

.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin: 0.65rem 0;
}

.pager-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem;
}

.pager-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.2rem;
}

.pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    min-height: 1.75rem;
    padding: 0.2rem 0.4rem;
    font-family: var(--rt-font);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    color: var(--rt-text);
    background: var(--rt-surface);
    border: 1px solid var(--rt-border);
    box-sizing: border-box;
}

a.pager-btn:hover {
    border-color: var(--rt-green);
    color: var(--rt-green-dark);
}

.pager-btn.is-current {
    color: #fff;
    background: var(--rt-green);
    border-color: var(--rt-green);
}

.pager-btn.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.pager-btn--nav {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 1.75rem;
}

.pager-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    color: var(--rt-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.pager-meta {
    margin: 0 0 0 auto;
    text-align: right;
    font-size: 0.78rem;
    color: var(--rt-muted);
    font-variant-numeric: tabular-nums;
}

@media (min-width: 900px) {
    .orders-desktop {
        display: block;
    }

    .orders-mobile {
        display: none;
    }
}

.dash-kpi-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.dash-kpi-link:hover {
    color: var(--rt-green-dark);
    text-decoration: underline;
}

/* Operator card tabs (data / passwords / commission) */
.op-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 1.15rem;
    padding: 0;
    border-bottom: 1px solid var(--rt-border, #ddd);
}

.op-tab {
    display: inline-block;
    padding: 0.45rem 0.85rem;
    margin-bottom: -1px;
    color: var(--rt-muted, #666);
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: none;
    font-size: 0.92rem;
}

.op-tab:hover {
    color: var(--rt-green-dark, #1a6b3c);
}

.op-tab.is-active {
    color: var(--rt-text, #222);
    background: #fff;
    border-color: var(--rt-border, #ddd);
    border-radius: 4px 4px 0 0;
    font-weight: 600;
}

html[data-theme="dark"] .op-tab.is-active {
    color: var(--rt-text);
    background: #2a2a2c;
    border-color: #4a4a4e;
}

.op-city-filter {
    margin: 0 0 1rem;
    max-width: 28rem;
}

.op-pass-form {
    margin-top: 1.5rem;
}

.staff-table.op-pass-table {
    table-layout: auto;
    width: 100%;
}

.staff-table.op-pass-table th,
.staff-table.op-pass-table td {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.staff-table.op-pass-table th:last-child,
.staff-table.op-pass-table td.staff-actions {
    width: 1%;
    white-space: nowrap;
    overflow: visible;
}

.staff-table.operators-table {
    table-layout: auto;
    width: 100%;
}

.staff-table.operators-table td.staff-actions {
    width: 1%;
    white-space: nowrap;
    overflow: visible;
}

.staff-table.hotels-table {
    table-layout: auto;
    width: 100%;
    min-width: 52rem;
}

.staff-table.hotels-table td.staff-actions {
    width: 1%;
    white-space: nowrap;
    overflow: visible;
}

.hotel-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: flex-end;
    margin: 0 0 1rem;
}

.hotel-filter-form .users-field {
    margin: 0;
    min-width: 9rem;
    flex: 1 1 9rem;
}

.hotel-filter-form .hotel-filter-submit,
.hotel-filter-form .hotel-filter-check {
    flex: 0 0 auto;
}

.hotel-filter-all {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    min-height: 2.5rem;
}

.dicts-pager {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin: 1rem 0 0;
}

.op-comm-readonly p {
    margin: 0.35rem 0;
}

#access_perms_ro[readonly] {
    background: #f5f5f5;
    color: var(--rt-muted, #666);
    cursor: default;
}

.op-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
    max-width: 40rem;
}

.op-list-toolbar .login-input {
    margin: 0;
    flex: 1 1 12rem;
    min-width: 0;
}

.op-list-toolbar select.login-input {
    flex: 0 1 10rem;
}

.order-form-page {
    width: 100%;
    max-width: 1040px;
    min-width: 0;
    box-sizing: border-box;
    /* 1368 − сайдбар 16.75rem (268px) − поля контента 1.75rem×2. no overflow — ломает sticky */
}

.order-status-dots {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 0.35rem;
}

.order-status-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    border: 1px solid var(--rt-border);
    border-radius: 50%;
    background: var(--status-bg, var(--rt-surface));
    color: var(--status-ink, var(--rt-text));
    font: 700 0.85rem/1 var(--rt-font);
    cursor: pointer;
}

.order-status-dot:hover {
    filter: brightness(0.92);
}

html[data-theme="dark"] .order-status-dot {
    background: var(--status-bg-dark, var(--status-bg, var(--rt-surface)));
    color: var(--status-ink-dark, var(--status-ink, var(--rt-text)));
}

#order-status-block {
    scroll-margin-top: 4.5rem;
}

.order-form-page .order-form {
    max-width: 100%;
    min-width: 0;
}

.order-form-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.85rem 1.5rem;
    margin: 0 0 1.1rem;
    padding: 0 0 0.85rem;
    border-bottom: 1px solid var(--rt-border);
    max-width: 100%;
    min-width: 0;
}

.order-form-title {
    margin: 0 0 0.4rem;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
}

.order-form-head-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

.order-form-commission {
    font-weight: 600;
    color: var(--rt-green-dark);
}

.order-form-related {
    font-size: 0.9rem;
    align-items: center;
}

.order-form-related-label {
    color: var(--rt-muted);
    margin-right: 0.25rem;
}

.order-form-related-list {
    display: inline;
}

.order-form-related-link {
    color: var(--rt-green-dark);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.order-form-related-link:hover {
    color: var(--rt-green);
}

.order-related-dots {
    flex: 0 0 auto;
    width: 1.85rem;
    min-width: 1.85rem;
    height: 1.85rem;
    min-height: 1.85rem;
    padding: 0;
    margin: 0 0 0 0.35rem;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}

.order-related-fields {
    display: grid;
    gap: 0.55rem;
    margin: 0 0 1rem;
}

.order-related-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.75rem;
    align-items: center;
}

.order-related-modal-actions .login-btn {
    margin: 0;
}

.order-form-kpis {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.35rem;
    margin: 0;
}

.order-form-kpis > div {
    min-width: 5.5rem;
}

.order-form-kpis dt {
    margin: 0 0 0.15rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--rt-muted);
}

.order-kpi {
    position: relative;
    cursor: help;
}

.order-kpi dt {
    border-bottom: 1px dotted var(--rt-muted);
    display: inline-block;
}

.order-kpi::after {
    content: attr(data-tip);
    position: absolute;
    right: 0;
    left: auto;
    bottom: calc(100% + 0.4rem);
    z-index: 30;
    width: max-content;
    max-width: min(16rem, calc(100vw - 2rem));
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--rt-border);
    background: var(--rt-surface);
    color: var(--rt-text);
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.35;
    text-transform: none;
    letter-spacing: 0;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.12s ease;
}

.order-kpi:hover::after,
.order-kpi:focus::after,
.order-kpi:focus-within::after {
    opacity: 1;
    visibility: visible;
}

.order-form-kpis dd {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.order-form-h {
    margin: 1.35rem 0 0.55rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.order-form-h-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.85rem;
    margin: 1.35rem 0 0.55rem;
}

.order-form-h-row .order-form-h {
    margin: 0;
}

.order-booking-toggle {
    flex: 0 0 auto;
    font-size: 0.8rem;
    min-height: 2rem;
    height: 2rem;
    padding: 0 0.75rem;
}

.order-booking-details {
    margin: 0 0 0.65rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.02);
    max-width: 100%;
    overflow-x: auto;
}

.order-booking-details[hidden] {
    display: none !important;
}

.order-booking-sheet {
    table-layout: fixed;
    max-width: 44rem;
    margin: 0 0 0.55rem;
}

.order-booking-sheet th {
    width: 12rem;
    text-align: left;
    font-weight: 600;
    vertical-align: top;
}

.order-booking-sheet td {
    vertical-align: top;
    word-break: break-word;
    white-space: pre-wrap;
}

.order-booking-html-label {
    margin: 0.35rem 0 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.order-booking-html {
    margin: 0 0 0.5rem;
    overflow-x: auto;
    max-width: 100%;
}

.order-booking-html table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.order-booking-html th,
.order-booking-html td {
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 0.25rem 0.4rem;
    vertical-align: top;
}

.order-staff-info {
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(180, 40, 40, 0.25);
    background: rgba(180, 40, 40, 0.04);
}

.order-staff-note-field {
    display: block;
    margin-top: 0.75rem;
}

.order-staff-note-field .order-field-label {
    display: block;
    margin-bottom: 0.35rem;
}

.order-staff-note {
    width: 100%;
    min-height: 3.2rem;
    resize: vertical;
    box-sizing: border-box;
}

.order-staff-info-body,
.order-staff-comment-body {
    font-size: 0.875rem;
    line-height: 1.4;
    overflow-x: auto;
}

.order-staff-info-body table,
.order-staff-comment-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.order-staff-info-body th,
.order-staff-info-body td,
.order-staff-comment-body th,
.order-staff-comment-body td {
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 0.25rem 0.4rem;
}

.order-staff-comment {
    margin-top: 0.65rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.order-staff-comment:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.order-staff-comment-date {
    margin: 0 0 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--rt-muted);
}

.order-staff-comment--mark .order-staff-comment-body {
    color: #a11;
}


.order-form-block {
    margin: 0 0 0.35rem;
    overflow-x: auto;
    max-width: 100%;
    min-width: 0;
}

.order-form-block:has(.order-money-table),
.order-form-block--money {
    overflow-x: visible;
}

.order-form-payterms,
.order-contract-grid {
    display: grid;
    gap: 0.65rem 1rem;
}

.order-form-payterms {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) repeat(3, minmax(0, auto));
    gap: 0.65rem 1rem;
    align-items: end;
    margin: 0 0 1rem;
    padding: 0 0 0.85rem;
    max-width: 100%;
    min-width: 0;
}

.order-oper-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.75rem;
    align-items: end;
    min-width: 0;
}

.order-oper-history {
    margin: 0.75rem 0 0.25rem;
    min-width: 0;
}

.order-oper-history-log {
    max-height: 16rem;
    overflow: auto;
    margin: 0 0 0.5rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--rt-border);
    border-radius: 6px;
    background: var(--rt-bg);
    font-size: 0.9rem;
}

.order-bank-form {
    margin: 0 0 1rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--rt-border);
    border-radius: 8px;
}

.order-bank-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.75rem;
    align-items: end;
}

.order-field-oper {
    flex: 1 1 11rem;
    min-width: 0;
}

.order-field-oper-num {
    flex: 0 1 9rem;
    width: 9rem;
    max-width: 11rem;
    min-width: 7rem;
}

.order-field-oper-num .login-input,
.order-field-oper-num .order-cell-text {
    width: 100%;
}

.order-field-date {
    width: 9.5rem;
    max-width: 9.5rem;
}

.order-field-date .login-input,
.order-field-date .order-cell-text {
    width: 100%;
    max-width: 9.5rem;
}

.order-field-pct {
    width: auto;
    max-width: none;
}

.order-pct-ctrl {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.order-pct-ctrl .order-pct-input,
.order-pct-ctrl .order-cell-text {
    width: 3.1rem;
    max-width: 3.1rem;
    min-width: 0;
    text-align: center;
}

.order-pct-ctrl .order-pct-input--wide,
.order-pct-ctrl .order-pct-input.order-pct-input--wide {
    width: 4.6rem;
    max-width: 4.6rem;
}

.order-pct-suffix {
    color: var(--rt-muted);
    font-size: 0.9rem;
    line-height: 1;
    flex: 0 0 auto;
}

.order-field-sbor {
    width: 6.5rem;
    max-width: 6.5rem;
}

.order-field-sbor .login-input,
.order-field-sbor .order-cell-text {
    width: 100%;
}

@media (max-width: 899px) {
    .order-form-payterms {
        grid-template-columns: 1fr 1fr;
    }

    .order-oper-group {
        grid-column: 1 / -1;
    }

    .order-field-oper-num {
        width: auto;
        max-width: none;
        flex: 1 1 8rem;
    }

    .order-field-date,
    .order-field-sbor {
        width: auto;
        max-width: none;
    }

    .order-field-date .login-input,
    .order-field-date .order-cell-text,
    .order-field-sbor .login-input,
    .order-field-sbor .order-cell-text {
        max-width: none;
    }

    .order-pct-ctrl .order-pct-input,
    .order-pct-ctrl .order-cell-text {
        width: 3.5rem;
        max-width: 3.5rem;
    }

    .order-pct-ctrl .order-pct-input--wide,
    .order-pct-ctrl .order-pct-input.order-pct-input--wide {
        width: 5rem;
        max-width: 5rem;
    }
}

.order-form-manager-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    align-items: end;
    margin: 0 0 0.85rem;
    padding: 0 0 0.85rem;
}

.order-field-manager {
    flex: 0 0 13.5rem;
    width: 13.5rem;
    max-width: 13.5rem;
    min-width: 13.5rem;
}

.order-field-manager .login-input,
.order-field-manager .order-cell-text {
    width: 100%;
}

.order-field-booker {
    flex: 0 0 13.5rem;
    width: 13.5rem;
    max-width: 13.5rem;
    min-width: 13.5rem;
    margin-left: auto;
}

.order-field-booker .login-input,
.order-field-booker .order-cell-text {
    width: 100%;
}

@media (max-width: 899px) {
    .order-field-manager,
    .order-field-booker {
        flex: 1 1 12rem;
        width: auto;
        max-width: none;
        min-width: 10rem;
        margin-left: 0;
    }
}

.order-contract-grid {
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.order-field-ser {
    width: 5.5rem;
    max-width: 5.5rem;
}

.order-field-ser .login-input,
.order-field-pass-num .login-input,
.order-field-sum .login-input {
    width: 100%;
}

.order-field-pass-num {
    width: 8rem;
    max-width: 8rem;
}

.order-field-sum {
    width: 10.5rem;
    max-width: 10.5rem;
}

.order-field-sum .order-pct-ctrl {
    display: flex;
    width: 100%;
}

.order-field-sum .order-pct-ctrl .login-input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
}

.order-client-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1rem;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 0.55rem;
}

.order-client-doc-note {
    margin: 0;
    flex: 1 1 14rem;
}

.order-client-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0 0.95rem;
    min-height: 2.35rem;
    height: 2.35rem;
    box-sizing: border-box;
    font-family: var(--rt-font);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    background: var(--rt-green);
    border: 1px solid var(--rt-green);
    border-radius: 0;
    cursor: pointer;
    white-space: nowrap;
    flex: 0 1 auto;
    max-width: 100%;
}

.order-client-copy-btn:hover {
    background: var(--rt-green-dark);
    border-color: var(--rt-green-dark);
    color: #fff;
}

.order-client-copy-btn:active {
    filter: brightness(0.95);
}

.order-client-copy-btn svg {
    flex: 0 0 auto;
    display: block;
}

.order-client-table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0 0 0.75rem;
}

.order-client-table {
    table-layout: auto;
    width: 100%;
    max-width: 100%;
}

.order-client-table.staff-table th,
.order-client-table.staff-table td {
    border: 1px solid var(--rt-border, #dcdcdc);
    vertical-align: middle;
}

.order-client-table .login-input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.order-client-table--pass th:nth-child(2),
.order-client-table--pass td:nth-child(2) {
    width: 5.5rem;
}

.order-client-table--pass th:nth-child(3),
.order-client-table--pass td:nth-child(3) {
    width: 7rem;
}

.order-client-table--pass th:nth-child(5),
.order-client-table--pass td:nth-child(5) {
    width: 9rem;
}

.order-client-table--contacts th:nth-child(2),
.order-client-table--contacts td:nth-child(2),
.order-client-table--contacts th:nth-child(3),
.order-client-table--contacts td:nth-child(3) {
    width: 14rem;
}

.order-client-table--erp th:nth-child(2),
.order-client-table--erp td:nth-child(2) {
    width: 10rem;
}

.order-client-table--kv th:first-child,
.order-client-table--kv td:first-child {
    width: 14rem;
    max-width: 18rem;
    white-space: normal;
    vertical-align: top;
}

.order-client-table--kv .login-input {
    max-width: 36rem;
}

.order-client-pass-row {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) 5rem 7.25rem minmax(0, 1.6fr) 9.5rem;
    gap: 0.55rem 0.65rem;
    align-items: end;
    margin: 0 0 0.65rem;
    max-width: 100%;
    min-width: 0;
}

.order-client-pass-row .order-field {
    width: auto;
    max-width: none;
    min-width: 0;
}

.order-client-pass-row .order-field-ser {
    width: 5rem;
    max-width: 5rem;
}

.order-client-pass-row .order-field-pass-num {
    width: 7.25rem;
    max-width: 7.25rem;
}

.order-client-pass-row .order-field-vidan-date {
    width: 9.5rem;
    max-width: 9.5rem;
}

.order-client-pass-row .login-input {
    width: 100%;
}

.order-client-contacts {
    margin-top: 0;
}

@media (max-width: 1099px) {
    .order-client-pass-row {
        grid-template-columns: minmax(10rem, 1fr) 5rem 7rem;
    }

    .order-client-pass-row .order-field-vidan,
    .order-client-pass-row .order-field-vidan-date {
        grid-column: 1 / -1;
        width: auto;
        max-width: none;
    }

    .order-client-pass-row .order-field-vidan-date {
        max-width: 11rem;
    }
}

@media (max-width: 699px) {
    .order-client-pass-row {
        grid-template-columns: 1fr 1fr;
    }

    .order-client-pass-row .order-field-fio {
        grid-column: 1 / -1;
    }

    .order-client-pass-row .order-field-ser,
    .order-client-pass-row .order-field-pass-num,
    .order-client-pass-row .order-field-vidan-date {
        width: auto;
        max-width: none;
    }
}

.order-erp-grid {
    grid-template-columns: minmax(11rem, 1.3fr) max-content minmax(9rem, 1fr) minmax(9rem, 1fr);
    align-items: end;
    margin-top: 0.25rem;
}

.order-payer {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--rt-border);
}

.order-payer-fields {
    margin-top: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.order-payer-fields[hidden] {
    display: none;
}

.order-payer-docs {
    margin-top: 0.9rem;
}

.order-payer-docs[hidden] {
    display: none;
}

.order-payer-docs .order-docs-subh {
    margin-top: 0;
}

.order-erp-note {
    margin: 0.85rem 0 0.55rem;
}

@media (max-width: 899px) {
    .order-field-ser,
    .order-field-pass-num,
    .order-field-sum {
        width: auto;
        max-width: none;
    }

    .order-erp-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.order-field-span2 {
    grid-column: 1 / -1;
}

@media (min-width: 900px) {
    .order-field-span2 {
        grid-column: span 2;
    }
}

.order-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.order-field-grow {
    min-width: 12rem;
}

.order-field-label {
    font-size: 0.78rem;
    color: var(--rt-muted);
}

.order-sheet {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.order-sheet th,
.order-sheet td {
    padding: 0.4rem 0.35rem;
    vertical-align: middle;
    text-align: left;
    border: none;
}

.order-sheet thead th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--rt-muted);
    text-transform: none;
    white-space: nowrap;
    background: transparent;
}

.order-sheet tbody td {
    background: transparent;
}

.order-form-page .login-input,
.order-form-page select.login-input {
    margin-bottom: 0;
}

.order-cell-narrow {
    max-width: 6.5rem;
}

.order-cell-currency {
    width: 3.6rem;
    max-width: 3.6rem;
}

.order-cell-currency .login-input,
.order-cell-currency .order-cell-text,
.order-cell-currency.order-cell-num {
    width: 3.4rem;
    max-width: 3.4rem;
    min-width: 0;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}

.order-money-table-wrap,
.order-meta-table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0 0 0.75rem;
}

.order-money-table,
.order-meta-table {
    table-layout: auto;
    width: 100%;
    max-width: 100%;
}

.order-money-table.staff-table th,
.order-money-table.staff-table td,
.order-meta-table.staff-table th,
.order-meta-table.staff-table td {
    border: 1px solid var(--rt-border, #dcdcdc);
    vertical-align: middle;
}

.order-meta-table .login-input,
.order-meta-table .order-cell-text,
.order-meta-table .order-pct-ctrl {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.order-meta-table--oper th:nth-child(n+3),
.order-meta-table--oper td:nth-child(n+3) {
    width: 9.5rem;
}

.order-meta-table--manager th:nth-child(2),
.order-meta-table--manager td:nth-child(2),
.order-meta-table--manager th:nth-child(3),
.order-meta-table--manager td:nth-child(3) {
    width: 8.5rem;
}

.order-money-table thead th {
    white-space: normal;
    line-height: 1.25;
    hyphens: auto;
    overflow-wrap: break-word;
    word-break: normal;
}

.order-money-table tbody td {
    min-width: 0;
}

.order-money-table .login-input,
.order-money-table .order-cell-narrow,
.order-money-table .order-cell-num,
.order-money-table .order-cell-text {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.order-money-table .order-cell-currency,
.order-money-table .order-cell-currency .login-input,
.order-money-table .order-cell-currency .order-cell-text {
    width: 100%;
    max-width: 100%;
}

.order-money-table th:last-child,
.order-money-table td:last-child {
    width: 4.5rem;
}

.order-money-table select.login-input {
    padding-right: 1.5rem;
    background-position: right 0.35rem center;
    background-size: 0.6rem auto;
}

@media (max-width: 899px) {
    .order-form-block--money {
        overflow: visible;
    }

    .order-money-table,
    .order-money-table thead,
    .order-money-table tbody {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .order-money-table thead {
        display: none;
    }

    .order-money-table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 0.65rem 0.85rem;
        width: 100%;
        min-width: 0;
    }

    .order-money-table tbody td,
    .order-money-table tbody td.order-cell-num,
    .order-money-table tbody td.order-cell-currency,
    .order-money-table tbody td:last-child {
        display: block;
        width: auto;
        max-width: none;
        min-width: 0;
        box-sizing: border-box;
        padding: 0;
        border: 0;
        text-align: left;
    }

    .order-money-table tbody td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin: 0 0 0.25rem;
        font-size: 0.75rem;
        font-weight: 600;
        line-height: 1.3;
        color: var(--rt-muted);
    }

    .order-money-table .login-input,
    .order-money-table .order-cell-narrow,
    .order-money-table .order-cell-num,
    .order-money-table .order-cell-text,
    .order-money-table .order-cell-currency,
    .order-money-table .order-cell-currency .login-input,
    .order-money-table .order-cell-currency .order-cell-text,
    .order-money-table select.login-input {
        width: 100%;
        max-width: none;
        min-width: 0;
    }
}

.order-cell-text,
.order-cell-num,
.order-cell-muted {
    display: block;
    padding: 0.55rem 0.15rem;
}

/* На <td> нельзя display:block — ломает строку таблицы (агентская смета) */
td.order-cell-text,
td.order-cell-num,
td.order-cell-muted,
th.order-cell-text,
th.order-cell-num,
th.order-cell-muted {
    display: table-cell;
}

.order-cell-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.order-cell-muted {
    color: var(--rt-muted);
    text-align: center;
}

.order-erp-note {
    margin: 0.85rem 0 0.55rem;
}

.order-service-grid {
    margin-top: 0.25rem;
}

.order-visa-grid {
    grid-template-columns: minmax(9rem, 1fr) minmax(10rem, 1.1fr) minmax(12rem, 1.2fr);
    align-items: end;
}

.order-field-check {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    justify-content: flex-end;
}

.order-check-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.92rem;
    line-height: 1.3;
    cursor: pointer;
}

.order-check-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    flex-shrink: 0;
}

@media (max-width: 899px) {
    .order-visa-grid {
        grid-template-columns: 1fr;
    }
}

.order-tourists-mobile {
    display: none;
}

.order-tourists-table-wrap {
    min-width: 0;
}

.order-tourists-table {
    table-layout: auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.order-tourists-table .login-input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 2.25rem;
    margin: 0;
    padding: 0 0.45rem;
    font-size: 0.88rem;
    line-height: 1.2;
}

.order-tourists-table select.login-input {
    padding-right: 1.35rem;
    background-position: right 0.35rem center;
}

.order-tourists-table input[type="date"].login-input {
    min-width: 0;
    padding-right: 0.15rem;
}

.order-tourists-table input[type="date"].login-input::-webkit-datetime-edit,
.order-tourists-table input[type="date"].login-input::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
    margin: 0;
    line-height: 1.2;
}

.order-tourists-table input[type="date"].login-input::-webkit-calendar-picker-indicator {
    margin: 0;
    padding: 0;
}

.order-tourists-table th.order-tourist-actions-col,
.order-tourists-table td.order-tourist-actions,
.order-tourists-table th.order-pay-actions,
.order-tourists-table td.order-pay-actions {
    width: 1%;
    min-width: 2.5rem;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
}

.order-tourists-table th.order-tourist-facts-col,
.order-tourists-table td.order-tourist-facts {
    vertical-align: middle;
    text-align: left;
    white-space: normal;
}

/* Desktop: каждый турист — две строки полей (как раньше), в рамке staff/pay */
@media (min-width: 900px) {
    .order-tourists-table-wrap {
        overflow: visible;
        border: none;
        background: transparent;
    }

    .order-tourists-table,
    .order-tourists-table tbody {
        display: block;
        width: 100%;
    }

    .order-tourists-table thead {
        display: none;
    }

    .order-tourists-table tr.order-tourist-row {
        display: grid;
        /* 1 Пол/Документ · 2 ФИО/Номер · 3 ФИ/Кем · 4 ДР/Выдача · 5 facts/Виза */
        grid-template-columns: minmax(9.5rem, 0.9fr) minmax(0, 1.7fr) minmax(0, 1.15fr) minmax(8.5rem, 0.95fr) minmax(11rem, 1.2fr);
        gap: 0.55rem 0.55rem;
        position: relative;
        align-items: start;
        margin: 0 0 0.75rem;
        padding: 0.65rem 2.4rem 0.75rem 0.75rem;
        border: 1px solid var(--rt-border, #dcdcdc);
        background: var(--rt-surface, #fff);
    }

    .order-tourists-table tr.order-tourist-row > td {
        display: block;
        min-width: 0;
        padding: 0;
        margin: 0;
        border: 0 !important;
        background: transparent;
    }

    .order-tourists-table tr.order-tourist-row > td.order-tourist-facts {
        align-self: end;
        min-width: 0;
        width: auto;
        white-space: normal;
        text-align: left;
        overflow-wrap: break-word;
    }

    .order-tourists-table tr.order-tourist-row > td.order-tourist-actions,
    .order-tourists-table tr.order-tourist-row > td.order-pay-actions {
        position: absolute !important;
        top: 0.55rem;
        right: 0.35rem;
        left: auto;
        width: 2rem;
        min-width: 0;
        padding: 0;
        border: none !important;
        background: transparent !important;
        z-index: 2;
    }

    .order-tourists-table tr.order-tourist-empty {
        display: block;
        margin: 0 0 0.5rem;
        padding: 0.65rem 0.75rem;
        border: 1px solid var(--rt-border, #dcdcdc);
        background: var(--rt-surface, #fff);
    }

    .order-tourists-table tr.order-tourist-empty td {
        display: block;
        padding: 0;
        border: 0 !important;
    }

    .order-tourist-col-label {
        display: block;
        margin: 0 0 0.28rem;
        font-size: 0.72rem;
        font-weight: 600;
        line-height: 1.15;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        white-space: nowrap;
        color: var(--rt-muted);
    }
}

.order-tourist-del-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--rt-muted);
    cursor: pointer;
    border-radius: 0.25rem;
}

.order-tourist-del-icon input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.order-tourist-del-icon:hover,
.order-tourist-del-icon:focus {
    color: var(--rt-red);
    background: rgba(238, 28, 36, 0.08);
}

.order-tourist-del-icon:has(input:checked),
.order-tourist-row.is-marked-delete .order-tourist-del-icon {
    color: var(--rt-red);
}

.order-tourist-row.is-marked-delete {
    opacity: 0.45;
}

.order-tourists-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
    justify-content: space-between;
    margin: 0.75rem 0 0;
}

.order-tourists-toolbar .login-note {
    margin: 0;
    flex: 1 1 12rem;
}

.order-tourist-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    margin-left: auto;
    padding: 0.55rem 1.1rem;
    min-height: 2.4rem;
    font-family: var(--rt-font);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    background: var(--rt-green);
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    white-space: nowrap;
}

.order-tourist-add-btn:hover {
    background: var(--rt-green-dark);
}

.order-tourist-birth,
.order-tourist-pass-date {
    min-width: 0;
}

.order-tourist-hint {
    text-align: left;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--rt-muted);
    white-space: normal;
}

.order-tourist-hint:empty {
    display: none;
}

.order-tourist-hint-line + .order-tourist-hint-line {
    margin-top: 0.15rem;
}

.order-tourist-hint-line--flag {
    display: inline-block;
    max-width: 100%;
    padding: 0.05rem 0.35rem;
    color: var(--rt-error);
    font-weight: 700;
    background: var(--rt-error-bg);
    border-radius: 4px;
}

.order-tourists-table.staff-table th,
.order-tourists-table.staff-table td {
    border: 1px solid var(--rt-border, #dcdcdc);
}

.order-tourists-table.staff-table th.order-tourist-actions-col,
.order-tourists-table.staff-table td.order-tourist-actions,
.order-tourists-table.staff-table th.order-tourist-facts-col,
.order-tourists-table.staff-table td.order-tourist-facts {
    border: none;
}

.order-services-table-wrap {
    margin-top: 0.75rem;
}

.order-services-table {
    table-layout: auto;
    width: 100%;
    max-width: 100%;
}

.order-services-table th:first-child,
.order-services-table td:first-child {
    width: 14rem;
    max-width: 18rem;
    white-space: normal;
    vertical-align: top;
}

.order-services-table.staff-table th,
.order-services-table.staff-table td {
    border: 1px solid var(--rt-border, #dcdcdc);
}

.order-services-table .login-input,
.order-services-table textarea.login-input {
    width: 100%;
    max-width: 28rem;
    min-width: 0;
    box-sizing: border-box;
}

.order-extras-block .order-extras-booking {
    margin-bottom: 0.75rem;
}

.order-extras-block {
    max-width: none;
}

.order-tourist-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--rt-border);
}

.order-tourist-item:last-child {
    border-bottom: none;
}

.order-form-sticky {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
    margin: 1.25rem 0 0;
    padding: 0.75rem 0;
    background: var(--rt-bg);
    border-top: 1px solid var(--rt-border);
    box-shadow: 0 -6px 16px -10px var(--rt-shadow);
}

.order-sticky-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-right: 0.25rem;
}

.order-sticky-nav-btn {
    white-space: nowrap;
}

.order-sticky-num {
    display: none;
    font-weight: 700;
    min-width: 1.25em;
    text-align: center;
}

.order-sticky-label {
    display: inline;
}

.order-buffer-flag {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    color: var(--rt-muted, #6b7280);
}
.order-buffer-flag.is-on {
    background: var(--rt-green, #1a7f37);
    border-color: var(--rt-green, #1a7f37);
    color: #fff;
}
.order-status-sidebtn {
    margin-top: 0.45rem;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: auto;
    max-width: 100%;
    min-height: 2.5rem;
    height: auto;
    padding: 0.55rem 0.9rem;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}

.order-status-sidebtn .order-pay-ico {
    display: block;
    flex: 0 0 auto;
}

.order-status-sidebtn.staff-btn--danger:hover {
    border-color: var(--rt-red);
    color: #fff;
}
.order-sticky-save {
    margin-left: auto;
}

.order-sticky-save[hidden] {
    display: none !important;
}

.order-form-sticky .login-btn,
.order-form-sticky .staff-btn {
    margin: 0;
    padding: 0.65rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    min-height: 2.7rem;
    box-sizing: border-box;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.order-sec-anchor {
    display: block;
    height: 0;
    overflow: hidden;
}

.order-messages-sec,
.order-docs-sec,
.order-payments-sec {
    margin-top: 1.5rem;
    scroll-margin-top: 1rem;
}

/* Разделитель между секциями 1→2, 2→3, 3→4 */
#order-form,
.order-messages-sec,
.order-docs-sec {
    padding-bottom: 1.25rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--rt-border);
}

#order-sec-1 {
    scroll-margin-top: 1rem;
}

.order-chat {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 1040px;
    width: 100%;
    box-sizing: border-box;
    padding: 0.35rem 0.15rem 1.25rem;
    margin-bottom: 0;
}

.order-chat-empty {
    margin: 0;
    color: var(--rt-muted, #6b7280);
    font-size: 0.95rem;
}

.order-chat-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.order-chat-msg {
    display: flex;
    width: 100%;
}

.order-chat-msg--mine {
    justify-content: flex-end;
}

.order-chat-msg--theirs {
    justify-content: flex-start;
}

.order-chat-bubble {
    max-width: min(calc(34rem + 100px), 88%);
    padding: 0.55rem 0.8rem;
    border-radius: 0.65rem;
    border: 1px solid var(--rt-border);
    background: var(--rt-surface, #fff);
}

.order-chat-msg--mine .order-chat-bubble {
    background: #e8f0fe;
    border-color: #c5d4f0;
}

.order-chat-msg--system .order-chat-bubble {
    background: #fff7ed;
    border-color: #fed7aa;
}

html[data-theme="dark"] .order-chat-bubble {
    color: var(--rt-text);
}

html[data-theme="dark"] .order-chat-msg--mine .order-chat-bubble {
    background: #1c2838;
    border-color: #3d5270;
    color: #e7eef8;
}

html[data-theme="dark"] .order-chat-msg--system .order-chat-bubble {
    background: #2a2418;
    border-color: #5c4a30;
    color: #f4ead8;
}

.order-chat-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    align-items: baseline;
    margin-bottom: 0.2rem;
    font-size: 0.82rem;
}

.order-chat-author {
    font-weight: 700;
}

.order-chat-date {
    opacity: 0.7;
}

.order-chat-subject {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    opacity: 0.9;
}

.order-chat-text {
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
}
.order-chat-read {
    margin-top: 0.45rem;
    font-size: 0.82rem;
    opacity: 0.8;
}
.order-chat-read-btn {
    margin-top: 0.45rem;
}
.order-docs-upload.is-busy {
    opacity: 0.65;
    pointer-events: none;
}
.order-pay-refund {
    margin-bottom: 1.25rem;
}
.order-refund-dialog {
    max-width: 36rem;
}
.order-refund-sum {
    color: #b42318;
}
.order-refund-check {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 0.75rem 0;
}
.order-refund-note {
    color: #b42318;
}
.order-refund-actions {
    margin-top: 0.75rem;
}

#order-chat-text {
    height: 90px;
    min-height: 90px;
    resize: vertical;
    box-sizing: border-box;
}

/* Классы из online2 (base_new / order) для HTML в системных и админских сообщениях */
.order-chat-text .order-chat-file {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.order-chat-text .order-chat-file:hover {
    opacity: 0.85;
}

.order-chat-text .font_bold { font-weight: bold !important; }
.order-chat-text .font_normal { font-weight: normal !important; }
.order-chat-text .font_12 { font-size: 12px; }
.order-chat-text .font_14 { font-size: 14px; }
.order-chat-text .red { color: red; }
.order-chat-text .f-red { color: #bb0000; }
.order-chat-text .grey { color: grey; }
.order-chat-text .green { color: green !important; }
.order-chat-text .text-danger { color: #a94442; }
.order-chat-text .text-success { color: #3c763d; }

html[data-theme="dark"] .order-chat-text .red,
html[data-theme="dark"] .order-chat-text .f-red,
html[data-theme="dark"] .order-chat-text .text-danger {
    color: #ff8d8d;
}
html[data-theme="dark"] .order-chat-text .grey {
    color: #c4c4c4;
}
html[data-theme="dark"] .order-chat-text .green,
html[data-theme="dark"] .order-chat-text .text-success {
    color: #9dce7a !important;
}

/* Полная ширина секции — как border-bottom у .order-messages-sec */
.order-messages-compose-rule {
    border-bottom: 1px solid var(--rt-border);
    margin: 0.25rem 0 0;
    padding: 0;
}

.order-chat-compose {
    display: grid;
    grid-template-columns: 1fr minmax(12rem, 16rem);
    gap: 0.85rem 1rem;
    align-items: start;
    max-width: 1040px;
    width: 100%;
    box-sizing: border-box;
    padding-top: 1.25rem;
    margin-top: 0.25rem;
}

.order-chat-compose-side {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.order-chat-compose-side .login-btn {
    width: 100%;
    position: relative;
}

.order-chat-send-loader {
    display: none;
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: order-chat-spin 0.7s linear infinite;
    vertical-align: middle;
}

#order-chat-send.is-loading .order-chat-send-loader {
    display: inline-block;
}

#order-chat-send.is-loading .order-chat-send-label[hidden] {
    display: none;
}

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

.order-chat-err {
    color: #b91c1c;
    margin: 0;
}

.order-docs-subh {
    margin: 1.1rem 0 0.45rem;
    font-size: 0.9rem;
    font-weight: 700;
}

.order-docs-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0 0 0.35rem;
}

.order-docs-tip {
    display: inline-flex;
}

.order-docs-tip .order-docs-action:disabled {
    pointer-events: none;
}

#agent-dogovor-form .order-docs-actions {
    align-items: stretch;
}

#agent-dogovor-form .order-docs-actions .login-btn {
    margin-top: 0;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
}

.order-docs-action.staff-btn {
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
    min-height: 2.5rem;
    height: auto;
    padding: 0.55rem 0.9rem;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: normal;
    text-align: center;
}

.order-docs-action:disabled,
.order-docs-action.is-soon:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    color: var(--rt-muted, #6b7280);
    background: var(--rt-bg, #f3f4f6);
    border-color: var(--rt-border);
}

.order-docs-action:disabled:hover,
.order-docs-action.is-soon:disabled:hover {
    color: var(--rt-muted, #6b7280);
    border-color: var(--rt-border);
}

.order-docs-upload-btn.staff-btn {
    min-height: 2.5rem;
    height: 2.5rem;
    padding: 0 1rem;
    font-size: 0.88rem;
    line-height: 1.2;
    white-space: nowrap;
}

.order-statement-dialog,
.order-doc-dialog {
    width: min(92vw, 32rem);
}

.order-doc-dialog--md {
    width: min(94vw, 38rem);
}

.order-doc-dialog--wide {
    width: min(96vw, 52rem);
}

.order-statement-note,
.order-doc-note {
    margin: 0 0 0.85rem;
    line-height: 1.45;
}

.order-doc-modal-body > .login-note,
.order-doc-modal-body > .order-doc-warn,
.order-doc-modal-body > .order-doc-info {
    margin: 0 0 0.75rem;
    line-height: 1.45;
}

.order-doc-warn {
    color: #9a3412;
}

html[data-theme="dark"] .order-doc-warn {
    color: #fdba74;
}

.order-doc-info {
    color: var(--rt-muted, #6b7280);
}

.order-statement-field,
.order-doc-field {
    display: block;
    margin: 0 0 0.75rem;
}

.order-statement-field .order-field-label,
.order-doc-field .order-field-label {
    display: block;
    margin: 0 0 0.3rem;
    font-size: 0.88rem;
    font-weight: 600;
}

.order-statement-field .login-input,
.order-doc-field .login-input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
}

.order-doc-field-hint {
    display: block;
    margin: 0.3rem 0 0;
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--rt-muted, #6b7280);
}

.order-doc-commis-suggest {
    display: inline-block;
    margin: 0.35rem 0 0;
    padding: 0.2rem 0.55rem;
    font: inherit;
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--rt-text, #161616);
    background: transparent;
    border: 1px dashed var(--rt-border, #c4c4c4);
    border-radius: 2px;
    cursor: pointer;
    text-align: left;
}

.order-doc-commis-suggest:hover,
.order-doc-commis-suggest:focus {
    border-color: var(--rt-accent, #ee1c24);
    outline: none;
}

.order-doc-sums {
    display: grid;
    gap: 0.15rem 0.85rem;
    margin: 0 0 0.25rem;
}

@media (min-width: 640px) {
    .order-doc-sums--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.order-statement-dialog .access-delete-modal-actions .staff-btn,
.order-doc-dialog .access-delete-modal-actions .staff-btn {
    min-height: 2.5rem;
    height: 2.5rem;
    padding: 0 1rem;
    font-size: 0.88rem;
    line-height: 1.2;
}

.order-doc-modal-body--scroll {
    max-height: min(78vh, 40rem);
    overflow: auto;
}

.order-doc-grid2,
.order-doc-grid3 {
    display: grid;
    gap: 0.65rem 0.85rem;
}

.order-doc-grid2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-doc-grid3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 720px) {
    .order-doc-grid2,
    .order-doc-grid3 {
        grid-template-columns: 1fr;
    }
}

.order-doc-fieldset {
    margin: 0 0 1rem;
    padding: 0.75rem 0.85rem 0.25rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.35rem;
}

.order-doc-fieldset[hidden],
#order-pay-cash-modal.is-cash-from-center [data-cash-issuer="agent"],
#order-pay-cash-modal.is-cash-from-agent [data-cash-issuer="company"] {
    display: none !important;
}

.order-doc-fieldset legend {
    padding: 0 0.35rem;
    font-size: 0.9rem;
    font-weight: 650;
}

.order-doc-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 0.55rem;
    font-size: 0.9rem;
}

.order-doc-tourist-row {
    margin: 0 0 0.75rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.order-doc-tourist-row:last-child {
    border-bottom: 0;
}

.order-docs-filelist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.order-docs-file {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
    font-size: 0.92rem;
}

.order-docs-file-date,
.order-docs-file-size {
    opacity: 0.7;
    font-size: 0.85rem;
}

.order-docs-file-link {
    color: inherit;
    font-weight: 600;
}

.order-docs-upload {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    margin: 0 0 0.65rem;
}

.order-docs-upload-btn {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    margin: 0;
}

.order-docs-upload-btn .order-docs-file-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}

.order-docs-progress {
    flex: 1 1 12rem;
    max-width: 18rem;
    height: 0.55rem;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.order-docs-progress-bar {
    height: 100%;
    width: 0;
    background: var(--rt-accent, #2563eb);
    transition: width 0.15s linear;
}

.order-docs-upload-err {
    color: #b91c1c;
    margin: 0;
    width: 100%;
}

.order-docs-file--agent {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 0.35rem;
    padding: 0.35rem 0.5rem;
}

html[data-theme="dark"] .order-docs-file--agent {
    background: #2a2418;
    border-color: #5c4a30;
    color: #f4ead8;
}

html[data-theme="dark"] .order-docs-file--agent .order-docs-file-tag {
    color: #fdba74;
}

.order-docs-file-tag {
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: lowercase;
    letter-spacing: 0.02em;
    color: #9a3412;
    background: #ffedd5;
    border-radius: 0.25rem;
    padding: 0.1rem 0.4rem;
}

.order-docs-file-del {
    margin-left: 0.15rem;
    border: 0;
    background: transparent;
    color: #b91c1c;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.1rem 0.25rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.order-docs-file-del:hover {
    opacity: 0.75;
}

.order-docs-file-del:disabled {
    opacity: 0.4;
    cursor: wait;
}

@media (max-width: 720px) {
    .order-chat-compose {
        grid-template-columns: 1fr;
    }

    .order-sticky-nav {
        width: 100%;
    }

    .order-sticky-label {
        display: none;
    }

    .order-sticky-num {
        display: inline;
    }

    .order-form-sticky .login-btn,
    .order-form-sticky .staff-btn {
        font-size: 0.92rem;
        padding: 0.55rem 0.75rem;
    }

    .order-form-sticky .order-sticky-nav-btn {
        min-width: 2.7rem;
        padding-left: 0.7rem;
        padding-right: 0.7rem;
        justify-content: center;
    }
}

.order-hotel-picker {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.3rem;
    min-width: 0;
    width: 100%;
}

.order-dict-wrap {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    min-width: 0;
    width: 100%;
}

.order-route-table-wrap,
.order-living-table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.order-route-sheet,
.order-living-sheet {
    table-layout: fixed;
    width: 100%;
    max-width: 100%;
}

.order-route-sheet.staff-table th,
.order-route-sheet.staff-table td,
.order-living-sheet.staff-table th,
.order-living-sheet.staff-table td {
    border: 1px solid var(--rt-border, #dcdcdc);
    padding: 0.45rem 0.5rem;
    vertical-align: middle;
}

.order-route-sheet th:nth-child(5),
.order-route-sheet th:nth-child(6),
.order-route-sheet td:nth-child(5),
.order-route-sheet td:nth-child(6) {
    width: 7.25rem;
}

.order-living-sheet:not(.order-living-sheet--hotel) th:nth-child(1),
.order-living-sheet:not(.order-living-sheet--hotel) td:nth-child(1) {
    width: auto;
}

.order-living-sheet:not(.order-living-sheet--hotel) th:nth-child(2),
.order-living-sheet:not(.order-living-sheet--hotel) td:nth-child(2) {
    width: 7.5rem;
}

.order-living-sheet:not(.order-living-sheet--hotel) th:nth-child(3),
.order-living-sheet:not(.order-living-sheet--hotel) td:nth-child(3) {
    width: 4.75rem;
}

.order-living-sheet:not(.order-living-sheet--hotel) th:nth-child(4),
.order-living-sheet:not(.order-living-sheet--hotel) th:nth-child(5),
.order-living-sheet:not(.order-living-sheet--hotel) td:nth-child(4),
.order-living-sheet:not(.order-living-sheet--hotel) td:nth-child(5) {
    width: 9rem;
}

.order-living-sheet--hotel th:nth-child(3),
.order-living-sheet--hotel th:nth-child(4),
.order-living-sheet--hotel td:nth-child(3),
.order-living-sheet--hotel td:nth-child(4) {
    width: 7.25rem;
}

.order-living-sheet--hotel th:nth-child(2),
.order-living-sheet--hotel td:nth-child(2) {
    width: 8.5rem;
}

.order-living-sheet--hotel th:nth-child(6),
.order-living-sheet--hotel td:nth-child(6) {
    width: 4.75rem;
}


.order-route-sheet .login-input,
.order-living-sheet .login-input,
.order-dict-wrap .login-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: 100%;
    height: 2.35rem;
    min-height: 2.35rem;
    max-height: 2.35rem;
    margin: 0;
    padding: 0 0.45rem;
    font-size: 0.875rem;
    line-height: 1.2;
    box-sizing: border-box;
}

.order-dict-wrap > .login-input,
.order-dict-wrap > .order-hotel-name {
    border-right-width: 0;
}

.order-route-sheet select.login-input,
.order-living-sheet select.login-input,
.order-dict-wrap select.login-input {
    padding-right: 1.6rem;
    background-position: right 0.45rem center;
    background-size: 0.65rem auto;
}

.order-route-sheet input[type="date"].login-input,
.order-living-sheet input[type="number"].login-input {
    padding-right: 0.25rem;
}

.order-services-block .order-services-select {
    max-width: 16rem;
}

.order-extras-booking {
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
}

.order-extras-booking .order-form-h-row--inline {
    margin: 0;
}

.order-hotelext-hint {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--rt-muted);
}

.order-hotelext-sheet {
    table-layout: fixed;
    max-width: 44rem;
}

.order-hotelext-sheet th {
    width: 11rem;
    text-align: left;
    font-weight: 600;
    vertical-align: top;
}

.order-hotelext-sheet td {
    vertical-align: top;
}

.order-hotelext-sheet .login-input,
.order-hotelext-sheet textarea.login-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.order-hotelext-sheet select.login-input {
    max-width: 16rem;
}

.order-form-h-row--inline {
    margin: 0 0 0.35rem;
}

.order-hotelext-booking-label {
    font-size: 0.9rem;
    font-weight: 700;
}

.order-booking-inline th {
    background: rgba(0, 0, 0, 0.02);
}


.order-dict-dots {
    flex: 0 0 2.1rem;
    width: 2.1rem;
    min-width: 2.1rem;
    height: 2.35rem;
    min-height: 2.35rem;
    max-height: 2.35rem;
    padding: 0;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    box-sizing: border-box;
}

.order-hotel-name {
    flex: 1 1 auto;
    min-width: 0;
    height: 2.35rem;
    min-height: 2.35rem;
    max-height: 2.35rem;
    padding: 0 0.45rem;
    border: 1px solid var(--rt-border);
    background: var(--rt-surface);
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 2.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.order-hotel-dialog {
    width: min(96vw, 40rem);
}

.order-hotel-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.55rem 0.75rem;
    margin: 0 0 0.75rem;
}

#od-country-row[hidden] {
    display: none !important;
}

.order-hotel-results {
    max-height: 16rem;
    overflow: auto;
    margin: 0 0 0.85rem;
    border-top: 1px solid var(--rt-border);
    border-bottom: 1px solid var(--rt-border);
}

.order-hotel-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.order-hotel-item,
.order-dict-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.35rem;
    border: 0;
    border-bottom: 1px solid var(--rt-border);
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.order-hotel-item:hover,
.order-hotel-item:focus,
.order-dict-item:hover,
.order-dict-item:focus {
    background: var(--rt-bg);
}

.order-hotel-add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.75rem;
    align-items: flex-end;
}

.order-hotel-add-row .login-btn {
    margin-bottom: 0;
}

@media (max-width: 899px) {
    .order-form-kpis {
        width: 100%;
    }

    /* Туристы / услуги / проезд / проживание — карточки вместо таблицы */
    .order-form-block--cards,
    .order-tourists-table-wrap,
    .order-services-table-wrap,
    .order-route-table-wrap,
    .order-living-table-wrap,
    .order-client-table-wrap,
    .order-money-table-wrap,
    .order-meta-table-wrap {
        overflow: visible;
        border: none;
        background: transparent;
    }

    .order-tourists-table,
    .order-services-table,
    .order-route-sheet,
    .order-living-sheet,
    .order-client-table,
    .order-money-table,
    .order-meta-table {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .order-tourists-table thead,
    .order-services-table thead,
    .order-route-sheet thead,
    .order-living-sheet thead,
    .order-client-table thead,
    .order-money-table thead,
    .order-meta-table thead {
        display: none;
    }

    .order-tourists-table tbody,
    .order-services-table tbody,
    .order-route-sheet tbody,
    .order-living-sheet tbody,
    .order-client-table tbody,
    .order-money-table tbody,
    .order-meta-table tbody {
        display: block;
    }

    .order-tourists-table tr.order-tourist-row,
    .order-services-table tbody tr,
    .order-route-sheet tbody tr,
    .order-living-sheet tbody tr,
    .order-client-table tbody tr,
    .order-money-table tbody tr,
    .order-meta-table tbody tr {
        display: block;
        position: relative;
        margin: 0 0 0.85rem;
        padding: 0.7rem 0.75rem 0.35rem;
        border: 1px solid var(--rt-border);
        border-radius: 0.4rem;
        background: var(--rt-surface);
    }

    .order-tourists-table tr.order-tourist-row {
        margin-bottom: 0.85rem;
        padding-right: 2.6rem;
    }

    .order-tourist-col-label {
        display: none;
    }

    .order-tourists-table tr.order-tourist-row > td.order-tourist-facts {
        display: block;
        grid-template-columns: none;
        padding-top: 0.15rem;
        border-bottom: 0;
    }

    .order-tourists-table tr.order-tourist-empty {
        display: block;
        padding: 0.75rem;
        border: 1px solid var(--rt-border);
        border-radius: 0.4rem;
        background: var(--rt-surface);
    }

    .order-tourists-table tr.order-tourist-empty td {
        display: block;
        padding: 0 !important;
        border: 0 !important;
    }

    .order-tourists-table tr.order-tourist-row > td,
    .order-services-table tbody tr > td,
    .order-route-sheet tbody tr > td,
    .order-living-sheet tbody tr > td,
    .order-client-table:not(.order-client-table--kv) tbody tr > td,
    .order-meta-table tbody tr > td {
        display: -ms-grid;
        display: grid;
        -ms-grid-columns: minmax(6.5rem, 38%) minmax(0, 1fr);
        grid-template-columns: minmax(6.5rem, 38%) minmax(0, 1fr);
        gap: 0.35rem 0.65rem;
        align-items: center;
        width: 100%;
        box-sizing: border-box;
        padding: 0.4rem 0;
        border: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    html[data-theme="dark"] .order-tourists-table tr.order-tourist-row > td,
    html[data-theme="dark"] .order-services-table tbody tr > td,
    html[data-theme="dark"] .order-route-sheet tbody tr > td,
    html[data-theme="dark"] .order-living-sheet tbody tr > td,
    html[data-theme="dark"] .order-client-table:not(.order-client-table--kv) tbody tr > td,
    html[data-theme="dark"] .order-meta-table tbody tr > td {
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    .order-tourists-table tr.order-tourist-row > td:last-child,
    .order-services-table tbody tr > td:last-child,
    .order-route-sheet tbody tr > td:last-child,
    .order-living-sheet tbody tr > td:last-child,
    .order-client-table:not(.order-client-table--kv) tbody tr > td:last-child,
    .order-meta-table tbody tr > td:last-child {
        border-bottom: 0;
    }

    .order-tourists-table tr.order-tourist-row > td[data-label]::before,
    .order-services-table tbody tr > td[data-label]::before,
    .order-route-sheet tbody tr > td[data-label]::before,
    .order-living-sheet tbody tr > td[data-label]::before,
    .order-client-table:not(.order-client-table--kv) tbody tr > td[data-label]::before,
    .order-meta-table tbody tr > td[data-label]::before {
        content: attr(data-label);
        font-size: 0.75rem;
        font-weight: 600;
        line-height: 1.3;
        color: var(--rt-muted);
    }

    .order-meta-table .login-input,
    .order-meta-table .order-cell-text,
    .order-meta-table .order-pct-ctrl {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    /* В карточке услуги / реквизитов подпись уже в первой ячейке — не дублировать ::before */
    .order-services-table tbody tr > td:first-child,
    .order-client-table--kv tbody tr > td:first-child {
        display: block;
        padding-bottom: 0.15rem;
        border-bottom: 0;
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--rt-muted);
    }

    .order-services-table tbody tr > td:first-child::before,
    .order-client-table--kv tbody tr > td:first-child::before {
        content: none;
    }

    .order-client-table--kv tbody tr > td {
        display: block;
        width: 100%;
        box-sizing: border-box;
        padding: 0.35rem 0;
        border: 0;
    }

    .order-client-table--kv tbody tr > td:last-child {
        padding-top: 0;
    }

    .order-client-table .login-input,
    .order-client-table .order-pct-ctrl {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .order-tourists-table tr.order-tourist-row > td.order-tourist-actions {
        position: absolute;
        top: 0.45rem;
        right: 0.35rem;
        display: block;
        width: auto;
        min-width: 0;
        padding: 0;
        border: 0;
        grid-template-columns: none;
    }

    .order-tourists-table tr.order-tourist-row > td.order-tourist-actions::before {
        content: none;
    }

    .order-tourists-table .login-input,
    .order-services-table .login-input,
    .order-services-table textarea.login-input,
    .order-route-sheet .login-input,
    .order-living-sheet .login-input,
    .order-tourists-table .order-cell-text,
    .order-services-table .order-cell-text,
    .order-route-sheet .order-cell-text,
    .order-living-sheet .order-cell-text,
    .order-living-sheet .order-hotel-picker {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .order-route-sheet tbody tr > td:nth-child(5),
    .order-route-sheet tbody tr > td:nth-child(6) {
        width: 100%;
        max-width: none;
    }

    .order-route-sheet input[type="date"].login-input {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .order-living-sheet:not(.order-living-sheet--hotel) tbody tr > td:nth-child(n),
    .order-living-sheet--hotel tbody tr > td:nth-child(n) {
        width: 100%;
        max-width: none;
    }

    .order-living-sheet input[type="date"].login-input,
    .order-living-sheet input[type="number"].login-input {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .order-tourists-table .order-tourist-birth,
    .order-tourists-table .order-tourist-pass-date {
        min-width: 0;
    }

    .order-living-sheet .order-cell-narrow {
        max-width: none;
    }

    .order-tourist-hint {
        font-size: 0.8rem;
        line-height: 1.35;
        color: var(--rt-muted);
    }
}

.orders-id a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.orders-id a:hover {
    color: var(--rt-accent, #0a6);
}

.order-card-num a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.12em;
}

.dict-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    margin: 0 0 1rem;
}

.dict-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.dict-search-form .login-input {
    flex: 1 1 12rem;
    min-width: 8rem;
    max-width: 24rem;
    margin: 0;
}

.dict-list-toolbar > .admin-export-btn {
    flex: 0 0 auto;
    margin-left: auto;
}

.dict-refs-trigger {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 0.15em;
    cursor: pointer;
}

.dict-refs-trigger--th {
    font-weight: 700;
}

.dict-refs-trigger:hover,
.dict-refs-trigger:focus {
    color: var(--rt-accent, #0a6);
}

.dict-refs-dialog {
    width: min(92vw, 34rem);
}

.dict-refs-table-wrap {
    max-height: min(50vh, 22rem);
    overflow: auto;
}

.dict-refs-table code,
.dict-refs-card code {
    font-size: 0.85em;
    word-break: break-all;
}

.dict-refs-cards .dict-refs-card {
    margin-bottom: 0.65rem;
}

.dict-refs-cards .dict-refs-card:last-child {
    margin-bottom: 0;
}

.operators-form.is-readonly fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.operators-form fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

/* ——— Платежи (карточка заявки) ——— */
.order-agency-debt {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--rt-border, #d1d5db);
    background: #fef2f2;
    text-align: center;
}
html[data-theme="dark"] .order-agency-debt {
    background: rgba(185, 28, 28, 0.15);
}
.order-agency-debt-sum {
    margin: 0;
    color: #b91c1c;
    font-size: 1.05rem;
}
.order-agency-debt-sum strong {
    font-weight: 700;
}
.order-agency-debt-more {
    border: 0;
    background: transparent;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
    padding: 0;
}
.order-agency-debt-detail {
    margin-top: 0.85rem;
    text-align: left;
}
.order-agency-debt-bucket {
    margin: 0.75rem 0 0.4rem;
    font-size: 0.95rem;
}

.order-pay-subh {
    margin: 0 0 0.65rem;
    font-size: 1rem;
    font-weight: 650;
}
.order-pay-netcost {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.85rem;
    align-items: flex-end;
    margin: 0 0 0.85rem;
}
.order-pay-netcost-check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.92rem;
    cursor: pointer;
    flex: 1 1 100%;
    margin: 0;
}
.order-pay-netcost-check input {
    margin: 0;
}
.order-pay-netcost .order-pay-form-field {
    flex: 0 0 auto;
    min-width: 0;
    width: auto;
    max-width: none;
}
.order-pay-netcost-sum-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.order-pay-netcost-sum-row .login-input {
    width: 9rem;
    max-width: 9rem;
}
.order-pay-unit {
    color: var(--rt-muted, #6b7280);
    font-size: 0.9rem;
    line-height: 1;
    white-space: nowrap;
}
.order-pay-netcost .order-pay-form-field .login-input {
    width: 9rem;
}
.order-pay-table--seb {
    min-width: 0;
}
.order-pay-block,
.order-pay-acquire {
    margin-bottom: 1.25rem;
}
.order-pay-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.85rem;
    align-items: flex-end;
    margin: 0 0 0.75rem;
}
.order-pay-form .order-field {
    min-width: 8rem;
}
.order-pay-acquire-form {
    flex-wrap: nowrap;
    align-items: flex-end;
}
.order-pay-acquire-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.85rem;
    margin-left: auto;
    justify-content: flex-end;
}
.order-pay-btn {
    margin: 0;
}
@media (max-width: 720px) {
    .order-pay-acquire-form {
        flex-wrap: wrap;
    }
    .order-pay-acquire-actions {
        margin-left: 0;
        justify-content: flex-start;
    }
}
.pay-page {
    max-width: 1040px;
}
.pay-page .op-tabs {
    margin-top: 2rem;
}
.pay-qr-layout {
    display: flex;
    align-items: flex-start;
    gap: 1.75rem;
    margin: 0.35rem 0 1.25rem;
}
.pay-qr-layout .pay-account-qr {
    margin: 0;
}
.pay-qr-side {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 0.15rem;
}
.pay-qr-sum {
    margin: 0 0 0.85rem;
    font-size: 1.2rem;
    font-weight: 600;
}
.pay-qr-req {
    display: grid;
    grid-template-columns: 7.2rem minmax(0, 1fr);
    gap: 0.1rem 0.75rem;
    margin: 0 0 0.35rem;
    line-height: 1.35;
}
.pay-qr-req span:first-child {
    color: var(--rt-muted, #6b7280);
}
@media (max-width: 720px) {
    .pay-qr-layout {
        flex-direction: column;
        gap: 0.85rem;
    }
}
html[data-theme="dark"] #pay-sbp-qr,
html[data-theme="dark"] .pay-account-qr {
    background: #fff;
    padding: 12px;
}
button.op-tab {
    background: transparent;
    font: inherit;
    cursor: pointer;
}
.pay-qr-panel[hidden] {
    display: none;
}
.pay-account-qr {
    display: block;
    width: 220px;
    height: auto;
    margin: 0.5rem 0 1rem;
}
.pay-page .staff-table-wrap {
    margin: 0 0 1rem;
}
.pay-warn {
    color: #b42318;
    font-weight: 600;
}
.pay-email {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 0.85rem;
    margin: 0.75rem 0 1rem;
}
.pay-email label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.pay-email .login-input {
    display: block;
    width: 22rem;
    max-width: 100%;
    margin: 0;
}
.pay-email .login-btn {
    margin-top: 0;
}
.pay-email-note {
    flex: 1 1 16rem;
    max-width: 36rem;
    padding-bottom: 0.45rem;
}
.order-pay-table-wrap {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.order-pay-table {
    table-layout: auto;
    width: 100%;
    max-width: 100%;
}
.order-pay-table th,
.order-pay-table td {
    white-space: normal;
    overflow-wrap: break-word;
}
.order-pay-table .order-cell-num {
    display: table-cell;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.order-pay-table th.order-pay-actions,
.order-pay-table td.order-pay-actions {
    width: 1%;
    min-width: 7.4rem;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    text-align: right;
    vertical-align: middle;
    position: sticky;
    right: 0;
    z-index: 1;
}
.order-pay-table th.order-pay-actions {
    background: var(--rt-bg, #f6f6f6);
}
.order-pay-table td.order-pay-actions {
    display: table-cell;
    background: var(--rt-surface, #fff);
}
.order-pay-table td.order-pay-actions > .staff-btn,
.order-pay-table td.order-pay-actions > .login-btn {
    vertical-align: middle;
    margin-left: 0.35rem;
}
.order-pay-table td.order-pay-actions > .staff-btn:first-child,
.order-pay-table td.order-pay-actions > .login-btn:first-child {
    margin-left: 0;
}
.order-pay-total th {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.order-pay-table.staff-table th,
.order-pay-table.staff-table td {
    border: 1px solid var(--rt-border, #dcdcdc);
}
.order-pay-table.staff-table th.order-pay-actions,
.order-pay-table.staff-table td.order-pay-actions {
    border: none;
}
.order-pay-table input,
.order-pay-table select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.order-pay-data-row[hidden],
tr.order-pay-data-row[hidden] {
    display: none !important;
}
.order-pay-total-val-unit {
    font-weight: 400;
    color: var(--rt-muted, #6b7280);
    font-size: 0.85em;
}
.order-pay-input-row td {
    padding: 0.35rem 0.4rem;
    vertical-align: middle;
}
.order-pay-input-row .login-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    font-size: 0.88rem;
    padding: 0.35rem 0.45rem;
}
.order-pay-input-row select.login-input {
    padding: 0.35rem 0.4rem;
}
.order-pay-inline.is-edit-mode .order-pay-input-row {
    background: rgba(26, 127, 55, 0.04);
}
.order-pay-add {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
}
.order-pay-add-title {
    margin: 0 0 0.55rem;
    font-size: 0.95rem;
    font-weight: 600;
}
.order-pay-add-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.85rem;
    margin-bottom: 0.65rem;
}
.order-pay-add-grid .order-field {
    min-width: 9rem;
    flex: 1 1 9rem;
}
.order-pay-add-grid .order-field-grow {
    flex: 2 1 14rem;
}
.order-pay-inline-form {
    display: inline;
    margin: 0;
}
.order-pay-del {
    padding: 0.15rem 0.45rem;
    line-height: 1;
}
.order-pay-mobile {
    display: none;
}
.order-pay-card {
    border: 1px solid var(--rt-border, #d1d5db);
    border-radius: 6px;
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.55rem;
}
.order-pay-card-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.92rem;
    margin: 0.15rem 0;
}
.order-pay-card-note {
    margin-top: 0.35rem;
    color: var(--rt-muted, #6b7280);
    font-size: 0.88rem;
}
.order-pay-actions .login-btn,
.order-pay-card-actions .login-btn {
    margin-top: 0;
}
.order-pay-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}
.order-pay-short-info {
    margin: 0 0 0.85rem;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.45;
}
.order-pay-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 0 0 1rem;
    padding: 0.65rem 0.75rem;
    background: var(--rt-surface-muted, #f3f4f6);
    border-radius: 6px;
    font-size: 0.88rem;
}

html[data-theme="dark"] .order-pay-summary {
    background: #242426;
    color: var(--rt-text);
}

html[data-theme="dark"] .order-pay-summary-item strong {
    color: var(--rt-text);
}
.order-pay-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 5.5rem;
}
.order-pay-summary-item span {
    color: var(--rt-muted, #6b7280);
    font-size: 0.72rem;
    line-height: 1.2;
}
.order-pay-summary-actions {
    display: flex;
    align-items: flex-end;
    margin: 0;
}
.order-pay-summary-actions .order-docs-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.5rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.88rem;
}
.order-pay-summary-actions .order-docs-action:not(:disabled) {
    background: var(--rt-green);
    border-color: var(--rt-green);
    color: #fff;
}
.order-pay-summary-actions .order-docs-action:not(:disabled):hover {
    filter: brightness(1.08);
    color: #fff;
}
.order-pay-summary-actions .order-pay-ico {
    display: block;
    flex: 0 0 auto;
}
.order-pay-summary-item--flag {
    padding: 0.35rem 0.6rem;
    background: var(--rt-error-bg);
    border: 1px solid var(--rt-error);
    border-radius: 6px;
}
.order-pay-summary-item--flag span,
.order-pay-summary-item--flag strong {
    color: var(--rt-error);
    font-weight: 700;
}
.order-pay-detail-title {
    margin-top: 1.15rem;
}
.order-pay-seb-details {
    margin-top: 0;
}
.order-pay-currency-fields {
    display: contents;
}
.order-pay-submit:not(.order-pay-submit--add) {
    min-width: auto;
    width: auto;
    height: 2.25rem;
    min-height: 2.25rem;
    padding: 0 0.85rem !important;
    font-size: 0.88rem !important;
    font-weight: 600;
    line-height: 1;
    margin: 0 !important;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.order-pay-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    flex: 0 0 auto;
}
.order-pay-form-actions .login-btn,
.order-pay-form-actions .staff-btn {
    margin: 0 !important;
    white-space: nowrap;
    box-sizing: border-box;
    height: 2.25rem;
    min-height: 2.25rem;
    line-height: 1;
}
.order-pay-cancel[hidden] {
    display: none !important;
}
.order-pay-cancel:not([hidden]) {
    display: inline-flex;
    align-items: center;
    padding: 0 0.75rem;
    font-size: 0.88rem;
}
.order-pay-submit--add {
    background: var(--rt-green, #1a7f37) !important;
    border-color: var(--rt-green, #1a7f37) !important;
    color: #fff !important;
    min-width: 2.25rem !important;
    width: 2.25rem !important;
    max-width: 2.25rem !important;
    height: 2.25rem !important;
    min-height: 2.25rem !important;
    padding: 0 !important;
    font-size: 1.25rem !important;
    font-weight: 600;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.25rem;
}
.order-pay-submit--add:hover {
    filter: brightness(1.08);
}
.order-pay-log-btn {
    width: 2.25rem !important;
    min-width: 2.25rem !important;
    max-width: 2.25rem !important;
    height: 2.25rem !important;
    min-height: 2.25rem !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.25rem;
    line-height: 1;
}
.order-pay-log-dialog {
    width: min(94vw, 36rem);
}
.order-pay-log-body {
    max-height: 70vh;
    overflow: auto;
}
.order-pay-log-card {
    border: 1px solid var(--rt-border, #d1d5db);
    border-radius: 6px;
    padding: 0.7rem 0.85rem;
    margin: 0 0 0.55rem;
    background: var(--rt-surface, #fff);
}
.order-pay-log-card:last-child {
    margin-bottom: 0;
}
.order-pay-log-card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
}
.order-pay-log-card-top span {
    color: var(--rt-muted, #6b7280);
    text-align: right;
}
.order-pay-log-text {
    margin: 0.45rem 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.8rem;
    line-height: 1.35;
}
.order-pay-netcost .order-pay-submit {
    margin: 0 !important;
    height: 2.25rem;
    min-height: 2.25rem;
    padding: 0 0.85rem !important;
    font-size: 0.88rem !important;
}
.order-pay-debt-warn {
    color: #b91c1c;
    font-weight: 700;
}
.order-pay-course-hint {
    margin: 0.5rem 0 0;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 0.85rem;
    text-align: right;
}
.order-pay-course-hint--warn {
    color: #b91c1c;
}
.order-pay-form-panel {
    display: none;
    flex-wrap: wrap;
    gap: 0.5rem 0.65rem;
    align-items: flex-end;
    margin-top: 0.65rem;
    padding: 0.65rem 0.5rem;
}
@media (min-width: 900px) {
    .order-pay-form-panel {
        display: none !important;
    }
}
.order-pay-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 6.5rem;
    flex: 1 1 6.5rem;
    margin: 0;
    font-size: 0.75rem;
    color: var(--rt-muted, #6b7280);
}
.order-pay-form-field--grow {
    flex: 2 1 12rem;
}
.order-pay-form-field .login-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.9rem;
}
.order-pay-inline.is-edit-mode .order-pay-form-panel {
    background: rgba(26, 127, 55, 0.04);
}
.order-pay-data-row.is-editing {
    opacity: 0.55;
}
.order-pay-card.is-editing {
    opacity: 0.55;
}
.order-pay-ico {
    display: block;
}
.order-pay-edit-btn,
.order-pay-del-btn,
.order-pay-cash-btn {
    padding: 0.3rem 0.4rem;
    line-height: 0;
    vertical-align: middle;
}
.order-pay-actions .staff-btn,
.order-pay-card-actions .staff-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}
.order-pay-card-actions {
    flex-wrap: nowrap;
    align-items: center;
}
.order-pay-mobile-total {
    display: none;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.5rem;
    margin: 0.65rem 0 0;
    padding: 0.55rem 0.75rem;
    border-top: none;
    font-size: 0.95rem;
    font-weight: 600;
}
.order-pay-mobile-total-label {
    color: var(--rt-muted, #6b7280);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-right: 0.25rem;
}
.order-pay-mobile-total-sep {
    color: var(--rt-muted, #6b7280);
    font-weight: 400;
}

@media (max-width: 899px) {
    .order-pay-table-wrap {
        display: none !important;
    }
    .order-pay-mobile {
        display: block !important;
    }
    .order-pay-mobile-total.order-pay-mobile {
        display: flex !important;
    }
    .order-pay-form-panel {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        border: none;
        border-radius: 6px;
        padding: 0.75rem 0.85rem;
        margin-top: 0.75rem;
        background: var(--rt-surface-muted, #f3f4f6);
    }
    .order-pay-form-field {
        flex: 1 1 auto;
        min-width: 0;
        width: 100%;
    }
    .order-pay-form-actions {
        justify-content: flex-end;
        margin-top: 0.25rem;
    }
}



