/* Service Orders V2 — V49 actual program UI redesign
   Clean desktop dashboard + mobile master UI. */
:root {
    --bg: #f6f8fb;
    --bg-soft: #eef3fb;
    --card: #ffffff;
    --card-2: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --border: #e2e8f0;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #dbeafe;
    --success: #16a34a;
    --success-soft: #dcfce7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    --warning: #d97706;
    --warning-soft: #fef3c7;
    --sidebar: #ffffff;
    --sidebar-text: #0f172a;
    --input: #ffffff;
    --shadow: 0 22px 60px rgba(15, 23, 42, 0.09);
    --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.07);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
    --bg: #07111d;
    --bg-soft: #0a1828;
    --card: #101c29;
    --card-2: #0b1724;
    --text: #e5edf7;
    --muted: #94a3b8;
    --muted-2: #6f8197;
    --border: #223247;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-soft: rgba(59, 130, 246, 0.18);
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.16);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.14);
    --sidebar: #0b1522;
    --sidebar-text: #e5edf7;
    --input: #0b1724;
    --shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
    --shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
}

body.so-app {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 34rem),
        radial-gradient(circle at 80% 0%, rgba(14, 165, 233, 0.08), transparent 28rem),
        var(--bg);
}

html[data-theme="dark"] body.so-app {
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.13), transparent 34rem),
        linear-gradient(135deg, #07111d 0%, #081827 54%, #050b12 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

img,
canvas,
video {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

/* Base cards / forms */
.page,
.desktop-content {
    width: min(100% - 32px, 1480px);
    margin: 18px auto 44px;
}

.hero-card,
.auth-card,
.stat-card,
.order-card,
.empty-card,
.form,
.details-card,
.table-card,
.panel-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow-soft);
}

.auth-card {
    width: min(100% - 32px, 430px);
    margin: 9vh auto;
    padding: 28px;
}

.auth-card h1,
.hero-card h1,
.page-header h1 {
    margin: 0 0 8px;
    letter-spacing: -0.05em;
}

.auth-card p,
.hero-card p,
.page-header p {
    margin: 0;
    color: var(--muted);
}

.form {
    padding: 22px;
}

.form label,
.status-form label,
.master-mobile-form label,
.orders-filterbar label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
}

.form input,
.form select,
.form textarea,
.status-form select,
.master-mobile-form input,
.master-mobile-form select,
.master-mobile-form textarea,
.orders-filterbar input,
.orders-filterbar select,
.master-searchbar input,
.lang-form select {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--input);
    color: var(--text);
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.form textarea,
.master-mobile-form textarea {
    min-height: 110px;
    resize: vertical;
}

.form input:focus,
.form select:focus,
.form textarea:focus,
.status-form select:focus,
.master-mobile-form input:focus,
.master-mobile-form select:focus,
.master-mobile-form textarea:focus,
.orders-filterbar input:focus,
.orders-filterbar select:focus,
.master-searchbar input:focus {
    border-color: color-mix(in srgb, var(--primary) 70%, var(--border));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-soft) 62%, transparent);
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.full-width,
.full-width-card {
    grid-column: 1 / -1;
}

.inline-form {
    display: inline-flex;
    margin: 0;
}

.button,
.link-button,
.icon-button,
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    color: var(--text);
    font-weight: 450;
    line-height: 1;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}

.button,
.link-button {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
}

.button:hover,
.link-button:hover,
.icon-button:hover,
.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
    color: var(--primary);
}

.button-primary {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.button-primary:hover {
    border-color: var(--primary-hover);
    background: var(--primary-hover);
    color: #ffffff;
}

.button-small {
    min-height: 36px;
    padding: 0 13px;
    font-size: 13px;
}

.button-wide {
    width: 100%;
}

.icon-button,
.theme-toggle {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 12px;
}

.alert {
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 15px;
    font-weight: 780;
}

.alert-success {
    background: var(--success-soft);
    color: var(--success);
}

.alert-error {
    background: var(--danger-soft);
    color: var(--danger);
}

.empty-card,
.master-empty-state,
.master-mobile-locked {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    color: var(--muted);
    box-shadow: var(--shadow-soft);
    font-weight: 750;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 24px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 450;
    line-height: 1.15;
    white-space: nowrap;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.details-card {
    padding: 20px;
}

.details-list {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 10px 14px;
    margin: 0;
}

.details-list dt {
    color: var(--muted);
    font-weight: 450;
}

.details-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    background: var(--card-2);
    font-size: 11px;
    font-weight: 450;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Desktop shell */
.desktop-shell {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    background: color-mix(in srgb, var(--sidebar) 96%, transparent);
    border-right: 1px solid var(--border);
    color: var(--sidebar-text);
    backdrop-filter: blur(18px);
}

.sidebar-brand,
.master-topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 450;
    letter-spacing: -0.03em;
}

.sidebar-brand {
    padding: 0 8px 24px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--primary), #0ea5e9);
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.28);
}

.brand-mark .app-brand-logo,
.master-topbar-brand-mobile-icon .app-brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
}

.settings-brand-preview {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
}

.settings-brand-preview img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
}

.sidebar-nav {
    display: grid;
    gap: 6px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 13px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 780;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--primary-soft);
    color: var(--primary);
}

.sidebar-nav a span {
    width: 20px;
    text-align: center;
}

.sidebar-nav a strong {
    font-weight: 450;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 16px 8px 0;
}

.sidebar-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-weight: 450;
}

.sidebar-user strong,
.sidebar-user span {
    display: block;
    line-height: 1.25;
}

.sidebar-user span {
    color: var(--muted);
    font-size: 12px;
}

.desktop-main {
    min-width: 0;
}

.desktop-topbar,
.master-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
    padding: 14px 22px;
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
}

.desktop-topbar h1 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -0.045em;
}

.desktop-topbar p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.desktop-topbar-actions,
.master-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-form select {
    width: auto;
    min-width: 66px;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 12px;
    font-weight: 450;
}

/* Orders desktop */
.orders-redesign {
    display: grid;
    gap: 14px;
}

.orders-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.orders-header-row h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.055em;
}

.orders-header-row p {
    margin: 4px 0 0;
    color: var(--muted);
}

.orders-tabs {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 44px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}

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

.orders-tabs a {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    height: 44px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 450;
}

.orders-tabs a:hover,
.orders-tabs a.active {
    color: var(--primary);
}

.orders-tabs a.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    border-radius: 999px;
    background: var(--primary);
}

.orders-tabs span {
    min-width: 24px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    text-align: center;
    font-size: 12px;
    font-weight: 450;
}

.orders-stat-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(145px, 1fr));
    gap: 12px;
}

.orders-stat-card {
    min-height: 106px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--status-bg, var(--primary-soft)) 24%, transparent), transparent),
        var(--card);
    box-shadow: var(--shadow-soft);
}

.orders-stat-card span,
.orders-stat-card small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
}

.orders-stat-card strong {
    display: block;
    margin: 8px 0 7px;
    color: var(--status-text, var(--text));
    font-size: 30px;
    line-height: 1;
    letter-spacing: -0.04em;
}

.orders-stat-card.stat-blue {
    --status-bg: #bfdbfe;
    --status-text: var(--primary);
}

.orders-stat-card.stat-green {
    --status-bg: #bbf7d0;
    --status-text: var(--success);
}

.orders-stat-card.stat-amber {
    --status-bg: #fde68a;
    --status-text: var(--warning);
}

.orders-filterbar {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) repeat(5, minmax(130px, 1fr)) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card);
    box-shadow: var(--shadow-soft);
}

.orders-filter-actions {
    display: flex;
    gap: 6px;
}

.orders-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 306px;
    gap: 14px;
    align-items: start;
}

.orders-table-panel,
.order-side-preview {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

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

.orders-modern-table {
    min-width: 1040px;
    font-size: 13px;
}

.orders-modern-table th,
.orders-modern-table td {
    padding: 13px 12px;
}

.orders-modern-table tbody tr {
    cursor: pointer;
    transition: background .14s ease;
}

.orders-modern-table tbody tr:hover {
    background: color-mix(in srgb, var(--primary-soft) 44%, transparent);
}

.orders-modern-table small {
    color: var(--muted);
    font-size: 12px;
}

.orders-modern-table a {
    color: var(--primary);
    font-weight: 450;
}

.order-side-preview {
    position: sticky;
    top: 90px;
    display: grid;
    gap: 10px;
    padding: 10px;
}

.order-side-head,
.side-section {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--card-2);
}

.order-side-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.order-side-head strong {
    display: block;
    margin-bottom: 7px;
    letter-spacing: -0.03em;
}

.side-section h2 {
    margin: 0 0 10px;
    font-size: 14px;
    letter-spacing: -0.03em;
}

.side-section p {
    margin: 0;
    font-size: 13px;
}

.side-dl {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
    margin: 0;
    font-size: 13px;
}

.side-dl dt {
    color: var(--muted);
    font-weight: 450;
}

.side-dl dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

/* Lists/cards from older pages kept styled */
.page-header,
.actions-row,
.filter-actions,
.section-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.stats-grid,
.manager-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card {
    padding: 18px;
}

.stat-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
}

.stat-card strong {
    font-size: 30px;
    letter-spacing: -0.04em;
}

.card-list,
.manager-card-list,
.order-list {
    display: grid;
    gap: 14px;
}

.order-card {
    overflow: hidden;
}

.order-card-link {
    display: block;
    padding: 16px;
}

.order-main {
    display: grid;
    gap: 7px;
    margin-bottom: 12px;
}

.order-main strong {
    font-size: 18px;
}

.order-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.filters-form,
.users-filters-form,
.cash-filters-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

/* Master mobile */
body.so-master-shell {
    padding-bottom: 92px;
}

.master-topbar {
    min-height: 56px;
    padding: 8px 14px;
}

.master-topbar-brand strong {
    font-size: 14px;
}

.master-page-wrap {
    width: min(100% - 22px, 530px);
    margin: 14px auto 100px;
}

.master-redesign-list,
.master-redesign-detail {
    display: grid;
    gap: 14px;
}

.master-list-header,
.master-mobile-backbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.master-list-header h1 {
    margin: 0;
    font-size: 21px;
    letter-spacing: -0.055em;
}

.master-list-header p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.master-header-icons {
    display: flex;
    gap: 8px;
}

.master-segmented,
.master-status-switch {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--card-2);
}

.master-status-switch {
    grid-template-columns: repeat(2, 1fr);
}

.master-segmented a,
.master-status-switch a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    border-radius: 11px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 450;
}

.master-segmented a.active,
.master-status-switch a.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
}

.master-status-switch span {
    min-width: 21px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .22);
}

.master-searchbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    gap: 8px;
}

.master-mini-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.master-mini-stats div {
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--card);
    box-shadow: var(--shadow-soft);
}

.master-mini-stats span,
.master-mini-stats strong {
    display: block;
}

.master-mini-stats span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
}

.master-mini-stats strong {
    margin-top: 4px;
    font-size: 21px;
    letter-spacing: -0.04em;
}

.master-group-list,
.master-order-group {
    display: grid;
    gap: 13px;
}

.master-order-group header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.master-order-group h2 {
    margin: 0;
    font-size: 16px;
    letter-spacing: -0.04em;
}

.master-order-group header span {
    min-width: 26px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    text-align: center;
    font-size: 12px;
    font-weight: 450;
}

.master-new-card {
    position: relative;
    display: grid;
    gap: 7px;
    padding: 14px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 16px;
    background: var(--card);
    box-shadow: var(--shadow-soft);
}

.master-new-card:hover {
    transform: translateY(-1px);
}

.master-card-hit {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.master-new-card a:not(.master-card-hit),
.master-new-card button {
    position: relative;
    z-index: 2;
}

.master-card-time {
    color: var(--text);
    font-size: 13px;
    font-weight: 450;
}

.master-card-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.master-card-status-row strong {
    color: var(--muted);
    font-size: 12px;
}

.master-new-card h3 {
    margin: 2px 0 0;
    font-size: 15px;
    line-height: 1.25;
}

.master-new-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.master-card-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin-top: 5px;
}

.master-card-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-2);
    color: var(--text);
    font-size: 12px;
    font-weight: 450;
}

.master-floating-add {
    position: fixed;
    right: 18px;
    bottom: 92px;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 22px;
    font-weight: 450;
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.34);
}

.master-mobile-backbar {
    position: sticky;
    top: 57px;
    z-index: 20;
    padding: 8px 0;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(15px);
}

.master-mobile-backbar a,
.master-mobile-backbar span {
    font-weight: 450;
}

.master-mobile-hero,
.master-mobile-card {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    box-shadow: var(--shadow-soft);
}

.master-mobile-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-radius: 20px;
    padding: 16px;
}

.master-mobile-hero h1 {
    margin: 0;
    color: var(--text);
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -0.05em;
}

.master-mobile-hero p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.master-mobile-eyebrow {
    margin: 0 0 5px !important;
    color: var(--primary) !important;
    font-size: 12px !important;
    font-weight: 450;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.master-mobile-quick-actions,
.master-mobile-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.master-order-tabs {
    position: sticky;
    top: 103px;
    z-index: 18;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 10px;
    background: color-mix(in srgb, var(--bg) 90%, transparent);
    backdrop-filter: blur(15px);
    scrollbar-width: none;
}

.master-order-tabs::-webkit-scrollbar {
    display: none;
}

.master-order-tabs a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card);
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
}

.master-order-tabs a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.master-mobile-card {
    border-radius: 18px;
    padding: 15px;
}

.master-mobile-card h2 {
    margin: 0 0 12px;
    font-size: 15px;
    letter-spacing: -0.04em;
}

.master-mobile-muted,
.muted-text {
    color: var(--muted);
}

.master-mobile-ok {
    color: var(--success);
    font-weight: 450;
}

.master-mobile-info-grid,
.master-mobile-payments-grid,
.master-mobile-history {
    display: grid;
    gap: 8px;
}

.master-mobile-info-grid,
.master-mobile-payments-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.master-mobile-info-grid div,
.master-mobile-payments-grid div,
.master-mobile-history div,
.master-mobile-note {
    border: 1px solid var(--border);
    background: var(--card-2);
    border-radius: 14px;
    padding: 10px;
}

.master-mobile-info-grid span,
.master-mobile-payments-grid span,
.master-mobile-history span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
}

.master-mobile-info-grid strong,
.master-mobile-payments-grid strong,
.master-mobile-history strong {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.master-mobile-form {
    display: grid;
    gap: 10px;
}

.master-mobile-media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.master-mobile-media-grid a {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card-2);
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.master-mobile-media-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.master-mobile-signature-preview,
.master-mobile-signature-pad,
.signature-pad {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #ffffff;
}

.master-mobile-signature-pad,
.signature-pad {
    height: 180px;
}

.master-bottom-nav {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, minmax(62px, 1fr));
    gap: 4px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    overflow-x: auto;
}

.master-bottom-nav a {
    display: grid;
    place-items: center;
    gap: 2px;
    min-height: 49px;
    border-radius: 14px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 450;
}

.master-bottom-nav a span {
    font-size: 18px;
}

.master-bottom-nav a strong {
    font-size: 10px;
}

.master-bottom-nav a.active,
.master-bottom-nav a:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

/* Tracking public */
.tracking-map,
#tracking-map,
.map-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Responsive */
@media (max-width: 1180px) {
    .orders-stat-row {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }

    .orders-filterbar,
    .filters-form,
    .users-filters-form,
    .cash-filters-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .orders-workspace {
        grid-template-columns: 1fr;
    }

    .order-side-preview {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .order-side-head {
        grid-column: 1 / -1;
    }
}

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

    .sidebar {
        position: relative;
        height: auto;
        padding: 12px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-brand {
        padding-bottom: 10px;
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .sidebar-nav a {
        flex: 0 0 auto;
    }

    .sidebar-user {
        display: none;
    }

    .desktop-topbar {
        position: relative;
        flex-wrap: wrap;
    }

    .desktop-content,
    .page {
        width: min(100% - 20px, 1480px);
        margin-top: 12px;
    }

    .orders-header-row,
    .page-header,
    .section-title-row {
        flex-direction: column;
        align-items: stretch;
    }

    .orders-stat-row,
    .orders-filterbar,
    .order-side-preview,
    .filters-form,
    .users-filters-form,
    .cash-filters-form,
    .grid-form,
    .details-grid,
    .stats-grid,
    .manager-stats-grid,
    .order-meta {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 761px) {
    body.so-master-shell {
        background: var(--bg);
    }

    .master-bottom-nav {
        right: 50%;
        left: auto;
        width: min(500px, calc(100% - 20px));
        transform: translateX(50%);
    }
}

@media (max-width: 560px) {
    .desktop-topbar-actions {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .orders-modern-table {
        min-width: 920px;
        font-size: 12px;
    }

    .orders-modern-table th,
    .orders-modern-table td {
        padding: 11px 10px;
    }

    .orders-stat-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .master-mobile-info-grid,
    .master-mobile-payments-grid {
        grid-template-columns: 1fr;
    }
}


/* V49 hard layout guard: even if older browser/user styles are cached, force the redesigned shell. */
body.so-v49 .desktop-shell {
    display: grid !important;
    grid-template-columns: 232px minmax(0, 1fr) !important;
    min-height: 100vh !important;
}

body.so-v49 .sidebar {
    display: flex !important;
}

body.so-v49 .desktop-main {
    min-width: 0 !important;
}

body.so-v49 .desktop-content {
    width: min(100% - 32px, 1480px) !important;
    margin: 18px auto 44px !important;
}

@media (max-width: 900px) {
    body.so-v49:not(.so-master-shell) .desktop-shell {
        grid-template-columns: 1fr !important;
    }

    body.so-v49:not(.so-master-shell) .sidebar {
        position: static !important;
        height: auto !important;
        border-right: 0 !important;
        border-bottom: 1px solid var(--border) !important;
    }
}

/* V50 orders panel cleanup: one title in topbar, no duplicate content heading, grouped orders list. */
body.so-v50-orders-groups .desktop-topbar {
    min-height: 72px;
}

body.so-v50-orders-groups .desktop-topbar h1 {
    font-size: 22px;
}

body.so-v50-orders-groups .orders-redesign {
    gap: 14px;
}

body.so-v50-orders-groups .orders-grouped-panel {
    padding: 0;
    overflow: hidden;
}

body.so-v50-orders-groups .orders-group-list {
    display: grid;
    gap: 0;
}

body.so-v50-orders-groups .orders-group {
    border-bottom: 1px solid var(--border);
    background: var(--card);
}

body.so-v50-orders-groups .orders-group:last-child {
    border-bottom: 0;
}

body.so-v50-orders-groups .orders-group-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 70px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background .15s ease;
}

body.so-v50-orders-groups .orders-group-summary::-webkit-details-marker {
    display: none;
}

body.so-v50-orders-groups .orders-group-summary::before {
    content: "▸";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 10px;
    background: var(--card-2);
    color: var(--muted);
    font-weight: 450;
    transition: transform .15s ease, color .15s ease, background .15s ease;
}

body.so-v50-orders-groups .orders-group[open] > .orders-group-summary::before {
    transform: rotate(90deg);
    background: var(--primary-soft);
    color: var(--primary);
}

body.so-v50-orders-groups .orders-group-summary:hover {
    background: color-mix(in srgb, var(--primary-soft) 34%, transparent);
}

body.so-v50-orders-groups .orders-group-title {
    display: grid;
    gap: 4px;
    min-width: 0;
    margin-right: auto;
}

body.so-v50-orders-groups .orders-group-title strong {
    color: var(--text);
    font-size: 16px;
    font-weight: 450;
    letter-spacing: -0.025em;
}

body.so-v50-orders-groups .orders-group-title small,
body.so-v50-orders-groups .orders-group-meta small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
}

body.so-v50-orders-groups .orders-group-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    flex-wrap: wrap;
    text-align: right;
}

body.so-v50-orders-groups .orders-group-meta b,
body.so-v50-orders-groups .orders-group-meta em {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 450;
    font-style: normal;
    white-space: nowrap;
}

body.so-v50-orders-groups .orders-group-meta b {
    background: var(--primary-soft);
    color: var(--primary);
}

body.so-v50-orders-groups .orders-group-meta em {
    background: #fee2e2;
    color: #b91c1c;
}

body.so-v50-orders-groups .orders-group-danger > .orders-group-summary {
    background: linear-gradient(90deg, color-mix(in srgb, #ef4444 12%, transparent), transparent 56%), var(--card);
}

body.so-v50-orders-groups .orders-group-danger > .orders-group-summary::before {
    background: #fee2e2;
    color: #dc2626;
}

body.so-v50-orders-groups .orders-group[open] > .orders-table-wrap {
    border-top: 1px solid var(--border);
}

body.so-v50-orders-groups .orders-modern-table {
    width: 100%;
}

body.so-v50-orders-groups .orders-modern-table thead th {
    background: var(--card-2);
}

body.so-v50-orders-groups .orders-modern-table tbody tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 900px) {
    body.so-v50-orders-groups .orders-group-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 14px;
    }

    body.so-v50-orders-groups .orders-group-summary::before {
        position: absolute;
        right: 14px;
    }

    body.so-v50-orders-groups .orders-group-title {
        padding-right: 36px;
    }

    body.so-v50-orders-groups .orders-group-meta {
        justify-content: flex-start;
        text-align: left;
    }
}

/* V51 orders grouping + real mobile readability. */
@media (max-width: 760px) {
    body.so-app {
        background:
            radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 22rem),
            var(--bg);
    }

    body.so-v49:not(.so-master-shell) .desktop-shell,
    body.so-v49 .desktop-shell {
        display: block !important;
        grid-template-columns: 1fr !important;
        min-height: 100vh !important;
    }

    body.so-v49:not(.so-master-shell) .sidebar,
    body.so-v49 .sidebar {
        position: sticky !important;
        top: 0 !important;
        z-index: 80 !important;
        height: auto !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 9px !important;
        padding: 10px 10px 8px !important;
        border-right: 0 !important;
        border-bottom: 1px solid var(--border) !important;
        background: color-mix(in srgb, var(--sidebar) 94%, transparent) !important;
        backdrop-filter: blur(18px) !important;
    }

    body.so-v49 .sidebar-brand {
        padding: 0 2px !important;
        font-size: 13px !important;
    }

    body.so-v49 .brand-mark {
        width: 30px !important;
        height: 30px !important;
        border-radius: 10px !important;
    }

    body.so-v49 .sidebar-nav {
        display: flex !important;
        gap: 7px !important;
        overflow-x: auto !important;
        padding: 0 0 3px !important;
        scrollbar-width: none !important;
    }

    body.so-v49 .sidebar-nav::-webkit-scrollbar {
        display: none !important;
    }

    body.so-v49 .sidebar-nav a {
        flex: 0 0 auto !important;
        min-height: 38px !important;
        padding: 0 11px !important;
        border-radius: 13px !important;
        font-size: 12px !important;
        white-space: nowrap !important;
    }

    body.so-v49 .sidebar-user {
        display: none !important;
    }

    body.so-v49 .desktop-topbar {
        position: sticky !important;
        top: 88px !important;
        z-index: 70 !important;
        min-height: auto !important;
        padding: 10px !important;
        gap: 10px !important;
        background: color-mix(in srgb, var(--bg) 92%, transparent) !important;
    }

    body.so-v49 .desktop-topbar h1 {
        font-size: 20px !important;
    }

    body.so-v49 .desktop-topbar-actions {
        width: auto !important;
        margin-left: auto !important;
        gap: 6px !important;
        overflow-x: auto !important;
    }

    body.so-v49 .desktop-topbar-actions .button {
        min-height: 36px !important;
        padding: 0 12px !important;
        font-size: 12px !important;
        white-space: nowrap !important;
    }

    body.so-v49 .desktop-topbar-actions .lang-form select,
    body.so-v49 .desktop-topbar-actions .icon-button {
        min-width: 38px !important;
        width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
    }

    body.so-v49 .desktop-topbar-actions .lang-form select {
        width: 58px !important;
        min-width: 58px !important;
    }

    body.so-v49 .desktop-content,
    body.so-v50-orders-groups .desktop-content {
        width: 100% !important;
        margin: 0 !important;
        padding: 10px !important;
    }

    body.so-v50-orders-groups .orders-redesign {
        gap: 10px !important;
    }

    body.so-v50-orders-groups .orders-tabs {
        gap: 18px !important;
        padding: 0 2px !important;
        min-height: 40px !important;
    }

    body.so-v50-orders-groups .orders-tabs a {
        height: 40px !important;
        font-size: 13px !important;
    }

    body.so-v50-orders-groups .orders-stat-row {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    body.so-v50-orders-groups .orders-stat-card {
        min-height: auto !important;
        padding: 13px 14px !important;
        border-radius: 16px !important;
    }

    body.so-v50-orders-groups .orders-stat-card strong {
        font-size: 24px !important;
        margin: 5px 0 !important;
    }

    body.so-v50-orders-groups .orders-filterbar {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 10px !important;
        border-radius: 18px !important;
    }

    body.so-v50-orders-groups .orders-filterbar label {
        gap: 5px !important;
    }

    body.so-v50-orders-groups .orders-filterbar input,
    body.so-v50-orders-groups .orders-filterbar select {
        min-height: 39px !important;
        border-radius: 12px !important;
        font-size: 13px !important;
    }

    body.so-v50-orders-groups .orders-filter-actions {
        justify-content: flex-start !important;
    }

    body.so-v50-orders-groups .orders-grouped-panel {
        border-radius: 18px !important;
        overflow: hidden !important;
    }

    body.so-v50-orders-groups .orders-group-summary {
        position: relative !important;
        display: grid !important;
        grid-template-columns: 28px minmax(0, 1fr) !important;
        align-items: start !important;
        gap: 10px !important;
        min-height: auto !important;
        padding: 13px 12px !important;
    }

    body.so-v50-orders-groups .orders-group-summary::before {
        position: static !important;
        grid-column: 1 !important;
        grid-row: 1 / span 2 !important;
        width: 26px !important;
        height: 26px !important;
    }

    body.so-v50-orders-groups .orders-group-title {
        grid-column: 2 !important;
        padding-right: 0 !important;
    }

    body.so-v50-orders-groups .orders-group-title strong {
        font-size: 14px !important;
    }

    body.so-v50-orders-groups .orders-group-meta {
        grid-column: 2 !important;
        justify-content: flex-start !important;
        gap: 6px !important;
        text-align: left !important;
    }

    body.so-v50-orders-groups .orders-group-meta b,
    body.so-v50-orders-groups .orders-group-meta em {
        min-height: 24px !important;
        padding: 3px 8px !important;
        font-size: 11px !important;
    }

    body.so-v50-orders-groups .orders-table-wrap {
        overflow: visible !important;
        padding: 10px !important;
        background: var(--card-2) !important;
    }

    body.so-v50-orders-groups .orders-modern-table,
    body.so-v50-orders-groups .orders-modern-table thead,
    body.so-v50-orders-groups .orders-modern-table tbody,
    body.so-v50-orders-groups .orders-modern-table tr,
    body.so-v50-orders-groups .orders-modern-table th,
    body.so-v50-orders-groups .orders-modern-table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    body.so-v50-orders-groups .orders-modern-table thead {
        display: none !important;
    }

    body.so-v50-orders-groups .orders-modern-table tbody {
        display: grid !important;
        gap: 10px !important;
    }

    body.so-v50-orders-groups .orders-modern-table tbody tr {
        display: grid !important;
        gap: 0 !important;
        padding: 12px !important;
        border: 1px solid var(--border) !important;
        border-radius: 16px !important;
        background: var(--card) !important;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06) !important;
    }

    body.so-v50-orders-groups .orders-modern-table tbody tr:hover {
        background: var(--card) !important;
    }

    body.so-v50-orders-groups .orders-modern-table td {
        display: grid !important;
        grid-template-columns: 96px minmax(0, 1fr) !important;
        gap: 10px !important;
        align-items: start !important;
        padding: 7px 0 !important;
        border-bottom: 1px solid var(--border) !important;
        font-size: 13px !important;
        overflow-wrap: anywhere !important;
    }

    body.so-v50-orders-groups .orders-modern-table td:last-child {
        border-bottom: 0 !important;
    }

    body.so-v50-orders-groups .orders-modern-table td::before {
        content: attr(data-label) !important;
        color: var(--muted) !important;
        font-size: 11px !important;
        font-weight: 450 !important;
        text-transform: uppercase !important;
        letter-spacing: .035em !important;
    }
}

@media (max-width: 560px) {
    body.so-v49 .desktop-topbar {
        top: 86px !important;
    }

    body.so-v49 .sidebar-nav a strong {
        font-size: 11px !important;
    }

    body.so-v49 .sidebar-nav a span {
        width: auto !important;
    }

    body.so-v49 .desktop-topbar-actions .button {
        max-width: 132px !important;
    }

    body.so-v50-orders-groups .orders-modern-table td {
        grid-template-columns: 88px minmax(0, 1fr) !important;
    }
}

/* V51 master mobile: compact phone-first layout, readable cards and scrollable bottom menu. */
@media (max-width: 760px) {
    body.so-master-shell {
        padding-bottom: calc(86px + env(safe-area-inset-bottom)) !important;
        background:
            radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 20rem),
            var(--bg) !important;
    }

    body.so-master-shell .master-topbar {
        min-height: 50px !important;
        padding: 7px 10px !important;
        gap: 8px !important;
    }

    body.so-master-shell .master-topbar-brand strong {
        max-width: 138px !important;
        overflow: hidden !important;
        font-size: 13px !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    body.so-master-shell .master-topbar-actions {
        gap: 6px !important;
        margin-left: auto !important;
    }

    body.so-master-shell .master-topbar-actions .icon-button,
    body.so-master-shell .master-topbar-actions .lang-form select {
        min-width: 36px !important;
        width: 36px !important;
        height: 36px !important;
        min-height: 36px !important;
    }

    body.so-master-shell .master-topbar-actions .lang-form select {
        width: 56px !important;
        min-width: 56px !important;
    }

    body.so-master-shell .master-page-wrap {
        width: 100% !important;
        margin: 0 auto calc(92px + env(safe-area-inset-bottom)) !important;
        padding: 10px !important;
    }

    body.so-master-shell .master-redesign-list,
    body.so-master-shell .master-redesign-detail {
        gap: 10px !important;
    }

    body.so-master-shell .master-list-header h1 {
        font-size: 20px !important;
    }

    body.so-master-shell .master-list-header p {
        font-size: 12px !important;
    }

    body.so-master-shell .master-header-icons .icon-button {
        width: 36px !important;
        height: 36px !important;
        min-height: 36px !important;
    }

    body.so-master-shell .master-segmented,
    body.so-master-shell .master-status-switch {
        border-radius: 15px !important;
    }

    body.so-master-shell .master-segmented a,
    body.so-master-shell .master-status-switch a {
        min-height: 36px !important;
        font-size: 12px !important;
    }

    body.so-master-shell .master-searchbar {
        grid-template-columns: minmax(0, 1fr) 38px !important;
    }

    body.so-master-shell .master-searchbar input {
        min-height: 38px !important;
        font-size: 13px !important;
    }

    body.so-master-shell .master-mini-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 7px !important;
    }

    body.so-master-shell .master-mini-stats div {
        padding: 9px !important;
        border-radius: 14px !important;
    }

    body.so-master-shell .master-mini-stats span {
        font-size: 11px !important;
    }

    body.so-master-shell .master-mini-stats strong {
        font-size: 18px !important;
    }

    body.so-master-shell .master-order-group {
        gap: 9px !important;
    }

    body.so-master-shell .master-order-group h2 {
        font-size: 15px !important;
    }

    body.so-master-shell .master-new-card {
        gap: 6px !important;
        padding: 12px !important;
        border-radius: 16px !important;
    }

    body.so-master-shell .master-card-time,
    body.so-master-shell .master-new-card p {
        font-size: 12px !important;
    }

    body.so-master-shell .master-new-card h3 {
        font-size: 15px !important;
    }

    body.so-master-shell .master-card-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    body.so-master-shell .master-card-actions a {
        min-height: 34px !important;
        padding: 0 5px !important;
        font-size: 11px !important;
    }

    body.so-master-shell .master-floating-add {
        right: 16px !important;
        bottom: calc(88px + env(safe-area-inset-bottom)) !important;
        width: 48px !important;
        height: 48px !important;
    }

    body.so-master-shell .master-mobile-backbar {
        top: 50px !important;
        padding: 8px 0 !important;
    }

    body.so-master-shell .master-mobile-hero {
        padding: 13px !important;
        border-radius: 18px !important;
    }

    body.so-master-shell .master-mobile-hero h1 {
        font-size: 18px !important;
    }

    body.so-master-shell .master-mobile-hero p {
        font-size: 12px !important;
    }

    body.so-master-shell .master-mobile-quick-actions,
    body.so-master-shell .master-mobile-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 7px !important;
    }

    body.so-master-shell .master-mobile-quick-actions .button,
    body.so-master-shell .master-mobile-actions .button {
        min-height: 38px !important;
        padding: 0 8px !important;
        font-size: 12px !important;
    }

    body.so-master-shell .master-order-tabs {
        top: 94px !important;
        gap: 7px !important;
        padding-bottom: 8px !important;
    }

    body.so-master-shell .master-order-tabs a {
        min-height: 31px !important;
        padding: 0 11px !important;
        font-size: 11px !important;
    }

    body.so-master-shell .master-mobile-card {
        padding: 13px !important;
        border-radius: 17px !important;
    }

    body.so-master-shell .master-mobile-info-grid,
    body.so-master-shell .master-mobile-payments-grid {
        grid-template-columns: 1fr !important;
        gap: 7px !important;
    }

    body.so-master-shell .master-mobile-info-grid div,
    body.so-master-shell .master-mobile-payments-grid div,
    body.so-master-shell .master-mobile-history div,
    body.so-master-shell .master-mobile-note {
        padding: 9px !important;
        border-radius: 13px !important;
    }

    body.so-master-shell .master-mobile-media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.so-master-shell .master-bottom-nav {
        right: 8px !important;
        bottom: calc(8px + env(safe-area-inset-bottom)) !important;
        left: 8px !important;
        width: auto !important;
        display: flex !important;
        grid-template-columns: none !important;
        gap: 5px !important;
        padding: 6px !important;
        border-radius: 18px !important;
        overflow-x: auto !important;
        transform: none !important;
        scrollbar-width: none !important;
    }

    body.so-master-shell .master-bottom-nav::-webkit-scrollbar {
        display: none !important;
    }

    body.so-master-shell .master-bottom-nav a {
        flex: 0 0 68px !important;
        min-height: 48px !important;
        border-radius: 14px !important;
    }

    body.so-master-shell .master-bottom-nav a span {
        font-size: 17px !important;
    }

    body.so-master-shell .master-bottom-nav a strong {
        font-size: 9px !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 360px) {
    body.so-master-shell .master-mini-stats {
        grid-template-columns: 1fr !important;
    }

    body.so-master-shell .master-card-actions,
    body.so-master-shell .master-mobile-quick-actions,
    body.so-master-shell .master-mobile-actions {
        grid-template-columns: 1fr !important;
    }
}

/* V52: compact statistic cards + old-program-like mobile orders list. */
body.so-v50-orders-groups .orders-stat-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}

body.so-v50-orders-groups .orders-stat-card {
    min-height: 74px;
    padding: 11px 14px;
    border-radius: 16px;
}

body.so-v50-orders-groups .orders-stat-card span,
body.so-v50-orders-groups .orders-stat-card small {
    font-size: 11px;
    line-height: 1.25;
}

body.so-v50-orders-groups .orders-stat-card strong {
    margin: 4px 0 4px;
    font-size: 24px;
    line-height: 1;
}

body.so-v50-orders-groups .orders-mobile-legacy-panel {
    display: none;
}

@media (max-width: 980px) {
    body.so-v50-orders-groups .orders-stat-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    body.so-v50-orders-groups .orders-stat-row {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    body.so-v50-orders-groups .orders-stat-card {
        min-height: 58px !important;
        padding: 8px 7px !important;
        border-radius: 13px !important;
    }

    body.so-v50-orders-groups .orders-stat-card span,
    body.so-v50-orders-groups .orders-stat-card small {
        font-size: 9px !important;
        line-height: 1.12 !important;
    }

    body.so-v50-orders-groups .orders-stat-card strong {
        margin: 2px 0 2px !important;
        font-size: 20px !important;
    }

    body.so-v50-orders-groups .orders-grouped-panel {
        display: none !important;
    }

    body.so-v50-orders-groups .orders-mobile-legacy-panel {
        display: block !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    body.so-v50-orders-groups .orders-mobile-legacy-list {
        display: grid;
        gap: 10px;
    }

    body.so-v50-orders-groups .mobile-date-group {
        border: 0;
        border-radius: 12px;
        background: transparent;
        overflow: hidden;
    }

    body.so-v50-orders-groups .mobile-date-summary {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 48px;
        padding: 10px 12px;
        border-radius: 10px 10px 0 0;
        background: #2497ea;
        color: #ffffff;
        cursor: pointer;
        list-style: none;
        user-select: none;
        text-align: center;
    }

    body.so-v50-orders-groups .mobile-date-summary::-webkit-details-marker {
        display: none;
    }

    body.so-v50-orders-groups .mobile-date-summary::before {
        content: "▶";
        font-size: 17px;
        line-height: 1;
        font-weight: 450;
    }

    body.so-v50-orders-groups .mobile-date-group[open] > .mobile-date-summary::before {
        content: "▼";
    }

    body.so-v50-orders-groups .mobile-date-summary strong {
        color: #ffffff;
        font-size: 19px;
        line-height: 1.15;
        font-weight: 450;
        letter-spacing: -0.02em;
    }

    body.so-v50-orders-groups .mobile-date-summary small {
        display: inline-flex;
        align-items: center;
        min-height: 22px;
        padding: 3px 7px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.22);
        color: #ffffff;
        font-size: 10px;
        font-weight: 450;
    }

    body.so-v50-orders-groups .mobile-date-group-danger > .mobile-date-summary {
        background: #ef4444;
    }

    body.so-v50-orders-groups .mobile-date-content {
        padding: 10px 0 12px;
        background: #ffffff;
    }

    html[data-theme="dark"] body.so-v50-orders-groups .mobile-date-content {
        background: #0b1724;
    }

    body.so-v50-orders-groups .mobile-master-group {
        margin: 0 0 12px;
        padding: 0 0 4px;
        border-radius: 10px;
        background: #ffffff;
        overflow: hidden;
    }

    html[data-theme="dark"] body.so-v50-orders-groups .mobile-master-group {
        background: #0b1724;
    }

    body.so-v50-orders-groups .mobile-master-group:last-child {
        margin-bottom: 0;
    }

    body.so-v50-orders-groups .mobile-master-group h3 {
        margin: 0 0 10px;
        padding: 12px 14px;
        border-radius: 9px;
        background: #42f035;
        color: #14321a;
        font-size: 20px;
        line-height: 1.1;
        font-weight: 450;
        letter-spacing: -0.025em;
    }

    body.so-v50-orders-groups .mobile-legacy-head {
        display: grid;
        grid-template-columns: 1.3fr .92fr .68fr 1.05fr;
        border-top: 1px solid #b8bec9;
        border-bottom: 1px solid #8a91a0;
        background: #f1f5f9;
        color: #30343b;
        overflow: hidden;
    }

    body.so-v50-orders-groups .mobile-legacy-head span {
        min-height: 34px;
        padding: 8px 9px;
        border-right: 1px solid #b8bec9;
        font-size: 16px;
        line-height: 1.05;
        font-weight: 450;
    }

    body.so-v50-orders-groups .mobile-legacy-head span:last-child {
        border-right: 0;
    }

    body.so-v50-orders-groups .mobile-legacy-order {
        margin: 0 0 9px;
        border-radius: 0 0 13px 13px;
        overflow: hidden;
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
        cursor: pointer;
    }

    body.so-v50-orders-groups .mobile-legacy-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 9px;
        min-height: 50px;
        padding: 8px 12px;
        background: #aeb5c6;
        color: #262b35;
        font-size: 15px;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

    body.so-v50-orders-groups .mobile-legacy-meta span {
        min-width: 0;
    }

    body.so-v50-orders-groups .mobile-legacy-meta button {
        width: 68px;
        height: 38px;
        flex: 0 0 68px;
        border: 1px solid #d6dce8;
        border-radius: 9px;
        background: #ffffff;
        color: #111827;
        font-size: 22px;
        font-weight: 450;
        box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
    }

    body.so-v50-orders-groups .mobile-legacy-grid {
        display: grid;
        grid-template-columns: 1.3fr .92fr .68fr 1.05fr;
        min-height: 90px;
        background: #bef7ff;
    }

    body.so-v50-orders-groups .mobile-legacy-order-work .mobile-legacy-grid {
        background: #8dff78;
    }

    body.so-v50-orders-groups .mobile-legacy-order-final .mobile-legacy-grid {
        background: #dddddd;
    }

    body.so-v50-orders-groups .mobile-legacy-category,
    body.so-v50-orders-groups .mobile-legacy-master,
    body.so-v50-orders-groups .mobile-legacy-time,
    body.so-v50-orders-groups .mobile-legacy-actions {
        display: grid;
        align-content: center;
        gap: 7px;
        min-width: 0;
        padding: 10px 9px;
        border-right: 1px solid #b8bec9;
    }

    body.so-v50-orders-groups .mobile-legacy-actions {
        border-right: 0;
        justify-items: center;
    }

    body.so-v50-orders-groups .mobile-legacy-category a {
        color: #1680ff;
        font-size: 18px;
        line-height: 1.05;
        font-weight: 450;
        text-decoration: none;
        overflow-wrap: anywhere;
    }

    body.so-v50-orders-groups .mobile-legacy-status,
    body.so-v50-orders-groups .mobile-legacy-master span {
        display: inline-flex;
        align-items: center;
        min-height: 34px;
        width: 100%;
        padding: 6px 9px;
        border: 1px solid #c9ced8;
        border-radius: 8px;
        background: #ffffff;
        color: #111827;
        font-size: 15px;
        line-height: 1.1;
        overflow-wrap: anywhere;
    }

    body.so-v50-orders-groups .mobile-legacy-time strong {
        color: #111827;
        font-size: 20px;
        line-height: 1;
        font-weight: 700;
    }

    body.so-v50-orders-groups .legacy-action {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: min(100%, 88px);
        min-height: 36px;
        padding: 6px 9px;
        border-radius: 9px;
        font-size: 15px;
        line-height: 1;
        font-weight: 750;
        text-align: center;
    }

    body.so-v50-orders-groups .legacy-action-archive {
        background: #fee082;
        color: #43330a;
    }

    body.so-v50-orders-groups .legacy-action-delete {
        background: #fecaca;
        color: #b91c1c;
    }
}

@media (max-width: 430px) {
    body.so-v50-orders-groups .orders-stat-card span,
    body.so-v50-orders-groups .orders-stat-card small {
        font-size: 8px !important;
    }

    body.so-v50-orders-groups .orders-stat-card strong {
        font-size: 18px !important;
    }

    body.so-v50-orders-groups .mobile-date-summary strong {
        font-size: 16px;
    }

    body.so-v50-orders-groups .mobile-master-group h3 {
        font-size: 17px;
    }

    body.so-v50-orders-groups .mobile-legacy-head span {
        padding: 7px 6px;
        font-size: 12px;
    }

    body.so-v50-orders-groups .mobile-legacy-meta {
        font-size: 12px;
    }

    body.so-v50-orders-groups .mobile-legacy-meta button {
        width: 48px;
        flex-basis: 48px;
    }

    body.so-v50-orders-groups .mobile-legacy-grid,
    body.so-v50-orders-groups .mobile-legacy-head {
        grid-template-columns: 1.28fr .82fr .55fr .82fr;
    }

    body.so-v50-orders-groups .mobile-legacy-category,
    body.so-v50-orders-groups .mobile-legacy-master,
    body.so-v50-orders-groups .mobile-legacy-time,
    body.so-v50-orders-groups .mobile-legacy-actions {
        padding: 8px 5px;
    }

    body.so-v50-orders-groups .mobile-legacy-category a {
        font-size: 15px;
    }

    body.so-v50-orders-groups .mobile-legacy-status,
    body.so-v50-orders-groups .mobile-legacy-master span {
        min-height: 30px;
        padding: 5px 6px;
        font-size: 12px;
    }

    body.so-v50-orders-groups .mobile-legacy-time strong {
        font-size: 16px;
    }

    body.so-v50-orders-groups .legacy-action {
        min-height: 30px;
        padding: 5px 6px;
        font-size: 12px;
    }
}

/* V53: mobile top quick search + advanced filters hidden behind filter button. */
body.so-v50-orders-groups .orders-mobile-search-row,
body.so-v50-orders-groups .orders-mobile-deep-filter,
body.so-v50-orders-groups .orders-mobile-more-menu {
    display: none;
}

body.so-v50-orders-groups .orders-filter-compact-select {
    min-width: 135px;
}

@media (min-width: 761px) {
    body.so-v50-orders-groups .orders-filterbar-desktop {
        display: grid !important;
    }
}

@media (max-width: 760px) {
    body.so-v50-orders-groups .orders-stat-row {
        display: flex !important;
        grid-template-columns: none !important;
        gap: 6px !important;
        overflow-x: auto !important;
        padding: 0 0 3px !important;
        scrollbar-width: none !important;
    }

    body.so-v50-orders-groups .orders-stat-row::-webkit-scrollbar {
        display: none !important;
    }

    body.so-v50-orders-groups .orders-stat-card {
        flex: 0 0 calc(33.333% - 4px) !important;
        min-width: 102px !important;
        min-height: 54px !important;
        padding: 7px 7px !important;
        border-radius: 12px !important;
    }

    body.so-v50-orders-groups .orders-filterbar-desktop {
        display: none !important;
    }

    body.so-v50-orders-groups .orders-mobile-search-row {
        position: relative;
        z-index: 30;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 42px 42px 42px;
        gap: 7px;
        align-items: center;
        margin: 0 -2px 2px;
        padding: 9px 8px;
        border: 1px solid rgba(255, 255, 255, .08);
        border-radius: 18px;
        background: #181818;
        box-shadow: 0 12px 26px rgba(15, 23, 42, .16);
    }

    body.so-v50-orders-groups .orders-mobile-quick-search {
        display: block !important;
        min-width: 0;
    }

    body.so-v50-orders-groups .orders-mobile-quick-input {
        display: grid;
        grid-template-columns: 30px minmax(0, 1fr);
        align-items: center;
        min-height: 44px;
        padding: 0 13px;
        border: 1px solid rgba(255, 255, 255, .28);
        border-radius: 999px;
        background: #202020;
        color: #f8fafc;
    }

    body.so-v50-orders-groups .orders-mobile-quick-input span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #ffffff;
        font-size: 25px;
        font-weight: 450;
        line-height: 1;
    }

    body.so-v50-orders-groups .orders-mobile-quick-input input {
        width: 100%;
        min-width: 0;
        height: 42px;
        border: 0;
        outline: 0;
        background: transparent;
        color: #ffffff;
        font-size: 16px;
        font-weight: 700;
    }

    body.so-v50-orders-groups .orders-mobile-quick-input input::placeholder {
        color: rgba(255, 255, 255, .55);
        font-weight: 600;
    }

    body.so-v50-orders-groups .orders-mobile-icon-button,
    body.so-v50-orders-groups .orders-mobile-deep-filter > summary,
    body.so-v50-orders-groups .orders-mobile-more-menu > summary {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, .22);
        border-radius: 12px;
        background: #202020;
        color: #f8fafc;
        font-size: 21px;
        line-height: 1;
        font-weight: 450;
        cursor: pointer;
        list-style: none;
    }

    body.so-v50-orders-groups .orders-mobile-deep-filter,
    body.so-v50-orders-groups .orders-mobile-more-menu {
        position: relative;
        display: block !important;
    }

    body.so-v50-orders-groups .orders-mobile-deep-filter > summary::-webkit-details-marker,
    body.so-v50-orders-groups .orders-mobile-more-menu > summary::-webkit-details-marker {
        display: none;
    }

    body.so-v50-orders-groups .orders-mobile-filter-modal {
        position: fixed;
        top: 116px;
        right: 10px;
        left: 10px;
        z-index: 80;
        max-height: calc(100vh - 142px);
        overflow: auto;
        padding: 10px;
        border: 1px solid var(--border);
        border-radius: 20px;
        background: var(--card);
        box-shadow: 0 28px 70px rgba(15, 23, 42, .28);
    }

    body.so-v50-orders-groups .orders-filterbar-mobile-deep {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    body.so-v50-orders-groups .orders-filterbar-mobile-deep label {
        gap: 5px !important;
    }

    body.so-v50-orders-groups .orders-filterbar-mobile-deep input,
    body.so-v50-orders-groups .orders-filterbar-mobile-deep select {
        min-height: 40px !important;
        border-radius: 12px !important;
        font-size: 13px !important;
    }

    body.so-v50-orders-groups .orders-filterbar-mobile-deep .orders-filter-actions {
        display: flex !important;
        justify-content: flex-start !important;
        padding-top: 2px !important;
    }

    body.so-v50-orders-groups .orders-mobile-more-panel {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        z-index: 85;
        min-width: 166px;
        padding: 7px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: var(--card);
        box-shadow: 0 18px 44px rgba(15, 23, 42, .24);
    }

    body.so-v50-orders-groups .orders-mobile-more-panel a {
        display: flex;
        align-items: center;
        min-height: 36px;
        padding: 0 10px;
        border-radius: 10px;
        color: var(--text);
        font-size: 13px;
        font-weight: 450;
        text-decoration: none;
    }

    body.so-v50-orders-groups .orders-mobile-more-panel a:hover {
        background: var(--primary-soft);
        color: var(--primary-strong);
    }
}

@media (max-width: 430px) {
    body.so-v50-orders-groups .orders-mobile-search-row {
        grid-template-columns: minmax(0, 1fr) 38px 38px 38px;
        gap: 6px;
        padding: 8px 7px;
        border-radius: 16px;
    }

    body.so-v50-orders-groups .orders-mobile-quick-input {
        grid-template-columns: 26px minmax(0, 1fr);
        min-height: 40px;
        padding: 0 11px;
    }

    body.so-v50-orders-groups .orders-mobile-quick-input input {
        height: 39px;
        font-size: 14px;
    }

    body.so-v50-orders-groups .orders-mobile-icon-button,
    body.so-v50-orders-groups .orders-mobile-deep-filter > summary,
    body.so-v50-orders-groups .orders-mobile-more-menu > summary {
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        border-radius: 11px;
        font-size: 19px;
    }

    body.so-v50-orders-groups .orders-mobile-filter-modal {
        top: 106px;
        right: 7px;
        left: 7px;
        max-height: calc(100vh - 126px);
        border-radius: 18px;
    }
}

/* V54: mobile header actions moved to the very top + light-theme quick search. */
.mobile-shell-topline {
    display: none;
}

@media (max-width: 900px) {
    body.so-v54-mobile-header:not(.so-master-shell) .sidebar {
        position: sticky !important;
        top: 0 !important;
        z-index: 100 !important;
        display: grid !important;
        gap: 10px !important;
        padding: 12px !important;
        background: color-mix(in srgb, var(--bg) 96%, transparent) !important;
        border-right: 0 !important;
        border-bottom: 1px solid var(--border) !important;
        backdrop-filter: blur(20px) !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .sidebar-brand {
        padding: 0 !important;
        min-height: 40px !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-topline {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        min-width: 0 !important;
        padding: 2px 0 0 !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-title {
        min-width: 0 !important;
        flex: 0 0 auto !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-title h1 {
        margin: 0 !important;
        color: var(--text) !important;
        font-size: 22px !important;
        font-weight: 450 !important;
        line-height: 1.05 !important;
        letter-spacing: -0.045em !important;
        white-space: nowrap !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-actions {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 7px !important;
        min-width: 0 !important;
        margin-left: auto !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-actions::-webkit-scrollbar {
        display: none !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-actions .inline-form {
        flex: 0 0 auto !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-actions .button {
        flex: 0 0 auto !important;
        min-height: 38px !important;
        padding: 0 14px !important;
        border-radius: 17px !important;
        font-size: 13px !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-actions .lang-form select,
    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-actions .icon-button {
        flex: 0 0 auto !important;
        height: 38px !important;
        min-height: 38px !important;
        border-radius: 13px !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-actions .lang-form select {
        width: 58px !important;
        min-width: 58px !important;
        padding: 0 8px !important;
        font-size: 13px !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-actions .icon-button {
        width: 38px !important;
        min-width: 38px !important;
        font-size: 17px !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .desktop-topbar {
        display: none !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .sidebar-nav {
        display: flex !important;
        gap: 8px !important;
        overflow-x: auto !important;
        padding: 2px 0 1px !important;
        scrollbar-width: none !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .sidebar-nav::-webkit-scrollbar {
        display: none !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .desktop-content,
    body.so-v54-mobile-header.so-v50-orders-groups:not(.so-master-shell) .desktop-content {
        margin-top: 0 !important;
        padding-top: 10px !important;
    }
}

@media (max-width: 520px) {
    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-topline {
        gap: 8px !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-title h1 {
        font-size: 20px !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-actions {
        gap: 6px !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-actions .button {
        min-height: 36px !important;
        padding: 0 12px !important;
        border-radius: 16px !important;
        font-size: 12px !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-actions .lang-form select,
    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-actions .icon-button {
        height: 36px !important;
        min-height: 36px !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-actions .lang-form select {
        width: 54px !important;
        min-width: 54px !important;
    }

    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-actions .icon-button {
        width: 36px !important;
        min-width: 36px !important;
    }
}

@media (min-width: 901px) {
    body.route-cash .cash-v416-autofilter {
        grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 0.9fr) minmax(180px, 1fr) auto !important;
    }
}

@media (max-width: 390px) {
    body.so-v54-mobile-header:not(.so-master-shell) .mobile-shell-actions .button {
        max-width: 118px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

@media (max-width: 760px) {
    :root[data-theme="light"] body.so-v50-orders-groups .orders-mobile-search-row,
    html:not([data-theme="dark"]) body.so-v50-orders-groups .orders-mobile-search-row {
        border-color: var(--border) !important;
        background: color-mix(in srgb, var(--card) 96%, #ffffff 4%) !important;
        box-shadow: 0 12px 26px rgba(15, 23, 42, .08) !important;
    }

    :root[data-theme="light"] body.so-v50-orders-groups .orders-mobile-quick-input,
    html:not([data-theme="dark"]) body.so-v50-orders-groups .orders-mobile-quick-input {
        border-color: var(--border) !important;
        background: #ffffff !important;
        color: var(--text) !important;
    }

    :root[data-theme="light"] body.so-v50-orders-groups .orders-mobile-quick-input span,
    html:not([data-theme="dark"]) body.so-v50-orders-groups .orders-mobile-quick-input span {
        color: var(--text) !important;
    }

    :root[data-theme="light"] body.so-v50-orders-groups .orders-mobile-quick-input input,
    html:not([data-theme="dark"]) body.so-v50-orders-groups .orders-mobile-quick-input input {
        color: var(--text) !important;
    }

    :root[data-theme="light"] body.so-v50-orders-groups .orders-mobile-quick-input input::placeholder,
    html:not([data-theme="dark"]) body.so-v50-orders-groups .orders-mobile-quick-input input::placeholder {
        color: color-mix(in srgb, var(--muted) 84%, transparent) !important;
    }

    :root[data-theme="light"] body.so-v50-orders-groups .orders-mobile-icon-button,
    :root[data-theme="light"] body.so-v50-orders-groups .orders-mobile-deep-filter > summary,
    :root[data-theme="light"] body.so-v50-orders-groups .orders-mobile-more-menu > summary,
    html:not([data-theme="dark"]) body.so-v50-orders-groups .orders-mobile-icon-button,
    html:not([data-theme="dark"]) body.so-v50-orders-groups .orders-mobile-deep-filter > summary,
    html:not([data-theme="dark"]) body.so-v50-orders-groups .orders-mobile-more-menu > summary {
        border-color: var(--border) !important;
        background: #ffffff !important;
        color: var(--text) !important;
        box-shadow: 0 8px 18px rgba(15, 23, 42, .06) !important;
    }
}

/* V55: mobile top row cleanup, new order button in nav row, logout confirmation markup support. */
.mobile-brand-row {
    display: contents;
}

.mobile-shell-actions,
.mobile-nav-new-order {
    display: none;
}

@media (max-width: 900px) {
    body.so-v55-mobile-header:not(.so-master-shell) .sidebar {
        gap: 8px !important;
        padding: 12px !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .mobile-brand-row {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        min-width: 0 !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .sidebar-brand {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        padding: 0 !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .sidebar-brand span:last-child {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .mobile-shell-topline,
    body.so-v55-mobile-header:not(.so-master-shell) .mobile-shell-title {
        display: none !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .mobile-shell-actions {
        display: flex !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 7px !important;
        min-width: 0 !important;
        margin-left: auto !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .mobile-shell-actions .inline-form {
        flex: 0 0 auto !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .mobile-shell-actions .lang-form select,
    body.so-v55-mobile-header:not(.so-master-shell) .mobile-shell-actions .icon-button {
        flex: 0 0 auto !important;
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        border-radius: 14px !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .mobile-shell-actions .lang-form select {
        width: 58px !important;
        min-width: 58px !important;
        padding: 0 8px !important;
        font-size: 13px !important;
        font-weight: 450 !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .sidebar-nav {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        overflow-x: auto !important;
        padding: 3px 0 1px !important;
        scrollbar-width: none !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .sidebar-nav::-webkit-scrollbar {
        display: none !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .sidebar-nav a {
        flex: 0 0 auto !important;
        min-height: 38px !important;
        padding: 0 12px !important;
        border-radius: 14px !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .sidebar-nav .mobile-nav-new-order {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-left: 4px !important;
        padding: 0 16px !important;
        color: #ffffff !important;
        background: linear-gradient(135deg, var(--primary), #2563eb) !important;
        box-shadow: 0 12px 24px rgba(37, 99, 235, .25) !important;
        font-size: 13px !important;
        font-weight: 450 !important;
        white-space: nowrap !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .desktop-topbar {
        display: none !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .desktop-content,
    body.so-v55-mobile-header.so-v50-orders-groups:not(.so-master-shell) .desktop-content {
        margin-top: 0 !important;
        padding-top: 10px !important;
    }
}

@media (max-width: 520px) {
    body.so-v55-mobile-header:not(.so-master-shell) .sidebar {
        padding: 12px 10px !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .brand-mark {
        width: 34px !important;
        height: 34px !important;
        border-radius: 12px !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .sidebar-brand {
        gap: 9px !important;
        font-size: 15px !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .mobile-shell-actions {
        gap: 6px !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .mobile-shell-actions .lang-form select,
    body.so-v55-mobile-header:not(.so-master-shell) .mobile-shell-actions .icon-button {
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .mobile-shell-actions .lang-form select {
        width: 54px !important;
        min-width: 54px !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .sidebar-nav .mobile-nav-new-order {
        padding: 0 13px !important;
        font-size: 12px !important;
    }
}


/* V56: mobile new-order button moved from main nav to orders tabs after SMS. */
.orders-tabs-new-order {
    display: none !important;
}

@media (max-width: 900px) {
    body.so-v55-mobile-header:not(.so-master-shell) .sidebar-nav .mobile-nav-new-order {
        display: none !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .sidebar-nav {
        padding-bottom: 3px !important;
    }

    body.so-v50-orders-groups .orders-tabs {
        align-items: center !important;
        gap: 18px !important;
        min-height: 46px !important;
        padding: 0 2px 4px !important;
    }

    body.so-v50-orders-groups .orders-tabs-new-order {
        position: relative !important;
        display: inline-flex !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        justify-content: center !important;
        height: 38px !important;
        min-height: 38px !important;
        margin-left: 4px !important;
        padding: 0 16px !important;
        border-radius: 16px !important;
        background: linear-gradient(135deg, var(--primary), #2563eb) !important;
        color: #ffffff !important;
        box-shadow: 0 12px 24px rgba(37, 99, 235, .24) !important;
        font-size: 13px !important;
        font-weight: 450 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    body.so-v50-orders-groups .orders-tabs-new-order:hover {
        color: #ffffff !important;
        transform: translateY(-1px) !important;
    }

    body.so-v50-orders-groups .orders-tabs-new-order::after {
        display: none !important;
        content: none !important;
    }
}

@media (max-width: 520px) {
    body.so-v50-orders-groups .orders-tabs {
        gap: 15px !important;
    }

    body.so-v50-orders-groups .orders-tabs-new-order {
        height: 36px !important;
        min-height: 36px !important;
        padding: 0 13px !important;
        border-radius: 15px !important;
        font-size: 12px !important;
    }
}


/* V57: compact mobile orders workspace + short new-order label. */
.orders-new-short {
    display: none;
}

.orders-new-plus {
    display: inline-block;
    margin-right: 4px;
}

@media (max-width: 760px) {
    body.so-v50-orders-groups .orders-tabs {
        gap: 12px !important;
        min-height: 38px !important;
        padding: 0 2px 2px !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
    }

    body.so-v50-orders-groups .orders-tabs::-webkit-scrollbar {
        display: none !important;
    }

    body.so-v50-orders-groups .orders-tabs a {
        flex: 0 0 auto !important;
        min-height: 34px !important;
        padding: 0 1px !important;
        font-size: 14px !important;
        font-weight: 780 !important;
        letter-spacing: -0.015em !important;
        white-space: nowrap !important;
    }

    body.so-v50-orders-groups .orders-tabs a.active::after {
        height: 2px !important;
        bottom: -2px !important;
    }

    body.so-v50-orders-groups .orders-tabs span {
        min-width: 22px !important;
        min-height: 22px !important;
        padding: 1px 6px !important;
        font-size: 12px !important;
        font-weight: 450 !important;
    }

    body.so-v50-orders-groups .orders-tabs-new-order {
        height: 34px !important;
        min-height: 34px !important;
        margin-left: 2px !important;
        padding: 0 12px !important;
        border-radius: 14px !important;
        font-size: 13px !important;
        font-weight: 450 !important;
        box-shadow: 0 8px 18px rgba(37, 99, 235, .20) !important;
    }

    body.so-v50-orders-groups .orders-new-full {
        display: none !important;
    }

    body.so-v50-orders-groups .orders-new-short {
        display: inline !important;
    }

    body.so-v50-orders-groups .orders-stat-row {
        gap: 5px !important;
        margin-top: -2px !important;
        margin-bottom: -2px !important;
        padding-bottom: 1px !important;
    }

    body.so-v50-orders-groups .orders-stat-card {
        min-height: 48px !important;
        padding: 6px 6px !important;
        border-radius: 11px !important;
    }

    body.so-v50-orders-groups .orders-stat-card span,
    body.so-v50-orders-groups .orders-stat-card small {
        font-size: 8px !important;
        line-height: 1.05 !important;
        font-weight: 720 !important;
    }

    body.so-v50-orders-groups .orders-stat-card strong {
        margin: 1px 0 !important;
        font-size: 18px !important;
        font-weight: 450 !important;
    }

    body.so-v50-orders-groups .orders-mobile-search-row {
        grid-template-columns: minmax(0, 1fr) 36px 36px 36px !important;
        gap: 6px !important;
        margin: 0 -2px 0 !important;
        padding: 7px 7px !important;
        border-radius: 16px !important;
        box-shadow: 0 8px 18px rgba(15, 23, 42, .10) !important;
    }

    body.so-v50-orders-groups .orders-mobile-quick-input {
        grid-template-columns: 25px minmax(0, 1fr) !important;
        min-height: 38px !important;
        padding: 0 11px !important;
    }

    body.so-v50-orders-groups .orders-mobile-quick-input span {
        font-size: 20px !important;
        font-weight: 750 !important;
    }

    body.so-v50-orders-groups .orders-mobile-quick-input input {
        height: 36px !important;
        font-size: 14px !important;
        font-weight: 520 !important;
    }

    body.so-v50-orders-groups .orders-mobile-quick-input input::placeholder {
        font-weight: 520 !important;
    }

    body.so-v50-orders-groups .orders-mobile-icon-button,
    body.so-v50-orders-groups .orders-mobile-deep-filter > summary,
    body.so-v50-orders-groups .orders-mobile-more-menu > summary {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        border-radius: 11px !important;
        font-size: 18px !important;
        font-weight: 700 !important;
    }

    body.so-v50-orders-groups .orders-mobile-legacy-list {
        gap: 8px !important;
    }

    body.so-v50-orders-groups .mobile-date-summary {
        min-height: 40px !important;
        padding: 7px 10px !important;
        border-radius: 10px 10px 0 0 !important;
        gap: 7px !important;
    }

    body.so-v50-orders-groups .mobile-date-summary::before {
        font-size: 14px !important;
        font-weight: 760 !important;
    }

    body.so-v50-orders-groups .mobile-date-summary strong {
        font-size: 17px !important;
        line-height: 1.08 !important;
        font-weight: 760 !important;
        letter-spacing: -0.015em !important;
    }

    body.so-v50-orders-groups .mobile-date-summary small {
        min-height: 18px !important;
        padding: 2px 7px !important;
        font-size: 9px !important;
        font-weight: 700 !important;
    }

    body.so-v50-orders-groups .mobile-date-content {
        padding: 8px 0 9px !important;
    }

    body.so-v50-orders-groups .mobile-master-group {
        margin-bottom: 9px !important;
        border-radius: 9px !important;
    }

    body.so-v50-orders-groups .mobile-master-group h3 {
        margin: 0 0 7px !important;
        padding: 9px 12px !important;
        border-radius: 9px !important;
        font-size: 17px !important;
        line-height: 1.05 !important;
        font-weight: 760 !important;
        letter-spacing: -0.012em !important;
    }

    body.so-v50-orders-groups .mobile-legacy-head span {
        min-height: 28px !important;
        padding: 6px 7px !important;
        font-size: 13px !important;
        line-height: 1.05 !important;
        font-weight: 730 !important;
    }

    body.so-v50-orders-groups .mobile-legacy-order {
        margin-bottom: 7px !important;
        border-radius: 0 0 11px 11px !important;
        box-shadow: 0 7px 16px rgba(15, 23, 42, 0.07) !important;
    }

    body.so-v50-orders-groups .mobile-legacy-meta {
        min-height: 40px !important;
        padding: 6px 10px !important;
        gap: 7px !important;
        font-size: 13px !important;
        line-height: 1.12 !important;
        font-weight: 520 !important;
    }

    body.so-v50-orders-groups .mobile-legacy-meta button {
        width: 48px !important;
        height: 32px !important;
        flex: 0 0 48px !important;
        border-radius: 8px !important;
        font-size: 20px !important;
        font-weight: 450 !important;
    }

    body.so-v50-orders-groups .mobile-legacy-grid {
        min-height: 74px !important;
    }

    body.so-v50-orders-groups .mobile-legacy-category,
    body.so-v50-orders-groups .mobile-legacy-master,
    body.so-v50-orders-groups .mobile-legacy-time,
    body.so-v50-orders-groups .mobile-legacy-actions {
        gap: 5px !important;
        padding: 8px 7px !important;
    }

    body.so-v50-orders-groups .mobile-legacy-category a {
        font-size: 16px !important;
        line-height: 1.05 !important;
        font-weight: 680 !important;
    }

    body.so-v50-orders-groups .mobile-legacy-status,
    body.so-v50-orders-groups .mobile-legacy-master span {
        min-height: 29px !important;
        padding: 5px 7px !important;
        border-radius: 8px !important;
        font-size: 13px !important;
        line-height: 1.08 !important;
        font-weight: 520 !important;
    }

    body.so-v50-orders-groups .mobile-legacy-time strong {
        font-size: 18px !important;
        font-weight: 650 !important;
    }

    body.so-v50-orders-groups .legacy-action {
        width: min(100%, 78px) !important;
        min-height: 31px !important;
        padding: 5px 7px !important;
        border-radius: 8px !important;
        font-size: 13px !important;
        font-weight: 650 !important;
    }
}

@media (max-width: 430px) {
    body.so-v50-orders-groups .orders-tabs {
        gap: 10px !important;
    }

    body.so-v50-orders-groups .orders-tabs a {
        font-size: 13px !important;
    }

    body.so-v50-orders-groups .orders-tabs-new-order {
        height: 32px !important;
        min-height: 32px !important;
        padding: 0 10px !important;
        font-size: 12px !important;
    }

    body.so-v50-orders-groups .orders-stat-card {
        min-width: 94px !important;
        min-height: 44px !important;
        padding: 5px 5px !important;
    }

    body.so-v50-orders-groups .orders-stat-card strong {
        font-size: 16px !important;
    }

    body.so-v50-orders-groups .orders-mobile-search-row {
        grid-template-columns: minmax(0, 1fr) 34px 34px 34px !important;
        gap: 5px !important;
        padding: 6px !important;
        border-radius: 15px !important;
    }

    body.so-v50-orders-groups .orders-mobile-quick-input {
        grid-template-columns: 23px minmax(0, 1fr) !important;
        min-height: 36px !important;
        padding: 0 10px !important;
    }

    body.so-v50-orders-groups .orders-mobile-quick-input input {
        height: 34px !important;
        font-size: 13px !important;
    }

    body.so-v50-orders-groups .orders-mobile-icon-button,
    body.so-v50-orders-groups .orders-mobile-deep-filter > summary,
    body.so-v50-orders-groups .orders-mobile-more-menu > summary {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
        border-radius: 10px !important;
        font-size: 16px !important;
    }

    body.so-v50-orders-groups .mobile-date-summary {
        min-height: 37px !important;
        padding: 6px 9px !important;
    }

    body.so-v50-orders-groups .mobile-date-summary strong {
        font-size: 15px !important;
        font-weight: 720 !important;
    }

    body.so-v50-orders-groups .mobile-master-group h3 {
        padding: 8px 11px !important;
        font-size: 15px !important;
        font-weight: 720 !important;
    }

    body.so-v50-orders-groups .mobile-legacy-head span {
        min-height: 26px !important;
        padding: 5px 5px !important;
        font-size: 11px !important;
        font-weight: 700 !important;
    }

    body.so-v50-orders-groups .mobile-legacy-meta {
        min-height: 36px !important;
        padding: 5px 8px !important;
        font-size: 11px !important;
    }

    body.so-v50-orders-groups .mobile-legacy-meta button {
        width: 42px !important;
        height: 29px !important;
        flex-basis: 42px !important;
        font-size: 18px !important;
    }

    body.so-v50-orders-groups .mobile-legacy-grid {
        min-height: 66px !important;
        grid-template-columns: 1.25fr .82fr .55fr .82fr !important;
    }

    body.so-v50-orders-groups .mobile-legacy-category,
    body.so-v50-orders-groups .mobile-legacy-master,
    body.so-v50-orders-groups .mobile-legacy-time,
    body.so-v50-orders-groups .mobile-legacy-actions {
        padding: 6px 5px !important;
        gap: 4px !important;
    }

    body.so-v50-orders-groups .mobile-legacy-category a {
        font-size: 14px !important;
        font-weight: 650 !important;
    }

    body.so-v50-orders-groups .mobile-legacy-status,
    body.so-v50-orders-groups .mobile-legacy-master span {
        min-height: 26px !important;
        padding: 4px 5px !important;
        font-size: 11px !important;
    }

    body.so-v50-orders-groups .mobile-legacy-time strong {
        font-size: 16px !important;
    }

    body.so-v50-orders-groups .legacy-action {
        min-height: 28px !important;
        padding: 4px 5px !important;
        font-size: 11px !important;
    }
}

/* V58: reduce vertical gaps around mobile search and between mobile date groups. */
@media (max-width: 760px) {
    body.so-v50-orders-groups .orders-redesign {
        gap: 7px !important;
    }

    body.so-v50-orders-groups .orders-stat-row {
        margin-bottom: -4px !important;
    }

    body.so-v50-orders-groups .orders-mobile-search-row {
        margin: -2px -2px -4px !important;
        padding: 4px 6px !important;
        border-radius: 14px !important;
        box-shadow: 0 6px 14px rgba(15, 23, 42, .09) !important;
    }

    body.so-v50-orders-groups .orders-mobile-quick-input {
        min-height: 34px !important;
        padding: 0 10px !important;
    }

    body.so-v50-orders-groups .orders-mobile-quick-input input {
        height: 32px !important;
    }

    body.so-v50-orders-groups .orders-mobile-icon-button,
    body.so-v50-orders-groups .orders-mobile-deep-filter > summary,
    body.so-v50-orders-groups .orders-mobile-more-menu > summary {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
    }

    body.so-v50-orders-groups .orders-mobile-legacy-list {
        gap: 3px !important;
    }

    body.so-v50-orders-groups .mobile-date-content {
        padding: 4px 0 3px !important;
    }

    body.so-v50-orders-groups .mobile-master-group {
        margin-bottom: 3px !important;
        padding-bottom: 2px !important;
    }

    body.so-v50-orders-groups .mobile-legacy-order {
        margin-bottom: 3px !important;
    }
}

@media (max-width: 430px) {
    body.so-v50-orders-groups .orders-redesign {
        gap: 6px !important;
    }

    body.so-v50-orders-groups .orders-mobile-search-row {
        margin: -3px -2px -5px !important;
        padding: 3px 5px !important;
        border-radius: 13px !important;
    }

    body.so-v50-orders-groups .orders-mobile-quick-input {
        min-height: 32px !important;
    }

    body.so-v50-orders-groups .orders-mobile-quick-input input {
        height: 30px !important;
    }

    body.so-v50-orders-groups .orders-mobile-icon-button,
    body.so-v50-orders-groups .orders-mobile-deep-filter > summary,
    body.so-v50-orders-groups .orders-mobile-more-menu > summary {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
    }

    body.so-v50-orders-groups .orders-mobile-legacy-list {
        gap: 2px !important;
    }

    body.so-v50-orders-groups .mobile-date-content {
        padding: 3px 0 2px !important;
    }
}

/* V59: hide Reports/SMS from mobile orders tabs so + New order fits in one row. */
@media (max-width: 900px) {
    body.so-v50-orders-groups .orders-tabs .orders-tab-mobile-hidden {
        display: none !important;
    }

    body.so-v50-orders-groups .orders-tabs {
        gap: 18px !important;
        justify-content: flex-start !important;
        padding-right: 0 !important;
    }

    body.so-v50-orders-groups .orders-tabs-new-order {
        margin-left: auto !important;
        padding-right: 18px !important;
        padding-left: 18px !important;
    }
}

@media (max-width: 520px) {
    body.so-v50-orders-groups .orders-tabs {
        gap: 16px !important;
    }

    body.so-v50-orders-groups .orders-tabs-new-order {
        height: 34px !important;
        min-height: 34px !important;
        padding-right: 14px !important;
        padding-left: 14px !important;
        font-size: 12px !important;
    }
}

/* V60 — compact direct edit view for service orders */
.order-edit-shell {
    width: min(100%, 1480px);
    margin: 0 auto 64px;
}

.order-edit-form {
    display: block;
}

.order-edit-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
    margin-bottom: 12px;
    padding: 6px 0 14px;
    border-bottom: 1px solid var(--border);
}

.order-edit-title h1 {
    margin: 6px 0 6px;
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.05;
    letter-spacing: -0.055em;
}

.order-edit-title p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.order-edit-back {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    font-weight: 450;
    font-size: 13px;
}

.order-edit-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 360px;
}

.order-edit-head-actions > strong {
    font-size: 22px;
    color: var(--muted);
    white-space: nowrap;
}

.order-edit-status-select {
    min-width: 190px;
    border-radius: 12px;
    border: 1px solid rgba(37, 99, 235, 0.35);
    background: var(--primary);
    color: #ffffff;
    font-weight: 450;
    padding: 12px 16px;
}

.order-edit-tabs {
    display: flex;
    align-items: center;
    gap: 22px;
    margin: 10px 0 18px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}

.order-edit-tabs::-webkit-scrollbar {
    display: none;
}

.order-edit-tabs a {
    display: inline-flex;
    padding: 10px 0 12px;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    font-weight: 450;
    white-space: nowrap;
}

.order-edit-tabs a.active,
.order-edit-tabs a:hover {
    color: var(--text);
    border-bottom-color: var(--primary);
}

.order-edit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.order-edit-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: color-mix(in srgb, var(--card) 94%, transparent);
    box-shadow: var(--shadow-soft);
    padding: 18px;
}

.order-edit-card h2 {
    margin: 0 0 14px;
    font-size: 18px;
    letter-spacing: -0.03em;
}

.order-edit-wide-card {
    grid-column: 1 / -1;
}

.order-edit-fields {
    display: grid;
    gap: 10px;
}

.order-edit-fields.two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-edit-fields.compact-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.order-edit-fields.notes-cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.order-edit-fields label {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.order-edit-fields label > span,
.order-edit-checkline span {
    color: var(--muted);
    font-weight: 450;
    font-size: 12px;
    letter-spacing: 0.01em;
}

.order-edit-fields input,
.order-edit-fields select,
.order-edit-fields textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--input);
    color: var(--text);
    padding: 11px 12px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.order-edit-fields textarea {
    resize: vertical;
    min-height: 108px;
}

.order-edit-fields input:focus,
.order-edit-fields select:focus,
.order-edit-fields textarea:focus {
    border-color: rgba(37, 99, 235, 0.65);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.order-edit-client-notice {
    grid-column: 1 / -1;
}

.order-edit-checkline {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 4px;
}

.order-edit-checkline input {
    width: 18px;
    height: 18px;
    padding: 0;
}

.order-edit-sticky-actions {
    position: sticky;
    bottom: 12px;
    z-index: 12;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: color-mix(in srgb, var(--card) 88%, transparent);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

html[data-theme="dark"] .order-edit-card,
html[data-theme="dark"] .order-edit-sticky-actions {
    background: color-mix(in srgb, var(--card) 92%, transparent);
}

html[data-theme="dark"] .order-edit-status-select {
    background: #1687c7;
    border-color: rgba(56, 189, 248, 0.45);
}

@media (max-width: 900px) {
    .order-edit-shell {
        margin: 0 auto 92px;
    }

    .order-edit-header {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 8px;
        padding-bottom: 10px;
    }

    .order-edit-title h1 {
        font-size: 30px;
        margin-top: 4px;
    }

    .order-edit-title p {
        display: none;
    }

    .order-edit-head-actions {
        display: grid;
        grid-template-columns: 1fr;
        min-width: 0;
        width: 100%;
        justify-content: stretch;
    }

    .order-edit-head-actions > strong {
        font-size: 26px;
        color: var(--text);
    }

    .order-edit-save-top {
        display: none;
    }

    .order-edit-status-select {
        width: 100%;
        min-width: 0;
        text-align: center;
        font-size: 17px;
        padding: 12px 14px;
    }

    .order-edit-tabs {
        gap: 22px;
        margin: 8px 0 14px;
    }

    .order-edit-tabs a {
        font-size: 14px;
        padding-bottom: 10px;
    }

    .order-edit-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .order-edit-card {
        padding: 14px;
        border-radius: 16px;
        box-shadow: none;
    }

    .order-edit-card h2 {
        font-size: 17px;
        margin-bottom: 10px;
    }

    .order-edit-fields.two-cols,
    .order-edit-fields.compact-cols,
    .order-edit-fields.notes-cols {
        grid-template-columns: 1fr;
    }

    .order-edit-fields label {
        grid-template-columns: minmax(112px, 38%) minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        min-height: 44px;
        padding: 4px 0;
        border-bottom: 1px solid var(--border);
    }

    .order-edit-fields label > span {
        font-size: 14px;
        font-weight: 650;
    }

    .order-edit-fields input,
    .order-edit-fields select,
    .order-edit-fields textarea {
        border-radius: 10px;
        padding: 9px 10px;
        min-height: 40px;
    }

    .order-edit-fields textarea {
        grid-column: 1 / -1;
        min-height: 96px;
    }

    .order-edit-fields label:has(textarea) > span {
        grid-column: 1 / -1;
    }

    .order-edit-checkline {
        justify-content: flex-start;
        border-bottom: 0 !important;
    }

    .order-edit-sticky-actions {
        left: 12px;
        right: 12px;
        bottom: 12px;
        display: grid;
        grid-template-columns: 1fr 1.25fr;
        margin-top: 12px;
        padding: 10px;
    }

    .order-edit-sticky-actions .button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 520px) {
    .order-edit-title h1 {
        font-size: 26px;
    }

    .order-edit-head-actions > strong {
        font-size: 22px;
    }

    .order-edit-fields label {
        grid-template-columns: 1fr;
        gap: 5px;
        align-items: stretch;
    }
}

/* V61 — compact direct editing page */
.order-editor-v61-page .desktop-topbar { display: none !important; }
    .order-editor-v61-page { width: min(100%, 1520px); margin: 0 auto 72px; }
    .order-editor-v61-page * { box-sizing: border-box; }
    .oev61-header { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px 20px; margin: -18px -18px 16px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); }
    .oev61-title-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; min-width: 0; }
    .oev61-back { display: inline-flex; align-items: center; height: 38px; padding: 0 13px; border: 1px solid var(--border); border-radius: 13px; color: var(--muted); font-weight: 450; background: color-mix(in srgb, var(--card) 86%, transparent); text-decoration: none; }
    .oev61-title { margin: 0; font-size: clamp(26px, 2.4vw, 38px); line-height: 1; letter-spacing: -0.055em; white-space: nowrap; }
    .oev61-price { color: var(--muted); font-size: clamp(24px, 2vw, 34px); font-weight: 450; white-space: nowrap; }
    .oev61-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
    .oev61-status { min-width: 210px; height: 46px; border: 1px solid rgba(37, 99, 235, .28); border-radius: 13px; padding: 0 14px; background: var(--primary); color: #fff; font-weight: 450; outline: 0; }
    .oev61-save { height: 46px !important; padding: 0 22px !important; border-radius: 13px !important; font-weight: 450 !important; }
    .oev61-tabs { display: flex; gap: 24px; align-items: center; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
    .oev61-tabs::-webkit-scrollbar { display: none; }
    .oev61-tabs a { padding: 12px 0 13px; color: var(--muted); font-weight: 450; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
    .oev61-tabs a:hover, .oev61-tabs a.active { color: var(--text); border-bottom-color: var(--primary); }
    .oev61-alert { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; font-weight: 450; }
    .oev61-alert.success { background: rgba(34, 197, 94, .12); color: #15803d; border: 1px solid rgba(34, 197, 94, .22); }
    .oev61-alert.error { background: rgba(239, 68, 68, .12); color: #dc2626; border: 1px solid rgba(239, 68, 68, .22); }
    .oev61-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr); gap: 16px; align-items: start; }
    .oev61-main, .oev61-side { display: grid; gap: 16px; min-width: 0; }
    .oev61-card { border: 1px solid var(--border); border-radius: 18px; background: color-mix(in srgb, var(--card) 94%, transparent); box-shadow: var(--shadow-soft); overflow: hidden; }
    .oev61-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
    .oev61-card h2 { margin: 0; font-size: 18px; line-height: 1.15; letter-spacing: -0.035em; }
    .oev61-card-smallnote { color: var(--muted); font-size: 12px; font-weight: 450; }
    .oev61-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .oev61-fields.one { grid-template-columns: 1fr; }
    .oev61-fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .oev61-field { display: grid; grid-template-columns: minmax(124px, .42fr) minmax(0, 1fr); align-items: center; min-height: 52px; padding: 9px 16px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); gap: 12px; }
    .oev61-fields .oev61-field:nth-child(2n) { border-right: 0; }
    .oev61-fields.three .oev61-field:nth-child(2n) { border-right: 1px solid var(--border); }
    .oev61-fields.three .oev61-field:nth-child(3n) { border-right: 0; }
    .oev61-field.full { grid-column: 1 / -1; border-right: 0; }
    .oev61-label { color: var(--muted); font-size: 13px; line-height: 1.2; font-weight: 780; }
    .oev61-input, .oev61-field input, .oev61-field select, .oev61-field textarea { width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text); font-size: 15px; line-height: 1.25; outline: none; }
    .oev61-field textarea { min-height: 86px; resize: vertical; background: color-mix(in srgb, var(--input) 82%, transparent); border-color: var(--border); }
    .oev61-field input:hover, .oev61-field select:hover, .oev61-field textarea:hover, .oev61-field input:focus, .oev61-field select:focus, .oev61-field textarea:focus { background: var(--input); border-color: rgba(37, 99, 235, .42); box-shadow: 0 0 0 3px rgba(37, 99, 235, .10); }
    .oev61-field select { cursor: pointer; }
    .oev61-quick-status { display: grid; gap: 10px; padding: 16px; }
    .oev61-summary-line { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; min-height: 42px; border-bottom: 1px solid var(--border); }
    .oev61-summary-line:last-child { border-bottom: 0; }
    .oev61-summary-line span { color: var(--muted); font-weight: 780; }
    .oev61-summary-line strong { color: var(--text); font-weight: 450; text-align: right; }
    .oev61-check { display: flex; gap: 10px; align-items: center; padding: 14px 16px; font-weight: 450; color: var(--muted); }
    .oev61-check input { width: 18px; height: 18px; }
    .oev61-sticky-save { position: sticky; bottom: 12px; display: flex; gap: 10px; justify-content: flex-end; padding: 12px; border: 1px solid var(--border); border-radius: 18px; background: color-mix(in srgb, var(--card) 88%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
    html[data-theme="dark"] .oev61-header { background: rgba(17, 17, 17, .88); }
    html[data-theme="dark"] .oev61-card, html[data-theme="dark"] .oev61-sticky-save { background: #1b1b1b; }
    html[data-theme="dark"] .oev61-field input:hover, html[data-theme="dark"] .oev61-field select:hover, html[data-theme="dark"] .oev61-field textarea:hover, html[data-theme="dark"] .oev61-field input:focus, html[data-theme="dark"] .oev61-field select:focus, html[data-theme="dark"] .oev61-field textarea:focus { background: #222; }
    @media (max-width: 1100px) { .oev61-layout { grid-template-columns: 1fr; } .oev61-side { order: -1; } }
    @media (max-width: 760px) {
        .order-editor-v61-page { margin-bottom: 92px; }
        .order-editor-v61-page .desktop-topbar { display: none !important; }
        .oev61-header { position: sticky; top: 0; grid-template-columns: 1fr; padding: 12px 12px; margin: -12px -12px 10px; gap: 10px; }
        .oev61-title-row { gap: 8px; }
        .oev61-back { height: 34px; padding: 0 10px; font-size: 13px; }
        .oev61-title { font-size: 26px; }
        .oev61-price { font-size: 24px; }
        .oev61-actions { display: grid; grid-template-columns: 1fr auto; }
        .oev61-status { min-width: 0; width: 100%; height: 43px; text-align: center; }
        .oev61-save { height: 43px !important; padding: 0 16px !important; }
        .oev61-tabs { gap: 18px; margin-bottom: 10px; }
        .oev61-tabs a { padding: 10px 0 11px; font-size: 14px; }
        .oev61-main, .oev61-side { gap: 10px; }
        .oev61-card { border-radius: 15px; box-shadow: none; }
        .oev61-card-head { padding: 12px 13px; }
        .oev61-card h2 { font-size: 17px; }
        .oev61-fields, .oev61-fields.three { grid-template-columns: 1fr; }
        .oev61-field, .oev61-fields .oev61-field:nth-child(2n), .oev61-fields.three .oev61-field:nth-child(2n), .oev61-fields.three .oev61-field:nth-child(3n) { grid-template-columns: 118px minmax(0, 1fr); min-height: 47px; padding: 7px 12px; border-right: 0; }
        .oev61-label { font-size: 13px; }
        .oev61-field input, .oev61-field select, .oev61-field textarea { min-height: 36px; padding: 7px 8px; font-size: 15px; }
        .oev61-field.full { grid-template-columns: 1fr; gap: 6px; }
        .oev61-field.full .oev61-label { font-size: 14px; }
        .oev61-sticky-save { left: 10px; right: 10px; bottom: 10px; display: grid; grid-template-columns: 1fr 1.25fr; padding: 9px; }
        .oev61-sticky-save .button { width: 100%; justify-content: center; }
    }
    @media (max-width: 430px) {
        .oev61-title { font-size: 23px; }
        .oev61-price { font-size: 21px; }
        .oev61-field { grid-template-columns: 1fr !important; gap: 4px; }
    }

/* V67 inline editing on Orders list: status/master/document can be changed without opening the order. */
body.so-v50-orders-groups .orders-inline-form {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin: 0;
}

body.so-v50-orders-groups .orders-inline-select {
    width: 100%;
    max-width: 170px;
    min-height: 30px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    font-weight: 450;
    line-height: 1.2;
    padding: 5px 28px 5px 10px;
    cursor: pointer;
    box-shadow: none;
}

body.so-v50-orders-groups .orders-inline-select:focus {
    outline: 2px solid color-mix(in srgb, var(--primary) 28%, transparent);
    outline-offset: 2px;
}

body.so-v50-orders-groups .orders-inline-status {
    max-width: 170px;
    border-color: color-mix(in srgb, var(--inline-bg, var(--primary)) 60%, var(--border));
    background: var(--inline-bg, var(--primary-soft));
    color: var(--inline-text, var(--primary));
    text-align: center;
}

body.so-v50-orders-groups .orders-inline-master {
    max-width: 150px;
}

body.so-v50-orders-groups .orders-inline-document {
    max-width: 108px;
    text-align: center;
}

body.so-v50-orders-groups .orders-modern-table th:nth-child(9),
body.so-v50-orders-groups .orders-modern-table td:nth-child(9) {
    width: 92px;
}

@media (max-width: 760px) {
    body.so-v50-orders-groups .mobile-legacy-order,
    body.so-v50-orders-groups .mobile-legacy-order-new,
    body.so-v50-orders-groups .mobile-legacy-order-work,
    body.so-v50-orders-groups .mobile-legacy-order-final {
        background: var(--card) !important;
    }

    body.so-v50-orders-groups .mobile-legacy-order-new .mobile-legacy-grid,
    body.so-v50-orders-groups .mobile-legacy-order-work .mobile-legacy-grid,
    body.so-v50-orders-groups .mobile-legacy-order-final .mobile-legacy-grid,
    body.so-v50-orders-groups .mobile-legacy-grid {
        background: var(--card) !important;
        color: var(--text) !important;
    }

    body.so-v50-orders-groups .mobile-legacy-category,
    body.so-v50-orders-groups .mobile-legacy-master,
    body.so-v50-orders-groups .mobile-legacy-time,
    body.so-v50-orders-groups .mobile-legacy-actions {
        background: transparent !important;
        color: var(--text) !important;
    }

    body.so-v50-orders-groups .mobile-legacy-category a {
        color: var(--primary) !important;
    }

    body.so-v50-orders-groups .mobile-status-select,
    body.so-v50-orders-groups .mobile-master-select,
    body.so-v50-orders-groups .mobile-doc-select {
        width: 100%;
        max-width: 100%;
        min-height: 36px;
        border-radius: 11px;
        font-size: 14px;
        font-weight: 750;
        padding: 6px 25px 6px 9px;
    }

    body.so-v50-orders-groups .mobile-status-select {
        border-color: color-mix(in srgb, var(--inline-bg, var(--primary)) 60%, var(--border));
        background: var(--inline-bg, var(--primary-soft));
        color: var(--inline-text, var(--primary));
    }

    body.so-v50-orders-groups .mobile-master-select {
        background: var(--card-2);
    }

    body.so-v50-orders-groups .mobile-document-form {
        flex: 0 0 76px;
        margin-left: 8px;
    }

    body.so-v50-orders-groups .mobile-doc-select {
        min-height: 36px;
        text-align: center;
        background: var(--card);
        border-radius: 12px;
        font-weight: 450;
    }

    body.so-v50-orders-groups .mobile-legacy-status {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 32px;
        padding: 5px 8px;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 450;
    }

    body.so-v50-orders-groups .mobile-legacy-meta {
        background: var(--card-2) !important;
    }

    :root[data-theme="dark"] body.so-v50-orders-groups .mobile-legacy-meta,
    body.so-v50-orders-groups.so-theme-dark .mobile-legacy-meta {
        background: color-mix(in srgb, var(--card-2) 86%, #000 14%) !important;
    }
}

/* V69: mobile orders visual tuning — readable dark time, narrower device column, wider master column, no arrow on master selector. */
@media (max-width: 760px) {
    body.so-v50-orders-groups .mobile-legacy-head,
    body.so-v50-orders-groups .mobile-legacy-grid {
        grid-template-columns: 1.04fr 1.16fr .48fr .96fr !important;
    }

    body.so-v50-orders-groups .mobile-legacy-time strong {
        color: var(--text) !important;
        opacity: 1 !important;
        font-size: 15px !important;
        font-weight: 620 !important;
        letter-spacing: -0.03em !important;
    }

    html[data-theme="dark"] body.so-v50-orders-groups .mobile-legacy-time strong {
        color: #e5eef8 !important;
        text-shadow: none !important;
    }

    body.so-v50-orders-groups .mobile-master-select {
        appearance: none !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        background-image: none !important;
        padding-right: 7px !important;
        text-align: center !important;
        font-size: 12px !important;
        font-weight: 500 !important;
    }

    body.so-v50-orders-groups .mobile-master-select::-ms-expand {
        display: none !important;
    }

    body.so-v50-orders-groups .mobile-legacy-master {
        padding-left: 7px !important;
        padding-right: 7px !important;
    }

    body.so-v50-orders-groups .mobile-legacy-time {
        padding-left: 4px !important;
        padding-right: 4px !important;
        justify-items: center !important;
        text-align: center !important;
    }
}

@media (max-width: 430px) {
    body.so-v50-orders-groups .mobile-legacy-head,
    body.so-v50-orders-groups .mobile-legacy-grid {
        grid-template-columns: 1.0fr 1.14fr .45fr .90fr !important;
    }

    body.so-v50-orders-groups .mobile-legacy-time strong {
        font-size: 14px !important;
        font-weight: 600 !important;
    }

    body.so-v50-orders-groups .mobile-master-select {
        font-size: 11px !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
}

/* V70: mobile orders list final visual tuning — document/status arrows, meta readability, tabs button and badge. */
@media (max-width: 760px) {
    /* Light theme: address/phone strip should look like the old program, but softer. */
    body.so-v50-orders-groups .mobile-legacy-meta {
        background: #d2d5d9 !important;
        color: #1f2937 !important;
    }

    body.so-v50-orders-groups .mobile-legacy-meta span,
    body.so-v50-orders-groups .mobile-legacy-meta a {
        color: #1f2937 !important;
        opacity: 1 !important;
    }

    /* Dark theme: make ID / address / phone visible. */
    html[data-theme="dark"] body.so-v50-orders-groups .mobile-legacy-meta,
    body.so-v50-orders-groups.so-theme-dark .mobile-legacy-meta {
        background: color-mix(in srgb, var(--card-2) 78%, #ffffff 6%) !important;
        color: #e8f1fb !important;
    }

    html[data-theme="dark"] body.so-v50-orders-groups .mobile-legacy-meta span,
    html[data-theme="dark"] body.so-v50-orders-groups .mobile-legacy-meta a,
    body.so-v50-orders-groups.so-theme-dark .mobile-legacy-meta span,
    body.so-v50-orders-groups.so-theme-dark .mobile-legacy-meta a {
        color: #e8f1fb !important;
        opacity: 1 !important;
    }

    /* Remove select arrows from status and document buttons. */
    body.so-v50-orders-groups .mobile-status-select,
    body.so-v50-orders-groups .mobile-doc-select {
        appearance: none !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        background-image: none !important;
    }

    body.so-v50-orders-groups .mobile-status-select::-ms-expand,
    body.so-v50-orders-groups .mobile-doc-select::-ms-expand {
        display: none !important;
    }

    body.so-v50-orders-groups .mobile-status-select {
        padding-right: 8px !important;
        text-align: center !important;
    }

    /* Make receipt/invoice selector 10% larger and remove arrow padding. */
    body.so-v50-orders-groups .mobile-document-form {
        flex: 0 0 84px !important;
        margin-left: 7px !important;
    }

    body.so-v50-orders-groups .mobile-doc-select {
        min-height: 40px !important;
        padding: 6px 9px !important;
        font-size: 15px !important;
        text-align: center !important;
    }

    /* Fix active counter circle: apply badge styling only to normal tab counters, not +Order spans. */
    body.so-v50-orders-groups .orders-tabs a:not(.orders-tabs-new-order) > span {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 24px !important;
        min-width: 24px !important;
        height: 24px !important;
        min-height: 24px !important;
        margin-left: 6px !important;
        padding: 0 !important;
        border-radius: 999px !important;
        background: var(--primary) !important;
        color: #ffffff !important;
        font-size: 13px !important;
        font-weight: 450 !important;
        line-height: 1 !important;
        vertical-align: middle !important;
    }

    /* Fix +Заявка button: do not let generic badge CSS break inner spans. */
    body.so-v50-orders-groups .orders-tabs-new-order {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        height: 36px !important;
        min-height: 36px !important;
        padding: 0 14px !important;
        border-radius: 15px !important;
        line-height: 1 !important;
        overflow: hidden !important;
    }

    body.so-v50-orders-groups .orders-tabs-new-order span {
        display: inline !important;
        width: auto !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        color: #ffffff !important;
        font-size: inherit !important;
        font-weight: inherit !important;
        line-height: 1 !important;
        box-shadow: none !important;
    }

    body.so-v50-orders-groups .orders-tabs-new-order .orders-new-plus {
        margin-right: 2px !important;
        font-size: 16px !important;
        font-weight: 450 !important;
    }
}

@media (max-width: 430px) {
    body.so-v50-orders-groups .mobile-document-form {
        flex-basis: 78px !important;
        margin-left: 5px !important;
    }

    body.so-v50-orders-groups .mobile-doc-select {
        min-height: 36px !important;
        padding: 5px 7px !important;
        font-size: 13px !important;
    }

    body.so-v50-orders-groups .orders-tabs {
        gap: 14px !important;
    }

    body.so-v50-orders-groups .orders-tabs a:not(.orders-tabs-new-order) > span {
        width: 22px !important;
        min-width: 22px !important;
        height: 22px !important;
        min-height: 22px !important;
        margin-left: 5px !important;
        font-size: 12px !important;
    }

    body.so-v50-orders-groups .orders-tabs-new-order {
        height: 34px !important;
        min-height: 34px !important;
        padding: 0 12px !important;
        border-radius: 14px !important;
        font-size: 12px !important;
    }

    body.so-v50-orders-groups .orders-tabs-new-order .orders-new-plus {
        font-size: 15px !important;
    }
}

/* V71: mobile new order tab label — show only “Новая заявка”, no plus and no duplicate short label. */
@media (max-width: 760px) {
    body.so-v50-orders-groups .orders-tabs-new-order .orders-new-plus,
    body.so-v50-orders-groups .orders-tabs-new-order .orders-new-short {
        display: none !important;
    }

    body.so-v50-orders-groups .orders-tabs-new-order .orders-new-full {
        display: inline !important;
        width: auto !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        color: #ffffff !important;
        font-size: inherit !important;
        font-weight: 450 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    body.so-v50-orders-groups .orders-tabs-new-order {
        gap: 0 !important;
        min-width: 136px !important;
        padding: 0 16px !important;
    }
}

@media (max-width: 430px) {
    body.so-v50-orders-groups .orders-tabs-new-order {
        min-width: 126px !important;
        padding: 0 12px !important;
        font-size: 12px !important;
    }
}

/* V75 tickets and parts orders */
.tickets-page {
    display: grid;
    gap: 16px;
    padding: 18px;
}
.tickets-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.tickets-head h1 {
    margin: 0;
    font-size: clamp(26px, 2.4vw, 38px);
    letter-spacing: -0.055em;
}
.tickets-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-weight: 700;
}
.ticket-badge {
    display: grid;
    gap: 4px;
    min-width: 132px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
    box-shadow: var(--shadow-soft);
}
.ticket-badge span {
    color: var(--muted);
    font-weight: 450;
    font-size: 12px;
}
.ticket-badge strong {
    color: var(--primary);
    font-size: 28px;
    line-height: 1;
}
.tickets-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
    gap: 16px;
    align-items: start;
}
.ticket-card,
.ticket-row {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card);
    box-shadow: var(--shadow-soft);
}
.ticket-card {
    padding: 16px;
}
.ticket-card h2 {
    margin: 0 0 12px;
    font-size: 19px;
    letter-spacing: -0.035em;
}
.ticket-form,
.ticket-filter-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.ticket-filter-form {
    grid-template-columns: 1fr;
}
.ticket-form label,
.ticket-filter-form label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-weight: 450;
    font-size: 13px;
}
.ticket-form input,
.ticket-form select,
.ticket-form textarea,
.ticket-filter-form input,
.ticket-filter-form select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--input);
    color: var(--text);
    font-size: 14px;
    outline: none;
}
.ticket-form textarea {
    resize: vertical;
}
.ticket-form select[multiple] {
    min-height: 128px;
}
.ticket-form small {
    color: var(--muted);
    font-size: 12px;
}
.ticket-form-full,
.ticket-form .button {
    grid-column: 1 / -1;
}
.ticket-list {
    display: grid;
    gap: 10px;
}
.ticket-empty {
    padding: 18px;
    border: 1px dashed var(--border-strong);
    border-radius: 18px;
    color: var(--muted);
    font-weight: 450;
}
.ticket-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 12px;
    padding: 14px;
}
.ticket-row.is-overdue {
    border-color: rgba(239, 68, 68, .55);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .09), var(--shadow-soft);
}
.ticket-row-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}
.ticket-row-title h3 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -0.025em;
}
.ticket-type-pill,
.ticket-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 450;
}
.ticket-type-pill {
    background: rgba(37, 99, 235, .13);
    color: var(--primary);
}
.ticket-row.is-parts .ticket-type-pill {
    background: rgba(245, 158, 11, .18);
    color: #b45309;
}
.ticket-row-main p {
    margin: 8px 0 0;
    color: var(--text);
    line-height: 1.45;
}
.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}
.ticket-meta a {
    color: var(--primary);
    text-decoration: none;
}
.ticket-row-side {
    display: grid;
    gap: 8px;
    align-content: start;
}
.ticket-due {
    color: var(--text);
    font-size: 15px;
}
.ticket-due.danger {
    color: var(--danger);
}
.ticket-status-pill.status-open { background: rgba(37, 99, 235, .14); color: var(--primary); }
.ticket-status-pill.status-in_progress { background: rgba(245, 158, 11, .18); color: #b45309; }
.ticket-status-pill.status-done { background: rgba(34, 197, 94, .16); color: #15803d; }
.ticket-status-pill.status-cancelled { background: rgba(100, 116, 139, .18); color: var(--muted); }
.ticket-inline-form select,
.ticket-add-watchers select {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--input);
    color: var(--text);
    padding: 7px 9px;
}
.ticket-add-watchers summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 450;
    font-size: 13px;
}
.ticket-add-watchers form {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}
.oev75-tickets-card {
    margin-top: 16px;
}
.oev75-ticket-forms {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
}
.oev75-ticket-form {
    display: grid;
    gap: 9px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--input) 52%, transparent);
}
.oev75-ticket-form strong {
    font-size: 16px;
}
.oev75-ticket-form input,
.oev75-ticket-form select,
.oev75-ticket-form textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--card);
    color: var(--text);
    padding: 8px 10px;
}
.oev75-ticket-form textarea {
    resize: vertical;
}
.oev75-ticket-form select[multiple] {
    min-height: 112px;
}
.oev75-ticket-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px;
    gap: 8px;
}
html[data-theme="dark"] .ticket-card,
html[data-theme="dark"] .ticket-row,
html[data-theme="dark"] .ticket-badge {
    background: #111c27;
}
html[data-theme="dark"] .oev75-ticket-form {
    background: #101820;
}
html[data-theme="dark"] .oev75-ticket-form input,
html[data-theme="dark"] .oev75-ticket-form select,
html[data-theme="dark"] .oev75-ticket-form textarea {
    background: #0b1722;
}

@media (max-width: 760px) {
    .tickets-page {
        padding: 10px;
        gap: 10px;
    }
    .tickets-head {
        align-items: stretch;
    }
    .tickets-head h1 {
        font-size: 24px;
    }
    .tickets-head p {
        font-size: 13px;
    }
    .ticket-badge {
        min-width: 90px;
        padding: 10px;
    }
    .tickets-grid,
    .ticket-form,
    .ticket-row,
    .oev75-ticket-forms,
    .oev75-ticket-row {
        grid-template-columns: 1fr;
    }
    .ticket-card,
    .ticket-row {
        border-radius: 15px;
        padding: 12px;
    }
    .ticket-row-side {
        border-top: 1px solid var(--border);
        padding-top: 10px;
    }
    .oev75-tickets-card {
        margin-top: 10px;
    }
    .oev75-ticket-forms {
        padding: 10px;
    }
}

/* V77 ticket notifications */
.ticket-notifications-card {
    display: grid;
    gap: 12px;
    border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
}
.ticket-notifications-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.ticket-notifications-head h2 {
    margin: 0;
}
.ticket-notifications-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-weight: 750;
}
.ticket-notifications-list {
    display: grid;
    gap: 8px;
}
.ticket-notification-row {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--input) 58%, transparent);
}
.ticket-notification-row.is-overdue {
    border-color: rgba(239, 68, 68, .55);
    background: rgba(239, 68, 68, .08);
}
.ticket-notification-row strong {
    color: var(--primary);
    font-size: 13px;
}
.ticket-notification-row span {
    color: var(--text);
    font-weight: 450;
}
.ticket-notification-row small {
    color: var(--muted);
    font-weight: 750;
}
.ticket-notification-row a {
    color: var(--primary);
    text-decoration: none;
}
.ticket-ready-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(14, 165, 233, .15);
    color: var(--primary);
    font-size: 11px;
    font-weight: 450;
}
@media (max-width: 820px) {
    .ticket-notifications-head {
        display: grid;
    }
}

/* V78 master mobile tickets and parts orders */
.master-ticket-icon {
    position: relative;
}

.master-ticket-icon span {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 450;
    line-height: 18px;
    text-align: center;
}

.master-ticket-shortcuts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.master-ticket-shortcuts a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--card);
    color: var(--text);
    box-shadow: var(--shadow-soft);
    font-weight: 450;
}

.master-ticket-shortcuts a span {
    font-size: 18px;
}

.master-ticket-shortcuts a em {
    margin-left: auto;
    min-width: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-style: normal;
    text-align: center;
}

.master-tickets-page {
    display: grid;
    gap: 12px;
}

.master-ticket-hero {
    align-items: center;
}

.master-ticket-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 20px;
    font-weight: 450;
    box-shadow: 0 14px 26px rgba(37, 99, 235, .22);
}

.master-ticket-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--card-2);
}

.master-ticket-tabs a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 35px;
    border-radius: 11px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
}

.master-ticket-tabs a.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, .22);
}

.master-ticket-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.master-ticket-card-head h2 {
    margin: 0;
}

.master-ticket-card-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.master-ticket-notifications-card {
    border-color: color-mix(in srgb, var(--primary) 44%, var(--border));
}

.master-ticket-notifications-list {
    display: grid;
    gap: 8px;
}

.master-ticket-notification {
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--input) 62%, transparent);
}

.master-ticket-notification.is-overdue {
    border-color: rgba(239, 68, 68, .55);
    background: rgba(239, 68, 68, .08);
}

.master-ticket-notification strong {
    color: var(--primary);
    font-size: 12px;
}

.master-ticket-notification span {
    color: var(--text);
    font-weight: 450;
}

.master-ticket-notification small,
.master-ticket-notification a {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.master-ticket-create-card,
.master-ticket-filter-card,
.master-ticket-inline-create {
    overflow: hidden;
}

.master-ticket-create-card > summary,
.master-ticket-filter-card > summary,
.master-ticket-inline-create > summary {
    cursor: pointer;
    color: var(--text);
    font-size: 15px;
    font-weight: 450;
    list-style: none;
}

.master-ticket-create-card > summary::-webkit-details-marker,
.master-ticket-filter-card > summary::-webkit-details-marker,
.master-ticket-inline-create > summary::-webkit-details-marker {
    display: none;
}

.master-ticket-create-card > summary::after,
.master-ticket-filter-card > summary::after,
.master-ticket-inline-create > summary::after {
    content: '▾';
    float: right;
    color: var(--muted);
}

.master-ticket-create-card:not([open]) > summary::after,
.master-ticket-filter-card:not([open]) > summary::after,
.master-ticket-inline-create:not([open]) > summary::after {
    content: '▸';
}

.master-ticket-form {
    margin-top: 12px;
}

.master-ticket-users-block {
    display: grid;
    gap: 8px;
}

.master-ticket-users-block > strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 450;
}

.master-ticket-users-block > small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.master-ticket-users-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
}

.master-ticket-user-choice {
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 9px !important;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--card-2);
    color: var(--text) !important;
    font-size: 13px !important;
    font-weight: 450 !important;
}

.master-ticket-user-choice input {
    width: 18px !important;
    min-height: 18px !important;
    height: 18px !important;
    margin: 0;
    padding: 0 !important;
}

.master-ticket-user-choice span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.master-ticket-user-choice small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 450;
}

.master-ticket-list {
    display: grid;
    gap: 9px;
}

.master-ticket-list-compact {
    margin-top: 12px;
}

.master-ticket-row {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 15px;
    background: var(--card);
    box-shadow: var(--shadow-soft);
}

.master-ticket-row.is-parts {
    border-left-color: var(--warning);
}

.master-ticket-row.is-overdue {
    border-color: rgba(239, 68, 68, .62);
    border-left-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .08), var(--shadow-soft);
}

.master-ticket-row-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.master-ticket-row-title strong {
    color: var(--text);
    font-size: 15px;
    letter-spacing: -0.02em;
}

.master-ticket-type-pill,
.master-ticket-ready-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
    font-weight: 450;
}

.master-ticket-row.is-parts .master-ticket-type-pill {
    background: var(--warning-soft);
    color: var(--warning);
}

.master-ticket-ready-pill {
    min-width: 25px;
    background: var(--danger-soft);
    color: var(--danger);
}

.master-ticket-row p {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.45;
}

.master-ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
}

.master-ticket-meta a,
.master-ticket-meta .danger,
.master-ticket-meta span.danger {
    color: var(--danger);
}

.master-ticket-meta a {
    color: var(--primary);
}

.master-ticket-status-form select {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--input);
    color: var(--text);
    padding: 7px 9px;
}

.master-ticket-add-recipient summary {
    cursor: pointer;
    color: var(--primary);
    font-size: 13px;
    font-weight: 450;
}

.master-ticket-add-recipient form {
    display: grid;
    gap: 8px;
}

.master-order-ticket-card .master-ticket-inline-create {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--input) 58%, transparent);
}

html[data-theme="dark"] .master-ticket-shortcuts a,
html[data-theme="dark"] .master-ticket-row,
html[data-theme="dark"] .master-ticket-user-choice,
html[data-theme="dark"] .master-ticket-notification,
html[data-theme="dark"] .master-order-ticket-card .master-ticket-inline-create {
    background: #101c29;
}

@media (max-width: 480px) {
    .master-ticket-card-head {
        display: grid;
    }

    .master-ticket-shortcuts,
    .master-ticket-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .master-ticket-tabs a:first-child {
        grid-column: 1 / -1;
    }
}

/* V79 HelloClient-style tasks / parts orders */
.hc-tasks-page {
    position: relative;
    display: grid;
    gap: 18px;
    padding: 20px 18px 96px;
    min-height: calc(100vh - 40px);
}
.hc-tasks-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.hc-tasks-tabs {
    display: flex;
    align-items: center;
    gap: 19px;
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.hc-tasks-tabs::-webkit-scrollbar {
    display: none;
}
.hc-tasks-tabs span,
.hc-tasks-tabs i,
.hc-tasks-tabs a {
    color: var(--muted);
    font-size: 16px;
    font-weight: 450;
    text-decoration: none;
}
.hc-tasks-tabs i {
    font-style: normal;
    opacity: .8;
}
.hc-tasks-tabs a {
    position: relative;
    padding: 8px 0 9px;
}
.hc-tasks-tabs a.active {
    color: var(--primary);
}
.hc-tasks-tabs a.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 999px;
    background: var(--primary);
}
.hc-tasks-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}
.hc-round-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font-size: 17px;
    font-weight: 450;
    text-decoration: none;
    cursor: pointer;
}
.hc-round-action em {
    position: absolute;
    top: -5px;
    right: -3px;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 999px;
    background: #f5b400;
    color: #111;
    font-size: 10px;
    font-style: normal;
    line-height: 17px;
}
.hc-task-searchbar {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 52px;
    align-items: center;
    gap: 0;
    min-height: 48px;
    max-width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: color-mix(in srgb, var(--card) 78%, transparent);
    overflow: hidden;
}
.hc-task-searchbar > span {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 25px;
    font-weight: 450;
}
.hc-task-searchbar input[type="search"] {
    width: 100%;
    height: 48px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 15px;
    font-weight: 450;
}
.hc-task-help {
    width: 40px;
    height: 40px;
    margin-right: 4px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: transparent;
    color: var(--muted);
    font-weight: 450;
    cursor: pointer;
}
.hc-task-filter-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 450;
}
.hc-task-filter-line span,
.hc-task-filter-line a {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
}
.hc-task-section {
    display: grid;
    gap: 12px;
}
.hc-task-section h2 {
    margin: 18px 0 6px;
    color: var(--text);
    font-size: 19px;
    font-weight: 450;
    letter-spacing: -0.03em;
}
.hc-task-section.is-overdue h2 {
    color: var(--danger);
}
.hc-task-list {
    display: grid;
    border-top: 1px solid var(--border);
}
.hc-task-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) minmax(150px, auto);
    gap: 14px;
    align-items: center;
    min-height: 56px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}
.hc-task-row:hover {
    background: color-mix(in srgb, var(--card) 58%, transparent);
}
.hc-task-check {
    display: grid;
    place-items: center;
}
.hc-task-check button {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 2px solid color-mix(in srgb, var(--muted) 72%, transparent);
    border-radius: 3px;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
}
.hc-task-check span {
    font-size: 13px;
    font-weight: 450;
    line-height: 1;
}
.hc-task-mainline {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 4px;
    color: var(--text);
    font-size: 14px;
    font-weight: 450;
}
.hc-task-mainline a,
.hc-task-mainline span {
    color: var(--primary);
    font-weight: 450;
    text-decoration: none;
    flex: 0 0 auto;
}
.hc-task-mainline strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-size: 14px;
    font-weight: 450;
}
.hc-task-row time {
    justify-self: end;
    color: var(--text);
    font-size: 14px;
    font-weight: 450;
    white-space: nowrap;
}
.hc-task-row.is-overdue time {
    color: var(--danger);
}
.hc-task-row.is-done .hc-task-mainline strong,
.hc-task-row.is-done time {
    color: var(--muted);
    text-decoration: line-through;
}
.hc-task-row.is-parts .hc-task-mainline a,
.hc-task-row.is-parts .hc-task-mainline span {
    color: var(--warning);
}
.hc-task-empty {
    display: grid;
    place-items: center;
    min-height: 160px;
    border: 1px dashed var(--border-strong);
    border-radius: 18px;
    color: var(--muted);
    font-weight: 450;
}
.hc-task-floating {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 132px;
    min-height: 56px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 18px 38px rgba(37, 99, 235, .32);
    font-size: 16px;
    font-weight: 450;
    cursor: pointer;
}
.hc-task-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
}
.hc-task-modal.is-open {
    display: block;
}
.hc-task-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .62);
}
.hc-task-modal-panel {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 18px;
    width: min(520px, calc(100vw - 32px));
    max-height: calc(100vh - 56px);
    margin: 36px auto;
    padding: 28px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card);
    color: var(--text);
    box-shadow: 0 28px 70px rgba(0, 0, 0, .36);
}
.hc-task-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.hc-task-modal-head h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 450;
    letter-spacing: -0.04em;
}
.hc-task-modal-head button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 24px;
    cursor: pointer;
}
.hc-task-order-box {
    display: grid;
    gap: 3px;
    padding: 16px 18px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    color: var(--text);
}
.hc-task-order-box a,
.hc-task-order-box span {
    color: var(--muted);
    font-weight: 450;
    text-decoration: none;
}
.hc-task-detail-list {
    display: grid;
    gap: 12px;
    margin: 0;
}
.hc-task-detail-list div {
    display: grid;
    gap: 5px;
}
.hc-task-detail-list dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 450;
}
.hc-task-detail-list dd {
    margin: 0;
    color: var(--text);
    font-weight: 450;
    line-height: 1.45;
}
.hc-task-detail-list dd.danger {
    color: var(--danger);
}
.hc-task-modal-form,
.hc-create-task-form {
    display: grid;
    gap: 12px;
}
.hc-task-modal-form label,
.hc-create-task-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 450;
}
.hc-task-modal-form input,
.hc-task-modal-form select,
.hc-task-modal-form textarea,
.hc-create-task-form input,
.hc-create-task-form select,
.hc-create-task-form textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--input);
    color: var(--text);
}
.hc-task-modal-form select[multiple],
.hc-create-task-form select[multiple] {
    min-height: 130px;
}
.hc-task-add-recipients summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 450;
}
.hc-task-notifications-list {
    display: grid;
    gap: 9px;
}
.hc-task-notification {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--input);
}
.hc-task-notification.is-overdue {
    border-color: rgba(239, 68, 68, .58);
}
.hc-task-muted {
    color: var(--muted);
    font-weight: 450;
}
.hc-task-modal-open,
.master-order-task-modal-open {
    overflow: hidden;
}
html[data-theme="dark"] .hc-task-row:hover {
    background: #222;
}
html[data-theme="dark"] .hc-task-searchbar,
html[data-theme="dark"] .hc-task-modal-panel {
    background: #1b1b1b;
}
html[data-theme="dark"] .hc-task-modal-form input,
html[data-theme="dark"] .hc-task-modal-form select,
html[data-theme="dark"] .hc-task-modal-form textarea,
html[data-theme="dark"] .hc-create-task-form input,
html[data-theme="dark"] .hc-create-task-form select,
html[data-theme="dark"] .hc-create-task-form textarea,
html[data-theme="dark"] .hc-task-notification {
    background: #222;
}

/* V79 order editor side tasks */
.oev79-side-task-card {
    overflow: hidden;
}
.oev79-side-task-card .oev61-card-head {
    align-items: center;
}
.oev79-side-task-card .button.small {
    min-height: 34px;
    padding: 0 11px;
    border-radius: 11px;
    font-size: 12px;
}
.oev79-side-task-list {
    display: grid;
    padding: 4px 0;
}
.oev79-side-task-empty {
    margin: 0;
    padding: 12px 16px 16px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 450;
}
.oev79-side-task-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}
.oev79-side-task-row:hover {
    background: color-mix(in srgb, var(--input) 58%, transparent);
}
.oev79-side-task-check {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 2px solid color-mix(in srgb, var(--muted) 70%, transparent);
    border-radius: 3px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 450;
}
.oev79-side-task-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-size: 13px;
    font-weight: 450;
}
.oev79-side-task-row time {
    grid-column: 2;
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
}
.oev79-side-task-row.is-overdue time {
    color: var(--danger);
}
.oev79-side-task-row.is-done strong,
.oev79-side-task-row.is-done time {
    text-decoration: line-through;
    color: var(--muted);
}
.oev79-side-task-row.is-parts .oev79-side-task-check {
    color: var(--warning);
}

/* V79 master order compact task rows and modal */
.master-order-task-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}
.master-order-task-group {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}
.master-order-task-group h3 {
    margin: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 450;
}
.master-order-task-lines {
    display: grid;
    border-top: 1px solid var(--border);
}
.master-order-task-line {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 9px 0;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}
.master-order-task-check {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 2px solid color-mix(in srgb, var(--muted) 70%, transparent);
    border-radius: 3px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 450;
}
.master-order-task-line strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-size: 14px;
    font-weight: 450;
}
.master-order-task-line time {
    color: var(--text);
    font-size: 12px;
    font-weight: 450;
    white-space: nowrap;
}
.master-order-task-line.is-overdue time {
    color: var(--danger);
}
.master-order-task-line.is-parts .master-order-task-check {
    color: var(--warning);
}
.master-order-task-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
}
.master-order-task-modal.is-open {
    display: block;
}
.master-order-task-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .68);
}
.master-order-task-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: grid;
    gap: 16px;
    max-height: 86vh;
    padding: 20px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
    background: var(--card);
    color: var(--text);
    box-shadow: 0 -18px 50px rgba(0, 0, 0, .35);
}
.master-order-task-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.master-order-task-panel-head h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 450;
}
.master-order-task-panel-head button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 28px;
}
.master-order-task-order-box {
    display: grid;
    gap: 4px;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
}
.master-order-task-order-box span {
    color: var(--muted);
    font-weight: 450;
}
.master-order-task-details {
    display: grid;
    gap: 10px;
    margin: 0;
}
.master-order-task-details div {
    display: grid;
    gap: 4px;
}
.master-order-task-details dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
}
.master-order-task-details dd {
    margin: 0;
    color: var(--text);
    font-weight: 450;
    line-height: 1.45;
}
.master-order-task-details dd.danger {
    color: var(--danger);
}
html[data-theme="dark"] .master-order-task-panel {
    background: #1b1b1b;
}

@media (max-width: 760px) {
    .hc-tasks-page {
        padding: 10px 0 92px;
        gap: 14px;
    }
    .master-tasks-page .master-mobile-backbar {
        margin: 0 10px;
    }
    .hc-tasks-topline {
        padding: 0 14px;
        overflow: hidden;
    }
    .hc-tasks-tabs {
        gap: 17px;
    }
    .hc-tasks-tabs span,
    .hc-tasks-tabs i,
    .hc-tasks-tabs a {
        font-size: 20px;
    }
    .hc-tasks-top-actions {
        margin-left: auto;
    }
    .hc-round-action {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }
    .hc-task-searchbar {
        margin: 0 14px;
        grid-template-columns: 52px minmax(0, 1fr) 56px;
        min-height: 66px;
        border-radius: 24px;
    }
    .hc-task-searchbar > span {
        font-size: 36px;
    }
    .hc-task-searchbar input[type="search"] {
        height: 64px;
        font-size: 20px;
    }
    .hc-task-help {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        font-size: 18px;
    }
    .hc-task-filter-line {
        padding: 0 14px;
    }
    .hc-task-section h2 {
        margin: 28px 14px 10px;
        font-size: 24px;
    }
    .hc-task-list {
        border-top: 1px solid var(--border);
    }
    .hc-task-row {
        grid-template-columns: 34px minmax(0, 1fr) minmax(106px, 120px);
        gap: 12px;
        min-height: 82px;
        padding: 14px;
    }
    .hc-task-check button {
        width: 26px;
        height: 26px;
    }
    .hc-task-mainline {
        display: block;
        font-size: 20px;
        line-height: 1.22;
    }
    .hc-task-mainline a,
    .hc-task-mainline span,
    .hc-task-mainline strong {
        font-size: 20px;
        white-space: normal;
    }
    .hc-task-row time {
        align-self: center;
        white-space: normal;
        font-size: 18px;
        line-height: 1.15;
    }
    .hc-task-floating {
        right: 16px;
        bottom: 82px;
        min-width: 150px;
        min-height: 58px;
        font-size: 18px;
    }
    .hc-task-modal-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        max-height: 86vh;
        margin: 0;
        padding: 22px;
        border-radius: 20px 20px 0 0;
    }
    .master-order-task-line {
        grid-template-columns: 26px minmax(0, 1fr) 90px;
    }
    .master-order-task-line time {
        white-space: normal;
        text-align: right;
    }
}

/* V80 compact tasks list search/layout fix */
.hc-tasks-page {
    align-content: start !important;
    grid-auto-rows: max-content !important;
}

.hc-tasks-topline,
.hc-task-searchbar,
.hc-task-filter-line,
.hc-task-section,
.hc-task-empty {
    align-self: start !important;
}

.hc-task-searchbar {
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    padding: 0 !important;
    border-radius: 999px !important;
}

.hc-task-searchbar input[type="search"] {
    height: 46px !important;
    min-height: 0 !important;
    padding: 0 !important;
    line-height: 46px !important;
}

.hc-task-searchbar > span {
    height: 46px !important;
    font-size: 22px !important;
}

.hc-task-help {
    width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    border-radius: 13px !important;
}

.hc-task-empty {
    min-height: 120px !important;
}

@media (max-width: 760px) {
    .hc-tasks-page {
        align-content: start !important;
        grid-auto-rows: max-content !important;
        gap: 12px !important;
        padding-top: 10px !important;
    }

    .hc-tasks-topline {
        min-height: 44px !important;
        align-items: center !important;
    }

    .hc-task-searchbar {
        height: 52px !important;
        min-height: 52px !important;
        max-height: 52px !important;
        grid-template-columns: 44px minmax(0, 1fr) 46px !important;
        border-radius: 18px !important;
    }

    .hc-task-searchbar > span {
        height: 50px !important;
        font-size: 25px !important;
    }

    .hc-task-searchbar input[type="search"] {
        height: 50px !important;
        line-height: 50px !important;
        font-size: 17px !important;
    }

    .hc-task-help {
        width: 38px !important;
        height: 38px !important;
        min-height: 38px !important;
        margin-right: 4px !important;
        border-radius: 12px !important;
        font-size: 16px !important;
    }

    .hc-task-empty {
        min-height: 100px !important;
        margin: 0 14px !important;
    }
}

/* V81: HelloClient compact monochrome UI tuning */
:root {
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --border-strong: #d7dee9;
    --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.06);
}

html[data-theme="dark"] {
    --bg: #181818;
    --bg-soft: #161616;
    --card: #1f1f1f;
    --card-2: #242424;
    --text: #f2f2f2;
    --muted: #a7a7a7;
    --muted-2: #777777;
    --border: #313131;
    --border-strong: #3d3d3d;
    --primary: #6b8cff;
    --primary-hover: #83a0ff;
    --primary-soft: rgba(255, 255, 255, 0.08);
    --success: #bdbdbd;
    --success-soft: rgba(255, 255, 255, 0.08);
    --danger: #ff4d4f;
    --danger-soft: rgba(255, 77, 79, 0.11);
    --warning: #cfcfcf;
    --warning-soft: rgba(255, 255, 255, 0.08);
    --sidebar: #1f1f1f;
    --sidebar-text: #f2f2f2;
    --input: #202020;
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
    --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.22);
}

body,
button,
input,
select,
textarea {
    font-family: var(--font) !important;
}

body.so-app,
html[data-theme="dark"] body.so-app {
    background: var(--bg) !important;
}

.app-nav-icon,
.hc-inline-icon {
    display: block;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.icon-button .app-nav-icon,
.hc-round-action .hc-inline-icon,
.hc-task-help .hc-inline-icon {
    width: 18px;
    height: 18px;
}

.sidebar-nav a span,
.nav-icon-wrap {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Compact shell */
.desktop-shell {
    grid-template-columns: 206px minmax(0, 1fr) !important;
}

.sidebar {
    padding: 18px 12px !important;
}

.sidebar-brand {
    padding: 0 8px 20px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
}

.sidebar-nav {
    gap: 4px !important;
}

.sidebar-nav a {
    min-height: 38px !important;
    gap: 12px !important;
    padding: 0 12px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
}

.sidebar-nav a strong,
.sidebar-user strong,
.master-bottom-nav a strong,
.button,
.link-button,
.icon-button,
.theme-toggle,
.lang-form select {
    font-weight: 500 !important;
}

.sidebar-nav a.active {
    background: var(--primary-soft) !important;
    color: var(--primary) !important;
}

html[data-theme="dark"] .sidebar-nav a:hover,
html[data-theme="dark"] .sidebar-nav a.active {
    background: #2b2b2b !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .desktop-topbar,
html[data-theme="dark"] .master-topbar {
    background: #1f1f1f !important;
}

html[data-theme="dark"] .desktop-main,
html[data-theme="dark"] .desktop-content,
html[data-theme="dark"] .master-page-wrap {
    background: #181818 !important;
}

.desktop-topbar,
.master-topbar {
    min-height: 60px !important;
    padding: 10px 18px !important;
}

.desktop-topbar h1 {
    font-size: 18px !important;
    font-weight: 600 !important;
    letter-spacing: -0.02em !important;
}

.desktop-content,
.page {
    width: min(100% - 28px, 1460px) !important;
    margin-top: 14px !important;
}

.brand-mark {
    width: 30px !important;
    height: 30px !important;
    border-radius: 10px !important;
}

/* Do not duplicate the page name on the HelloClient-style task page. */
body.route-tickets .desktop-topbar > div:first-child,
body.route-master-tickets .desktop-topbar > div:first-child {
    display: none !important;
}

body.route-tickets .desktop-topbar,
body.route-master-tickets .desktop-topbar {
    justify-content: flex-end !important;
}

body.route-tickets .desktop-content,
body.route-master-tickets .desktop-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 18px 28px 82px !important;
}

/* HelloClient-style compact tasks */
.hc-tasks-page {
    min-height: auto !important;
    padding: 18px 10px 78px !important;
    gap: 12px !important;
}

.hc-tasks-tabs {
    gap: 16px !important;
}

.hc-tasks-tabs span,
.hc-tasks-tabs i,
.hc-tasks-tabs a {
    font-size: 14px !important;
    font-weight: 500 !important;
}

.hc-round-action {
    width: 38px !important;
    height: 38px !important;
    color: var(--text) !important;
}

.hc-task-searchbar {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    grid-template-columns: 40px minmax(0, 1fr) 44px !important;
    border-color: var(--border-strong) !important;
    background: transparent !important;
}

.hc-task-searchbar input[type="search"] {
    height: 40px !important;
    line-height: 40px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
}

.hc-task-searchbar > span {
    height: 40px !important;
    font-size: 14px !important;
}

.hc-task-help {
    width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    border-radius: 11px !important;
}

.hc-task-section h2 {
    margin: 12px 0 4px !important;
    font-size: 18px !important;
    font-weight: 500 !important;
}

.hc-task-row {
    min-height: 48px !important;
    padding: 7px 0 !important;
    grid-template-columns: 28px minmax(0, 1fr) minmax(132px, auto) !important;
}

.hc-task-mainline,
.hc-task-mainline strong,
.hc-task-mainline a,
.hc-task-mainline span,
.hc-task-row time {
    font-size: 14px !important;
    font-weight: 400 !important;
}

.hc-task-mainline a,
.hc-task-mainline span {
    font-weight: 500 !important;
}

.hc-task-check button {
    width: 19px !important;
    height: 19px !important;
    border-radius: 3px !important;
}

.hc-task-empty {
    min-height: 72px !important;
    border: 0 !important;
    background: transparent !important;
    font-weight: 500 !important;
}

.hc-task-floating {
    min-width: 124px !important;
    min-height: 50px !important;
    right: 22px !important;
    bottom: 22px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
}

.hc-task-modal-panel {
    gap: 14px !important;
    padding: 24px !important;
}

.hc-task-modal-head h2,
.master-order-task-panel-head h2 {
    font-weight: 600 !important;
}

.hc-task-detail-list dt,
.hc-task-detail-list dd,
.hc-task-modal-form label,
.hc-create-task-form label,
.hc-task-muted,
.master-order-task-details dt,
.master-order-task-details dd {
    font-weight: 400 !important;
}

.hc-task-order-box a,
.hc-task-order-box span,
.master-order-task-order-box span {
    font-weight: 500 !important;
}

html[data-theme="dark"] .hc-task-searchbar,
html[data-theme="dark"] .hc-task-modal-panel,
html[data-theme="dark"] .hc-task-notification,
html[data-theme="dark"] .master-order-task-panel,
html[data-theme="dark"] .order-edit-card,
html[data-theme="dark"] .order-edit-sticky-actions,
html[data-theme="dark"] .oev61-card,
html[data-theme="dark"] .oev61-sticky-save {
    background: #1f1f1f !important;
}

html[data-theme="dark"] .hc-task-row:hover,
html[data-theme="dark"] .oev79-side-task-row:hover,
html[data-theme="dark"] .master-order-task-line:hover {
    background: #252525 !important;
}

html[data-theme="dark"] .hc-task-modal-form input,
html[data-theme="dark"] .hc-task-modal-form select,
html[data-theme="dark"] .hc-task-modal-form textarea,
html[data-theme="dark"] .hc-create-task-form input,
html[data-theme="dark"] .hc-create-task-form select,
html[data-theme="dark"] .hc-create-task-form textarea,
html[data-theme="dark"] .form input,
html[data-theme="dark"] .form select,
html[data-theme="dark"] .form textarea {
    background: #242424 !important;
}

.oev79-side-task-empty,
.oev79-side-task-row strong,
.oev79-side-task-row time,
.master-order-task-group h3,
.master-order-task-line strong,
.master-order-task-line time {
    font-weight: 400 !important;
}

.oev79-side-task-check,
.master-order-task-check,
.hc-task-check button {
    color: var(--text) !important;
}

.oev79-side-task-row.is-parts .oev79-side-task-check,
.master-order-task-line.is-parts .master-order-task-check,
.hc-task-row.is-parts .hc-task-mainline a,
.hc-task-row.is-parts .hc-task-mainline span {
    color: var(--text) !important;
}

@media (max-width: 900px) {
    body.so-v55-mobile-header:not(.so-master-shell) .sidebar,
    body.so-v54-mobile-header:not(.so-master-shell) .sidebar {
        gap: 6px !important;
        padding: 10px !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .sidebar-nav,
    body.so-v54-mobile-header:not(.so-master-shell) .sidebar-nav {
        gap: 6px !important;
        padding: 2px 0 !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .sidebar-nav a,
    body.so-v54-mobile-header:not(.so-master-shell) .sidebar-nav a {
        min-height: 34px !important;
        padding: 0 10px !important;
        font-size: 13px !important;
        font-weight: 400 !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .sidebar-brand {
        font-size: 15px !important;
        font-weight: 600 !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .mobile-shell-actions .lang-form select,
    body.so-v55-mobile-header:not(.so-master-shell) .mobile-shell-actions .icon-button {
        width: 36px !important;
        min-width: 36px !important;
        height: 36px !important;
        min-height: 36px !important;
        border-radius: 12px !important;
        font-weight: 500 !important;
    }

    body.so-v55-mobile-header:not(.so-master-shell) .mobile-shell-actions .lang-form select {
        width: 54px !important;
        min-width: 54px !important;
    }

    body.route-tickets .desktop-content,
    body.route-master-tickets .desktop-content {
        padding: 12px 14px 88px !important;
    }
}

@media (max-width: 760px) {
    .hc-tasks-page {
        padding: 6px 0 88px !important;
        gap: 10px !important;
    }

    .hc-tasks-topline {
        min-height: 36px !important;
        padding: 0 6px !important;
    }

    .hc-tasks-tabs {
        gap: 14px !important;
    }

    .hc-tasks-tabs span,
    .hc-tasks-tabs i,
    .hc-tasks-tabs a {
        font-size: 17px !important;
        font-weight: 500 !important;
    }

    .hc-round-action {
        width: 38px !important;
        height: 38px !important;
    }

    .hc-task-searchbar {
        margin: 0 6px !important;
        height: 46px !important;
        min-height: 46px !important;
        max-height: 46px !important;
        grid-template-columns: 40px minmax(0, 1fr) 42px !important;
        border-radius: 16px !important;
    }

    .hc-task-searchbar input[type="search"] {
        height: 44px !important;
        line-height: 44px !important;
        font-size: 16px !important;
    }

    .hc-task-searchbar > span {
        height: 44px !important;
    }

    .hc-task-section h2 {
        margin: 18px 6px 6px !important;
        font-size: 20px !important;
        font-weight: 500 !important;
    }

    .hc-task-row {
        grid-template-columns: 30px minmax(0, 1fr) 96px !important;
        gap: 10px !important;
        min-height: 62px !important;
        padding: 10px 6px !important;
    }

    .hc-task-mainline,
    .hc-task-mainline a,
    .hc-task-mainline span,
    .hc-task-mainline strong {
        font-size: 16px !important;
        line-height: 1.25 !important;
    }

    .hc-task-row time {
        font-size: 14px !important;
        line-height: 1.18 !important;
    }

    .hc-task-empty {
        margin: 0 6px !important;
        min-height: 66px !important;
        place-items: start !important;
        align-items: center !important;
        padding: 14px 0 !important;
        font-size: 15px !important;
    }

    .hc-task-floating {
        right: 14px !important;
        bottom: 74px !important;
        min-height: 52px !important;
        min-width: 128px !important;
        font-size: 16px !important;
    }
}

/* V82 — orders search and filter drawer like HelloClient, only visual layer */
body.so-v50-orders-groups .orders-redesign {
    gap: 12px !important;
}

body.so-v50-orders-groups .orders-topline {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 18px !important;
    min-height: 48px !important;
    padding: 0 !important;
    border-bottom: 1px solid var(--border) !important;
}

body.so-v50-orders-groups .orders-topline .orders-tabs {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    min-height: 48px !important;
    height: 48px !important;
    gap: 24px !important;
    border-bottom: 0 !important;
    overflow-x: auto !important;
}

body.so-v50-orders-groups .orders-topline .orders-tabs a {
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
}

body.so-v50-orders-groups .orders-topline .orders-tabs a.active::after {
    bottom: 0 !important;
    height: 2px !important;
}

body.so-v50-orders-groups .orders-topline .orders-tabs a > span {
    min-width: 22px !important;
    height: 22px !important;
    padding: 2px 7px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

body.so-v50-orders-groups .orders-topline-actions {
    display: flex !important;
    flex: 0 1 760px !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    min-width: 320px !important;
}

body.so-v50-orders-groups .orders-top-search {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    align-items: center !important;
    width: min(100%, 560px) !important;
    height: 44px !important;
    min-height: 44px !important;
    border: 1px solid var(--border) !important;
    border-radius: 999px !important;
    background: var(--card) !important;
    color: var(--text) !important;
    box-shadow: none !important;
    overflow: hidden !important;
}

body.so-v50-orders-groups .orders-top-search-icon {
    display: grid !important;
    width: 42px !important;
    height: 42px !important;
    place-items: center !important;
    color: var(--muted) !important;
}

body.so-v50-orders-groups .orders-top-search input[type="search"] {
    width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 14px 0 0 !important;
    border: 0 !important;
    outline: none !important;
    background: transparent !important;
    color: var(--text) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
}

body.so-v50-orders-groups .orders-top-search input[type="search"]::placeholder {
    color: var(--muted) !important;
    opacity: 0.88 !important;
}

body.so-v50-orders-groups .orders-top-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    height: 44px !important;
    min-width: 44px !important;
    padding: 0 14px !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    background: var(--card) !important;
    color: var(--text) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    list-style: none !important;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease !important;
}

body.so-v50-orders-groups .orders-top-button:hover {
    background: var(--card-2) !important;
    border-color: color-mix(in srgb, var(--border) 72%, var(--text)) !important;
    transform: translateY(-1px) !important;
}

body.so-v50-orders-groups .orders-filter-drawer {
    position: relative !important;
    display: inline-flex !important;
}

body.so-v50-orders-groups .orders-filter-drawer > summary,
body.so-v50-orders-groups .orders-filter-drawer > summary::-webkit-details-marker {
    list-style: none !important;
    display: none !important;
}

body.so-v50-orders-groups .orders-filter-drawer > summary.orders-top-button {
    display: inline-flex !important;
}

body.so-v50-orders-groups .orders-filter-drawer-backdrop {
    display: none !important;
}

body.so-v50-orders-groups .orders-filter-drawer[open] .orders-filter-drawer-backdrop {
    position: fixed !important;
    z-index: 5000 !important;
    inset: 0 !important;
    display: block !important;
    background: rgba(0, 0, 0, 0.48) !important;
}

body.so-v50-orders-groups .orders-filter-drawer-panel {
    position: fixed !important;
    z-index: 5001 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: none !important;
    width: min(420px, 92vw) !important;
    padding: 28px 24px !important;
    overflow-y: auto !important;
    border-left: 1px solid var(--border) !important;
    background: var(--card) !important;
    color: var(--text) !important;
    box-shadow: -24px 0 80px rgba(15, 23, 42, 0.18) !important;
}

body.so-v50-orders-groups .orders-filter-drawer[open] .orders-filter-drawer-panel {
    display: block !important;
}

body.so-v50-orders-groups .orders-filter-drawer-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 14px !important;
    margin: 0 0 24px !important;
}

body.so-v50-orders-groups .orders-filter-drawer-head h2 {
    margin: 0 !important;
    font-size: 22px !important;
    font-weight: 600 !important;
    letter-spacing: -0.02em !important;
}

body.so-v50-orders-groups .orders-filter-close {
    display: grid !important;
    width: 42px !important;
    height: 42px !important;
    place-items: center !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: transparent !important;
    color: var(--text) !important;
    cursor: pointer !important;
}

body.so-v50-orders-groups .orders-filter-close:hover {
    background: var(--card-2) !important;
}

body.so-v50-orders-groups .orders-filter-drawer-form {
    display: grid !important;
    gap: 16px !important;
}

body.so-v50-orders-groups .orders-filter-drawer-form label {
    display: grid !important;
    gap: 7px !important;
}

body.so-v50-orders-groups .orders-filter-drawer-form label > span {
    color: var(--muted) !important;
    font-size: 12px !important;
    font-weight: 400 !important;
}

body.so-v50-orders-groups .orders-filter-drawer-form input,
body.so-v50-orders-groups .orders-filter-drawer-form select {
    width: 100% !important;
    height: 58px !important;
    min-height: 58px !important;
    padding: 0 14px !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    background: var(--input) !important;
    color: var(--text) !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    outline: none !important;
}

body.so-v50-orders-groups .orders-filter-drawer-form input:focus,
body.so-v50-orders-groups .orders-filter-drawer-form select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent) !important;
}

body.so-v50-orders-groups .orders-filter-drawer-actions {
    display: grid !important;
    gap: 10px !important;
    padding-top: 12px !important;
}

body.so-v50-orders-groups .orders-filter-update {
    width: 100% !important;
    height: 48px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: var(--primary) !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
}

body.so-v50-orders-groups .orders-filter-reset {
    display: inline-flex !important;
    justify-content: center !important;
    color: var(--muted) !important;
    font-size: 13px !important;
    font-weight: 400 !important;
}

html[data-theme="dark"] body.so-v50-orders-groups .orders-topline {
    border-bottom-color: #242424 !important;
}

html[data-theme="dark"] body.so-v50-orders-groups .orders-top-search,
html[data-theme="dark"] body.so-v50-orders-groups .orders-top-button {
    border-color: #454545 !important;
    background: #1b1b1b !important;
    color: #eeeeee !important;
}

html[data-theme="dark"] body.so-v50-orders-groups .orders-top-search input[type="search"] {
    color: #eeeeee !important;
}

html[data-theme="dark"] body.so-v50-orders-groups .orders-top-search-icon,
html[data-theme="dark"] body.so-v50-orders-groups .orders-top-search input[type="search"]::placeholder {
    color: #a8a8a8 !important;
}

html[data-theme="dark"] body.so-v50-orders-groups .orders-top-button:hover {
    background: #262626 !important;
    border-color: #626262 !important;
}

html[data-theme="dark"] body.so-v50-orders-groups .orders-filter-drawer-panel {
    border-left-color: #545454 !important;
    background: #404040 !important;
    color: #f2f2f2 !important;
    box-shadow: -24px 0 80px rgba(0, 0, 0, 0.42) !important;
}

html[data-theme="dark"] body.so-v50-orders-groups .orders-filter-drawer-form input,
html[data-theme="dark"] body.so-v50-orders-groups .orders-filter-drawer-form select {
    border-color: #6a6a6a !important;
    background: #444444 !important;
    color: #f2f2f2 !important;
}

html[data-theme="dark"] body.so-v50-orders-groups .orders-filter-drawer-form label > span,
html[data-theme="dark"] body.so-v50-orders-groups .orders-filter-reset {
    color: #cfcfcf !important;
}

html[data-theme="dark"] body.so-v50-orders-groups .orders-filter-close {
    color: #f2f2f2 !important;
}

html[data-theme="dark"] body.so-v50-orders-groups .orders-filter-close:hover {
    background: #4f4f4f !important;
}

@media (max-width: 1100px) {
    body.so-v50-orders-groups .orders-topline {
        align-items: stretch !important;
        flex-direction: column !important;
        gap: 12px !important;
        padding-bottom: 12px !important;
    }

    body.so-v50-orders-groups .orders-topline .orders-tabs {
        width: 100% !important;
    }

    body.so-v50-orders-groups .orders-topline-actions {
        width: 100% !important;
        min-width: 0 !important;
        flex: 0 0 auto !important;
        justify-content: flex-start !important;
    }

    body.so-v50-orders-groups .orders-top-search {
        width: auto !important;
        flex: 1 1 auto !important;
    }
}

@media (max-width: 760px) {
    body.so-v50-orders-groups .orders-redesign {
        gap: 10px !important;
        padding-bottom: 82px !important;
    }

    body.so-v50-orders-groups .orders-topline {
        gap: 12px !important;
        min-height: 0 !important;
        padding: 0 0 12px !important;
        border-bottom: 0 !important;
    }

    body.so-v50-orders-groups .orders-topline .orders-tabs {
        height: 38px !important;
        min-height: 38px !important;
        gap: 18px !important;
        border-bottom: 0 !important;
    }

    body.so-v50-orders-groups .orders-topline .orders-tabs a {
        height: 38px !important;
        min-height: 38px !important;
        font-size: 18px !important;
        font-weight: 400 !important;
    }

    body.so-v50-orders-groups .orders-topline .orders-tabs a > span {
        display: none !important;
    }

    body.so-v50-orders-groups .orders-tab-mobile-hidden {
        display: inline-flex !important;
    }

    body.so-v50-orders-groups .orders-topline-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 44px 44px !important;
        gap: 10px !important;
    }

    body.so-v50-orders-groups .orders-top-search {
        width: 100% !important;
        height: 48px !important;
        min-height: 48px !important;
        border-radius: 999px !important;
        grid-template-columns: 46px minmax(0, 1fr) !important;
    }

    body.so-v50-orders-groups .orders-top-search-icon,
    body.so-v50-orders-groups .orders-top-search input[type="search"] {
        height: 46px !important;
        min-height: 46px !important;
    }

    body.so-v50-orders-groups .orders-top-search input[type="search"] {
        font-size: 16px !important;
    }

    body.so-v50-orders-groups .orders-top-button {
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 !important;
        border-radius: 12px !important;
    }

    body.so-v50-orders-groups .orders-top-button span {
        display: none !important;
    }

    body.so-v50-orders-groups .orders-filter-drawer-panel {
        width: calc(100vw - 48px) !important;
        max-width: 440px !important;
        padding: 26px 20px 34px !important;
    }

    body.so-v50-orders-groups .orders-filter-drawer-head {
        margin-bottom: 22px !important;
    }

    body.so-v50-orders-groups .orders-filter-drawer-head h2 {
        font-size: 26px !important;
        font-weight: 500 !important;
    }

    body.so-v50-orders-groups .orders-filter-drawer-form {
        gap: 14px !important;
    }

    body.so-v50-orders-groups .orders-filter-drawer-form label > span {
        font-size: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    body.so-v50-orders-groups .orders-filter-drawer-form input,
    body.so-v50-orders-groups .orders-filter-drawer-form select {
        height: 58px !important;
        min-height: 58px !important;
        border-radius: 12px !important;
        font-size: 18px !important;
    }

    body.so-v50-orders-groups .orders-filter-update {
        height: 56px !important;
        margin-top: 8px !important;
        border-radius: 12px !important;
        font-size: 18px !important;
    }
}

/* V84 — login, compact monochrome layout, mobile bottom menu, payments design */
:root {
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

html[data-theme="dark"] {
    --bg: #111111;
    --bg-soft: #181818;
    --card: #1b1b1b;
    --card-2: #202020;
    --text: #f2f2f2;
    --muted: #a8a8a8;
    --muted-2: #777777;
    --border: #2f2f2f;
    --primary: #5f8cff;
    --primary-hover: #7aa0ff;
    --primary-soft: #24304f;
    --sidebar: #1b1b1b;
    --sidebar-text: #f2f2f2;
    --input: #1b1b1b;
    --shadow: none;
    --shadow-soft: none;
}

html[data-theme="dark"] body.so-app {
    background: #111111 !important;
}

body.so-app {
    font-family: var(--font) !important;
}

body.so-app strong,
body.so-app b,
body.so-app .button,
body.so-app .link-button,
body.so-app .icon-button,
body.so-app .sidebar-nav a,
body.so-app .sidebar-nav a strong,
body.so-app .desktop-topbar h1 {
    font-weight: 600;
}

body.so-app .brand-mark {
    background: var(--primary) !important;
    box-shadow: none !important;
}

body.so-app .sidebar-avatar {
    background: #ff6b2f !important;
    box-shadow: none !important;
}

body.so-app .desktop-topbar,
body.so-app .master-topbar {
    min-height: 64px;
    padding: 10px 20px;
}

body.so-app .desktop-content,
body.so-app .page {
    margin-top: 14px;
}

body.so-app .sidebar {
    background: var(--sidebar) !important;
}

body.so-app .sidebar-nav a {
    min-height: 40px;
    font-size: 14px;
    border-radius: 12px;
}

/* Login */
body.so-auth-shell .so-auth-page {
    display: grid;
    min-height: 100vh;
    place-items: start center;
    padding-top: 92px;
}

body.so-auth-shell .auth-card-v84 {
    width: min(100% - 32px, 420px) !important;
    margin: 0 auto !important;
    padding: 24px !important;
}

body.so-auth-shell .auth-head-v84 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

body.so-auth-shell .auth-head-v84 h1 {
    margin: 0 !important;
    font-size: 22px;
    font-weight: 650 !important;
    letter-spacing: -0.03em;
}

body.so-auth-shell .auth-lang-form-v84 select {
    min-width: 74px;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0 12px;
    background: var(--input);
    color: var(--text);
    font-weight: 600;
}

body.so-auth-shell .auth-form-v84 {
    display: grid;
    gap: 14px;
    padding: 18px !important;
}

body.so-auth-shell .auth-form-v84 label {
    gap: 6px;
    font-weight: 600 !important;
}

body.so-auth-shell .auth-form-v84 input[type="email"],
body.so-auth-shell .auth-form-v84 input[type="password"] {
    min-height: 42px;
}

body.so-auth-shell .auth-remember-v84 {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 9px !important;
    margin-top: 4px;
    color: var(--text) !important;
    font-size: 13px !important;
}

body.so-auth-shell .auth-remember-v84 input {
    width: 18px !important;
    min-width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    margin: 0;
}

body.so-auth-shell .auth-submit-v84 {
    justify-self: start;
    margin-top: 10px;
}

/* Bottom app navigation for admin/manager mobile */
.app-bottom-nav {
    display: none;
}

@media (max-width: 900px) {
    body.so-app:not(.so-master-shell):not(.so-auth-shell) {
        padding-bottom: calc(82px + env(safe-area-inset-bottom)) !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .desktop-shell {
        display: block !important;
        min-height: 100vh;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .sidebar {
        position: sticky !important;
        top: 0 !important;
        z-index: 70 !important;
        height: auto !important;
        padding: 8px 12px !important;
        border-right: 0 !important;
        border-bottom: 1px solid var(--border) !important;
        background: color-mix(in srgb, var(--bg) 94%, transparent) !important;
        backdrop-filter: blur(18px) !important;
    }

    html[data-theme="dark"] body.so-app:not(.so-master-shell):not(.so-auth-shell) .sidebar {
        background: #181818 !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-brand-row {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .sidebar-brand {
        padding: 0 !important;
        min-width: 0;
        font-size: 14px;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .sidebar-brand .brand-mark {
        width: 32px;
        height: 32px;
        border-radius: 10px;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .sidebar-nav,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .sidebar-user {
        display: none !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-shell-actions {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        min-width: 0;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-shell-actions .lang-form select,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-shell-actions .icon-button {
        min-width: 38px !important;
        width: auto !important;
        height: 38px !important;
        min-height: 38px !important;
        border-radius: 12px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .desktop-topbar {
        display: none !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .desktop-content,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .page {
        width: 100% !important;
        margin: 0 !important;
        padding: 18px 14px calc(92px + env(safe-area-inset-bottom)) !important;
    }

    .app-bottom-nav {
        position: fixed;
        right: 10px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        left: 10px;
        z-index: 90;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 2px;
        min-height: 64px;
        padding: 6px 8px;
        border: 1px solid var(--border);
        border-radius: 18px;
        background: color-mix(in srgb, var(--card) 94%, transparent);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
        backdrop-filter: blur(18px);
    }

    html[data-theme="dark"] .app-bottom-nav {
        background: #1b1b1b;
        box-shadow: none;
    }

    .app-bottom-nav a {
        display: grid;
        grid-template-rows: 24px auto;
        place-items: center;
        gap: 3px;
        min-width: 0;
        border-radius: 14px;
        color: var(--muted);
        font-size: 11px;
        line-height: 1.05;
    }

    .app-bottom-nav a span,
    .app-bottom-nav a svg {
        display: grid;
        width: 22px;
        height: 22px;
        place-items: center;
    }

    .app-bottom-nav a strong {
        max-width: 100%;
        overflow: hidden;
        font-weight: 500 !important;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .app-bottom-nav a.active {
        background: var(--primary-soft);
        color: var(--primary);
    }

    body.so-v50-orders-groups .orders-redesign {
        padding-bottom: 0 !important;
    }

    body.so-v50-orders-groups .orders-topline {
        padding-top: 8px !important;
    }
}

@media (max-width: 480px) {
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .sidebar-brand span:not(.brand-mark) {
        max-width: 155px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .orders-topline .orders-tabs {
        overflow-x: auto !important;
        gap: 16px !important;
    }
}

/* Payments page design */
.payments-page-v84 {
    display: grid;
    gap: 16px;
}

.payments-topline-v84 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.payments-tabs-v84 {
    display: flex;
    align-items: center;
    gap: 22px;
    overflow-x: auto;
}

.payments-tabs-v84 a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.payments-tabs-v84 a.active {
    color: var(--primary);
}

.payments-tabs-v84 a.active::after {
    position: absolute;
    right: 0;
    bottom: -11px;
    left: 0;
    height: 2px;
    background: var(--primary);
    content: "";
}

.payments-actions-v84 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.payments-icon-button-v84 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    font-weight: 500;
}

.payments-summary-v84 {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 14px 24px;
    padding: 2px 0 8px;
}

.payments-summary-v84 h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(28px, 3.2vw, 38px);
    font-weight: 600;
    letter-spacing: -0.04em;
}

.payments-summary-v84 dl {
    display: flex;
    gap: 22px;
    margin: 0;
}

.payments-summary-v84 dt,
.payments-summary-v84 dd {
    margin: 0;
}

.payments-summary-v84 dt {
    color: var(--muted);
    font-size: 13px;
}

.payments-summary-v84 dd {
    color: var(--text);
    font-size: 17px;
    font-weight: 600;
}

.payments-table-card-v84 {
    min-width: 0;
}

.payments-table-wrap-v84 {
    overflow-x: auto;
}

.payments-table-v84 {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    color: var(--text);
    font-size: 14px;
}

.payments-table-v84 th,
.payments-table-v84 td {
    border-bottom: 1px solid var(--border);
    padding: 11px 10px;
    text-align: left;
    vertical-align: middle;
}

.payments-table-v84 th {
    color: var(--text);
    font-weight: 500;
}

.payments-table-v84 td span,
.payments-table-v84 td small {
    display: block;
}

.payments-table-v84 td small,
.payments-muted-cell-v84 {
    color: var(--muted);
}

.payments-table-v84 a {
    color: var(--primary);
}

.payments-empty-v84 {
    padding: 42px 12px;
    color: var(--muted);
    text-align: center;
}

.payments-floating-create-v84 {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 75;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 24px;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.26);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
}

.payments-floating-create-v84 span {
    font-size: 22px;
    line-height: 1;
}

@media (max-width: 900px) {
    .payments-page-v84 {
        padding-top: 8px;
    }

    .payments-topline-v84 {
        align-items: flex-start;
        border-bottom: 0;
    }

    .payments-tabs-v84 {
        gap: 20px;
        max-width: calc(100vw - 106px);
    }

    .payments-tabs-v84 a {
        font-size: 19px;
        min-height: 34px;
    }

    .payments-actions-v84 {
        display: grid;
        gap: 10px;
    }

    .payments-icon-button-v84 {
        width: 48px;
        height: 48px;
        min-height: 48px;
        padding: 0;
        border-radius: 12px;
    }

    .payments-icon-button-v84 span {
        display: none;
    }

    .payments-summary-v84 {
        display: block;
        padding-top: 16px;
    }

    .payments-summary-v84 h2 {
        font-size: 31px;
        line-height: 1.1;
    }

    .payments-summary-v84 dl {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
        margin-top: 10px;
    }

    .payments-summary-v84 dt {
        font-size: 13px;
    }

    .payments-summary-v84 dd {
        font-size: 16px;
        line-height: 1.15;
    }

    .payments-table-v84 {
        min-width: 720px;
        font-size: 17px;
    }

    .payments-table-v84 th,
    .payments-table-v84 td {
        padding: 12px 14px;
    }

    .payments-floating-create-v84 {
        right: 24px;
        bottom: calc(88px + env(safe-area-inset-bottom));
        min-height: 54px;
        padding: 0 24px;
        border-radius: 999px;
        font-size: 18px;
    }
}

/* V85 mobile HelloClient-like top tabs and scrollable bottom navigation */
.mobile-page-tabs {
    display: none;
}

@media (max-width: 900px) {
    body.so-app:not(.so-master-shell):not(.so-auth-shell) {
        padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .sidebar {
        padding: 10px 12px !important;
        background: var(--bg) !important;
    }

    html[data-theme="dark"] body.so-app:not(.so-master-shell):not(.so-auth-shell) .sidebar {
        background: #181818 !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-brand-row {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 8px !important;
        min-height: 50px !important;
        width: 100% !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-brand-row .sidebar-brand {
        display: none !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs {
        display: flex !important;
        align-items: center !important;
        gap: 22px !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        white-space: nowrap !important;
        padding: 0 2px 4px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs::-webkit-scrollbar {
        display: none !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs a,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs .mobile-page-tab-label,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs i {
        position: relative !important;
        flex: 0 0 auto !important;
        color: var(--muted) !important;
        text-decoration: none !important;
        font-size: 21px !important;
        line-height: 1.1 !important;
        font-style: normal !important;
        font-weight: 400 !important;
        letter-spacing: -0.03em !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs a.active {
        color: var(--primary) !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs a.active::after {
        content: "" !important;
        position: absolute !important;
        right: 0 !important;
        bottom: -7px !important;
        left: 0 !important;
        height: 3px !important;
        border-radius: 999px !important;
        background: currentColor !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs .mobile-page-tab-label {
        color: var(--muted) !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs.has-separator {
        gap: 16px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs.has-separator a,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs.has-separator .mobile-page-tab-label,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs.has-separator i {
        font-size: 20px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs.has-separator i {
        color: color-mix(in srgb, var(--muted) 70%, transparent) !important;
        padding-right: 1px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-shell-actions {
        flex: 0 0 auto !important;
        gap: 6px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-shell-actions .lang-form select,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-shell-actions .icon-button {
        min-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        border-radius: 15px !important;
        font-size: 14px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-shell-actions .lang-form select {
        min-width: 66px !important;
        padding: 0 10px !important;
    }

    .app-bottom-nav {
        position: fixed !important;
        right: 10px !important;
        bottom: calc(8px + env(safe-area-inset-bottom)) !important;
        left: 10px !important;
        z-index: 90 !important;
        display: flex !important;
        grid-template-columns: none !important;
        align-items: stretch !important;
        gap: 6px !important;
        min-height: 64px !important;
        max-width: calc(100vw - 20px) !important;
        padding: 6px 8px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        border: 1px solid var(--border) !important;
        border-radius: 18px !important;
        background: color-mix(in srgb, var(--card) 94%, transparent) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
        backdrop-filter: blur(18px) !important;
    }

    .app-bottom-nav::-webkit-scrollbar {
        display: none !important;
    }

    html[data-theme="dark"] .app-bottom-nav {
        background: #1b1b1b !important;
        box-shadow: none !important;
    }

    .app-bottom-nav a {
        flex: 0 0 78px !important;
        display: grid !important;
        grid-template-rows: 24px auto !important;
        place-items: center !important;
        gap: 3px !important;
        min-width: 78px !important;
        max-width: 78px !important;
        min-height: 54px !important;
        padding: 6px 6px !important;
        border-radius: 15px !important;
        color: var(--muted) !important;
        font-size: 11px !important;
        line-height: 1.05 !important;
        text-decoration: none !important;
    }

    .app-bottom-nav a span,
    .app-bottom-nav a svg {
        display: grid !important;
        width: 22px !important;
        height: 22px !important;
        place-items: center !important;
    }

    .app-bottom-nav a strong {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        font-weight: 500 !important;
        text-align: center !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .app-bottom-nav a.active {
        background: var(--primary-soft) !important;
        color: var(--primary) !important;
    }

    body.so-v50-orders-groups .orders-topline .orders-tabs,
    .hc-tasks-topline .hc-tasks-tabs,
    .payments-topline-v84 .payments-tabs-v84 {
        display: none !important;
    }

    body.so-v50-orders-groups .orders-topline {
        padding-top: 0 !important;
        margin-top: 0 !important;
        border-bottom: 0 !important;
    }

    body.so-v50-orders-groups .orders-topline-actions {
        width: 100% !important;
        grid-template-columns: minmax(0, 1fr) auto auto !important;
    }

    .hc-tasks-topline,
    .payments-topline-v84 {
        justify-content: flex-end !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        border-bottom: 0 !important;
    }

    .hc-tasks-top-actions,
    .payments-actions-v84 {
        justify-content: flex-end !important;
    }
}

@media (max-width: 520px) {
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .sidebar {
        padding: 8px 12px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-brand-row {
        grid-template-columns: minmax(0, 1fr) auto !important;
        gap: 7px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs a,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs .mobile-page-tab-label,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs i {
        font-size: 18px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs {
        gap: 18px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs.has-separator {
        gap: 14px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs.has-separator a,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs.has-separator .mobile-page-tab-label,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs.has-separator i {
        font-size: 17px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-shell-actions .lang-form select,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-shell-actions .icon-button {
        min-width: 36px !important;
        width: 36px !important;
        height: 36px !important;
        min-height: 36px !important;
        border-radius: 13px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-shell-actions .lang-form select {
        width: 58px !important;
        min-width: 58px !important;
        padding: 0 7px !important;
    }
}

/* V86 mobile tasks: search on the left, action buttons on the right */
@media (max-width: 760px) {
    body.route-tickets .hc-tasks-page {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: center !important;
        column-gap: 8px !important;
        row-gap: 14px !important;
        padding-top: 10px !important;
    }

    body.route-tickets .hc-tasks-topline {
        display: contents !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
    }

    body.route-tickets .hc-tasks-topline .hc-tasks-tabs {
        display: none !important;
    }

    body.route-tickets .hc-task-searchbar {
        grid-column: 1 !important;
        grid-row: 1 !important;
        width: auto !important;
        min-width: 0 !important;
        margin: 0 0 0 14px !important;
        min-height: 52px !important;
        height: 52px !important;
        grid-template-columns: 44px minmax(0, 1fr) 44px !important;
        border-radius: 18px !important;
    }

    body.route-tickets .hc-task-searchbar > span {
        font-size: 28px !important;
    }

    body.route-tickets .hc-task-searchbar input[type="search"] {
        height: 50px !important;
        min-width: 0 !important;
        font-size: 19px !important;
        font-weight: 500 !important;
    }

    body.route-tickets .hc-task-help {
        width: 38px !important;
        height: 38px !important;
        margin-right: 4px !important;
        border-radius: 13px !important;
        font-size: 15px !important;
    }

    body.route-tickets .hc-tasks-top-actions {
        grid-column: 2 !important;
        grid-row: 1 !important;
        justify-self: end !important;
        justify-content: flex-end !important;
        width: auto !important;
        margin: 0 14px 0 0 !important;
        gap: 8px !important;
    }

    body.route-tickets .hc-round-action {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        border-radius: 15px !important;
        font-size: 16px !important;
    }

    body.route-tickets .flash,
    body.route-tickets .hc-task-filter-line,
    body.route-tickets .hc-task-empty,
    body.route-tickets .hc-task-section,
    body.route-tickets .hc-task-floating,
    body.route-tickets .hc-task-modal,
    body.route-tickets .hc-create-task-form,
    body.route-tickets .hc-notification-list,
    body.route-tickets .hc-task-page-script-anchor {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 390px) {
    body.route-tickets .hc-tasks-page {
        column-gap: 6px !important;
    }

    body.route-tickets .hc-task-searchbar {
        margin-left: 10px !important;
        grid-template-columns: 38px minmax(0, 1fr) 38px !important;
        min-height: 48px !important;
        height: 48px !important;
    }

    body.route-tickets .hc-task-searchbar > span {
        font-size: 24px !important;
    }

    body.route-tickets .hc-task-searchbar input[type="search"] {
        height: 46px !important;
        font-size: 17px !important;
    }

    body.route-tickets .hc-task-help {
        width: 34px !important;
        height: 34px !important;
        border-radius: 12px !important;
    }

    body.route-tickets .hc-tasks-top-actions {
        margin-right: 10px !important;
        gap: 6px !important;
    }

    body.route-tickets .hc-round-action {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        border-radius: 14px !important;
    }
}

/* V87 — mobile orders/tasks compact search row and unified HelloClient-like top spacing */
@media (max-width: 900px) {
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .sidebar {
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-brand-row {
        min-height: 44px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .desktop-content,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .page {
        padding-top: 10px !important;
    }

    body.so-v50-orders-groups .orders-redesign {
        gap: 7px !important;
    }

    body.so-v50-orders-groups .orders-topline {
        gap: 7px !important;
        padding-top: 0 !important;
        padding-bottom: 6px !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    body.so-v50-orders-groups .orders-topline-actions {
        align-items: center !important;
        gap: 8px !important;
    }

    body.so-v50-orders-groups .orders-top-search {
        height: 44px !important;
        min-height: 44px !important;
        grid-template-columns: 42px minmax(0, 1fr) !important;
        border-radius: 999px !important;
    }

    body.so-v50-orders-groups .orders-top-search-icon,
    body.so-v50-orders-groups .orders-top-search input[type="search"] {
        height: 42px !important;
        min-height: 42px !important;
    }

    body.so-v50-orders-groups .orders-top-search input[type="search"] {
        font-size: 16px !important;
        font-weight: 400 !important;
    }

    body.so-v50-orders-groups .orders-top-button {
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        border-radius: 14px !important;
    }

    body.route-tickets .desktop-content,
    body.route-master-tickets .desktop-content {
        padding-top: 10px !important;
    }
}

@media (max-width: 760px) {
    body.so-v50-orders-groups .orders-redesign {
        gap: 6px !important;
        padding-bottom: 82px !important;
    }

    body.so-v50-orders-groups .orders-topline {
        gap: 6px !important;
        padding: 0 0 5px !important;
    }

    body.so-v50-orders-groups .orders-topline-actions {
        grid-template-columns: minmax(0, 1fr) 44px 44px !important;
        gap: 8px !important;
    }

    body.so-v50-orders-groups .orders-stat-row {
        margin-top: 0 !important;
    }

    body.route-tickets .hc-tasks-page,
    body.route-master-tickets .hc-tasks-page {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: center !important;
        column-gap: 8px !important;
        row-gap: 10px !important;
        padding: 0 0 88px !important;
    }

    body.route-tickets .hc-tasks-topline,
    body.route-master-tickets .hc-tasks-topline {
        display: contents !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
    }

    body.route-tickets .hc-tasks-topline .hc-tasks-tabs,
    body.route-master-tickets .hc-tasks-topline .hc-tasks-tabs {
        display: none !important;
    }

    body.route-tickets .hc-task-searchbar,
    body.route-master-tickets .hc-task-searchbar {
        grid-column: 1 !important;
        grid-row: 1 !important;
        width: auto !important;
        min-width: 0 !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        margin: 0 !important;
        grid-template-columns: 42px minmax(0, 1fr) 40px !important;
        border-radius: 999px !important;
    }

    body.route-tickets .hc-task-searchbar > span,
    body.route-master-tickets .hc-task-searchbar > span {
        height: 42px !important;
        font-size: 16px !important;
        font-weight: 400 !important;
    }

    body.route-tickets .hc-task-searchbar input[type="search"],
    body.route-master-tickets .hc-task-searchbar input[type="search"] {
        height: 42px !important;
        min-height: 42px !important;
        min-width: 0 !important;
        font-size: 16px !important;
        font-weight: 400 !important;
        line-height: 42px !important;
    }

    body.route-tickets .hc-task-help,
    body.route-master-tickets .hc-task-help {
        width: 34px !important;
        height: 34px !important;
        min-height: 34px !important;
        margin-right: 3px !important;
        border-radius: 12px !important;
        font-size: 14px !important;
    }

    body.route-tickets .hc-tasks-top-actions,
    body.route-master-tickets .hc-tasks-top-actions {
        grid-column: 2 !important;
        grid-row: 1 !important;
        justify-self: end !important;
        justify-content: flex-end !important;
        width: auto !important;
        margin: 0 !important;
        gap: 8px !important;
    }

    body.route-tickets .hc-round-action,
    body.route-master-tickets .hc-round-action {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        border-radius: 14px !important;
        font-size: 15px !important;
    }

    body.route-tickets .flash,
    body.route-tickets .hc-task-filter-line,
    body.route-tickets .hc-task-empty,
    body.route-tickets .hc-task-section,
    body.route-tickets .hc-task-floating,
    body.route-tickets .hc-task-modal,
    body.route-tickets .hc-create-task-form,
    body.route-tickets .hc-notification-list,
    body.route-tickets .hc-task-page-script-anchor,
    body.route-master-tickets .flash,
    body.route-master-tickets .hc-task-filter-line,
    body.route-master-tickets .hc-task-empty,
    body.route-master-tickets .hc-task-section,
    body.route-master-tickets .hc-task-floating,
    body.route-master-tickets .hc-task-modal,
    body.route-master-tickets .hc-create-task-form,
    body.route-master-tickets .hc-notification-list,
    body.route-master-tickets .hc-task-page-script-anchor {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 390px) {
    body.route-tickets .hc-tasks-page,
    body.route-master-tickets .hc-tasks-page {
        column-gap: 6px !important;
    }

    body.route-tickets .hc-task-searchbar,
    body.route-master-tickets .hc-task-searchbar {
        height: 42px !important;
        min-height: 42px !important;
        grid-template-columns: 38px minmax(0, 1fr) 38px !important;
    }

    body.route-tickets .hc-task-searchbar > span,
    body.route-master-tickets .hc-task-searchbar > span,
    body.route-tickets .hc-task-searchbar input[type="search"],
    body.route-master-tickets .hc-task-searchbar input[type="search"] {
        height: 40px !important;
        min-height: 40px !important;
        line-height: 40px !important;
    }

    body.route-tickets .hc-task-searchbar input[type="search"],
    body.route-master-tickets .hc-task-searchbar input[type="search"] {
        font-size: 15px !important;
    }

    body.route-tickets .hc-task-help,
    body.route-master-tickets .hc-task-help {
        width: 32px !important;
        height: 32px !important;
    }

    body.route-tickets .hc-round-action,
    body.route-master-tickets .hc-round-action {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
    }
}

/* V88: unify mobile Tasks search/buttons with Orders style and move info button outside search field. */
.hc-task-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.hc-task-searchbar {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    min-height: 44px;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card);
    color: var(--text);
    box-shadow: none;
    overflow: hidden;
}

.hc-task-searchbar > span {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--muted);
    font-size: 18px;
    font-weight: 400;
}

.hc-task-searchbar input[type="search"] {
    width: 100%;
    height: 42px;
    min-height: 42px;
    padding: 0 14px 0 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
}

.hc-task-searchbar input[type="search"]::placeholder {
    color: var(--muted);
    opacity: 0.88;
    font-weight: 400;
}

.hc-task-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}

.hc-task-help:hover {
    background: var(--card-2);
    border-color: color-mix(in srgb, var(--border) 72%, var(--text));
}

html[data-theme="dark"] .hc-task-searchbar,
html[data-theme="dark"] .hc-task-help {
    border-color: #454545;
    background: #1b1b1b;
    color: #eeeeee;
}

html[data-theme="dark"] .hc-task-searchbar input[type="search"] {
    color: #eeeeee;
}

html[data-theme="dark"] .hc-task-searchbar > span,
html[data-theme="dark"] .hc-task-searchbar input[type="search"]::placeholder {
    color: #a8a8a8;
}

html[data-theme="dark"] .hc-task-help:hover {
    background: #262626;
    border-color: #626262;
}

@media (max-width: 760px) {
    body.route-tickets .hc-tasks-page,
    body.route-master-tickets .hc-tasks-page {
        grid-template-columns: minmax(0, 1fr) 44px auto !important;
        column-gap: 8px !important;
        row-gap: 8px !important;
    }

    body.route-tickets .hc-task-search-row,
    body.route-master-tickets .hc-task-search-row {
        display: contents !important;
    }

    body.route-tickets .hc-task-searchbar,
    body.route-master-tickets .hc-task-searchbar {
        grid-column: 1 !important;
        grid-row: 1 !important;
        width: auto !important;
        min-width: 0 !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        margin: 0 !important;
        grid-template-columns: 42px minmax(0, 1fr) !important;
        border: 1px solid var(--border) !important;
        border-radius: 999px !important;
        background: var(--card) !important;
        color: var(--text) !important;
        box-shadow: none !important;
        overflow: hidden !important;
    }

    body.route-tickets .hc-task-searchbar > span,
    body.route-master-tickets .hc-task-searchbar > span {
        width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        color: var(--muted) !important;
        font-size: 18px !important;
        font-weight: 400 !important;
    }

    body.route-tickets .hc-task-searchbar input[type="search"],
    body.route-master-tickets .hc-task-searchbar input[type="search"] {
        height: 42px !important;
        min-height: 42px !important;
        min-width: 0 !important;
        padding: 0 14px 0 0 !important;
        color: var(--text) !important;
        font-size: 16px !important;
        font-weight: 400 !important;
        line-height: 42px !important;
    }

    body.route-tickets .hc-task-searchbar input[type="search"]::placeholder,
    body.route-master-tickets .hc-task-searchbar input[type="search"]::placeholder {
        color: var(--muted) !important;
        opacity: 0.88 !important;
        font-weight: 400 !important;
    }

    body.route-tickets .hc-task-help,
    body.route-master-tickets .hc-task-help {
        grid-column: 2 !important;
        grid-row: 1 !important;
        justify-self: stretch !important;
        align-self: center !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        margin: 0 !important;
        border: 1px solid var(--border) !important;
        border-radius: 14px !important;
        background: var(--card) !important;
        color: var(--text) !important;
        font-size: 14px !important;
        font-weight: 500 !important;
    }

    body.route-tickets .hc-tasks-top-actions,
    body.route-master-tickets .hc-tasks-top-actions {
        grid-column: 3 !important;
        grid-row: 1 !important;
        gap: 8px !important;
    }

    body.route-tickets .hc-round-action,
    body.route-master-tickets .hc-round-action {
        border-color: var(--border) !important;
        background: var(--card) !important;
        color: var(--text) !important;
    }

    html[data-theme="dark"] body.route-tickets .hc-task-searchbar,
    html[data-theme="dark"] body.route-master-tickets .hc-task-searchbar,
    html[data-theme="dark"] body.route-tickets .hc-task-help,
    html[data-theme="dark"] body.route-master-tickets .hc-task-help,
    html[data-theme="dark"] body.route-tickets .hc-round-action,
    html[data-theme="dark"] body.route-master-tickets .hc-round-action {
        border-color: #454545 !important;
        background: #1b1b1b !important;
        color: #eeeeee !important;
    }

    html[data-theme="dark"] body.route-tickets .hc-task-searchbar > span,
    html[data-theme="dark"] body.route-master-tickets .hc-task-searchbar > span,
    html[data-theme="dark"] body.route-tickets .hc-task-searchbar input[type="search"]::placeholder,
    html[data-theme="dark"] body.route-master-tickets .hc-task-searchbar input[type="search"]::placeholder {
        color: #a8a8a8 !important;
    }
}

@media (max-width: 390px) {
    body.route-tickets .hc-tasks-page,
    body.route-master-tickets .hc-tasks-page {
        grid-template-columns: minmax(0, 1fr) 42px auto !important;
        column-gap: 6px !important;
    }

    body.route-tickets .hc-task-searchbar,
    body.route-master-tickets .hc-task-searchbar {
        height: 42px !important;
        min-height: 42px !important;
        grid-template-columns: 38px minmax(0, 1fr) !important;
    }

    body.route-tickets .hc-task-searchbar > span,
    body.route-master-tickets .hc-task-searchbar > span,
    body.route-tickets .hc-task-searchbar input[type="search"],
    body.route-master-tickets .hc-task-searchbar input[type="search"] {
        height: 40px !important;
        min-height: 40px !important;
        line-height: 40px !important;
    }

    body.route-tickets .hc-task-help,
    body.route-master-tickets .hc-task-help,
    body.route-tickets .hc-round-action,
    body.route-master-tickets .hc-round-action {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
    }
}

/* V89: mobile clients list/profile in HelloClient-like style. */
.clients-mobile-toolbar,
.clients-mobile-list,
.clients-mobile-fab,
.clients-mobile-profile,
.clients-mobile-profile-body,
.clients-mobile-orders-section {
    display: none;
}

@media (max-width: 768px) {
    body.route-clients .desktop-content,
    body[class*="route-clients-"] .desktop-content {
        padding-top: 14px !important;
    }

    body.route-clients .clients-desktop-header,
    body.route-clients .clients-desktop-filters,
    body.route-clients .clients-desktop-table,
    body.route-clients .table-card.clients-desktop-table,
    body[class*="route-clients-"] .clients-profile-desktop-header,
    body[class*="route-clients-"] .clients-profile-desktop-details,
    body[class*="route-clients-"] .clients-profile-desktop-orders-head,
    body[class*="route-clients-"] .clients-profile-desktop-orders {
        display: none !important;
    }

    body.route-clients .clients-mobile-toolbar {
        display: block;
        margin: 4px 0 18px;
    }

    body.route-clients .clients-mobile-search-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 54px 54px;
        align-items: center;
        gap: 10px;
    }

    body.route-clients .clients-mobile-search-field {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr);
        align-items: center;
        height: 54px;
        min-height: 54px;
        margin: 0;
        padding: 0 16px;
        border: 1px solid var(--border);
        border-radius: 28px;
        background: var(--card);
        color: var(--muted);
    }

    body.route-clients .clients-mobile-search-field > span,
    body.route-clients .clients-mobile-search-field svg {
        width: 24px;
        height: 24px;
    }

    body.route-clients .clients-mobile-search-field input[type="search"] {
        width: 100%;
        height: 52px;
        min-height: 52px;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--text);
        font-size: 20px;
        font-weight: 500;
        outline: none;
    }

    body.route-clients .clients-mobile-search-field input[type="search"]::placeholder {
        color: var(--muted);
    }

    body.route-clients .clients-mobile-icon-button,
    body.route-clients .clients-mobile-filter > summary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 54px;
        height: 54px;
        min-width: 54px;
        min-height: 54px;
        border: 1px solid var(--border);
        border-radius: 18px;
        background: var(--card);
        color: var(--text);
        list-style: none;
        cursor: pointer;
    }

    body.route-clients .clients-mobile-icon-button svg,
    body.route-clients .clients-mobile-filter > summary svg {
        width: 23px;
        height: 23px;
    }

    body.route-clients .clients-mobile-filter {
        position: relative;
        margin: 0;
    }

    body.route-clients .clients-mobile-filter > summary::-webkit-details-marker {
        display: none;
    }

    body.route-clients .clients-mobile-filter-panel {
        position: absolute;
        right: 0;
        top: calc(100% + 10px);
        z-index: 50;
        width: min(310px, calc(100vw - 48px));
        padding: 16px;
        border: 1px solid var(--border);
        border-radius: 22px;
        background: var(--card);
        box-shadow: 0 18px 46px rgba(15, 23, 42, .14);
    }

    body.route-clients .clients-mobile-filter-panel label {
        display: grid;
        gap: 8px;
        color: var(--muted);
        font-size: 14px;
        font-weight: 500;
    }

    body.route-clients .clients-mobile-filter-panel select {
        height: 46px;
        border-radius: 14px;
        border: 1px solid var(--border);
        background: var(--bg);
        color: var(--text);
        font-size: 15px;
    }

    body.route-clients .clients-mobile-filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 14px;
    }

    body.route-clients .clients-mobile-list {
        display: block;
        margin: 4px -24px 96px;
        border-top: 1px solid var(--border);
    }

    body.route-clients .clients-mobile-list-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(150px, .78fr);
        gap: 16px;
        padding: 18px 28px 14px;
        color: var(--text);
        font-size: 17px;
        font-weight: 600;
    }

    body.route-clients .clients-mobile-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(150px, .78fr);
        gap: 16px;
        align-items: center;
        min-height: 68px;
        padding: 10px 28px;
        border-top: 1px solid var(--border);
        color: var(--text);
        text-decoration: none;
    }

    body.route-clients .clients-mobile-row:hover {
        background: rgba(37, 99, 235, .05);
    }

    body.route-clients .clients-mobile-person {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: center;
        gap: 14px;
        min-width: 0;
    }

    body.route-clients .clients-mobile-avatar {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 999px;
        color: #fff;
        font-size: 16px;
        font-weight: 600;
        letter-spacing: .01em;
    }

    body.route-clients .clients-mobile-avatar-color-0 { background: #2563eb; }
    body.route-clients .clients-mobile-avatar-color-1 { background: #16a34a; }
    body.route-clients .clients-mobile-avatar-color-2 { background: #0891b2; }
    body.route-clients .clients-mobile-avatar-color-3 { background: #dc2626; }
    body.route-clients .clients-mobile-avatar-color-4 { background: #ca8a04; }
    body.route-clients .clients-mobile-avatar-color-5 { background: #7c3aed; }
    body.route-clients .clients-mobile-avatar-color-6 { background: #0d9488; }
    body.route-clients .clients-mobile-avatar-color-7 { background: #ea580c; }
    body.route-clients .clients-mobile-avatar-color-8 { background: #65a30d; }
    body.route-clients .clients-mobile-avatar-color-9 { background: #9333ea; }

    body.route-clients .clients-mobile-name,
    body.route-clients .clients-mobile-phone {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 17px;
        font-weight: 400;
    }

    body.route-clients .clients-mobile-phone {
        color: var(--primary);
        text-align: right;
    }

    body.route-clients .clients-mobile-fab {
        position: fixed;
        right: 18px;
        bottom: calc(78px + env(safe-area-inset-bottom, 0px));
        z-index: 70;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        min-width: 150px;
        height: 56px;
        padding: 0 22px;
        border-radius: 999px;
        background: var(--primary);
        color: var(--primary-contrast);
        text-decoration: none;
        box-shadow: 0 16px 34px rgba(37, 99, 235, .28);
    }

    body.route-clients .clients-mobile-fab span {
        font-size: 28px;
        font-weight: 400;
        line-height: 1;
    }

    body.route-clients .clients-mobile-fab strong {
        font-size: 17px;
        font-weight: 600;
    }

    body[class*="route-clients-"] .clients-mobile-profile,
    body[class*="route-clients-"] .clients-mobile-profile-body,
    body[class*="route-clients-"] .clients-mobile-orders-section {
        display: block;
    }

    body[class*="route-clients-"] .clients-mobile-profile-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 16px;
        margin: 2px 0 34px;
    }

    body[class*="route-clients-"] .clients-mobile-profile-head h1 {
        margin: 0;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: var(--text);
        font-size: 30px;
        font-weight: 650;
        letter-spacing: -.04em;
    }

    body[class*="route-clients-"] .clients-mobile-profile-actions {
        display: flex;
        align-items: center;
        gap: 14px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    body[class*="route-clients-"] .clients-mobile-profile-actions::-webkit-scrollbar {
        display: none;
    }

    body[class*="route-clients-"] .clients-mobile-profile-actions a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        min-width: 36px;
        color: var(--text);
        text-decoration: none;
    }

    body[class*="route-clients-"] .clients-mobile-profile-actions svg {
        width: 28px;
        height: 28px;
    }

    body[class*="route-clients-"] .clients-mobile-profile-body {
        margin-bottom: 34px;
    }

    body[class*="route-clients-"] .clients-mobile-profile-body h2,
    body[class*="route-clients-"] .clients-mobile-orders-section h2 {
        margin: 0 0 18px;
        color: var(--text);
        font-size: 21px;
        font-weight: 650;
        letter-spacing: -.02em;
    }

    body[class*="route-clients-"] .clients-mobile-info-card,
    body[class*="route-clients-"] .clients-mobile-summary-grid article,
    body[class*="route-clients-"] .clients-mobile-orders-table {
        border: 1px solid var(--border);
        border-radius: 18px;
        background: var(--card);
        color: var(--text);
    }

    body[class*="route-clients-"] .clients-mobile-info-card {
        padding: 22px 24px;
    }

    body[class*="route-clients-"] .clients-mobile-info-card dl {
        display: grid;
        grid-template-columns: minmax(118px, .72fr) minmax(0, 1fr);
        column-gap: 22px;
        row-gap: 18px;
        margin: 0;
    }

    body[class*="route-clients-"] .clients-mobile-info-card dt,
    body[class*="route-clients-"] .clients-mobile-info-card dd {
        margin: 0;
        min-width: 0;
        overflow-wrap: anywhere;
        font-size: 16px;
        font-weight: 400;
    }

    body[class*="route-clients-"] .clients-mobile-info-card dt {
        color: var(--muted);
    }

    body[class*="route-clients-"] .clients-mobile-info-card dd {
        color: var(--text);
    }

    body[class*="route-clients-"] .clients-mobile-info-card a {
        color: var(--primary);
        text-decoration: none;
    }

    body[class*="route-clients-"] .clients-mobile-summary-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    body[class*="route-clients-"] .clients-mobile-summary-grid article {
        padding: 24px;
    }

    body[class*="route-clients-"] .clients-mobile-summary-grid span {
        display: block;
        margin-bottom: 14px;
        color: var(--text);
        font-size: 20px;
        font-weight: 600;
    }

    body[class*="route-clients-"] .clients-mobile-summary-grid strong {
        display: block;
        color: var(--text);
        font-size: 27px;
        font-weight: 650;
        line-height: 1.15;
    }

    body[class*="route-clients-"] .clients-mobile-orders-table {
        overflow-x: auto;
    }

    body[class*="route-clients-"] .clients-mobile-orders-head,
    body[class*="route-clients-"] .clients-mobile-order-row {
        display: grid;
        grid-template-columns: minmax(96px, .7fr) minmax(150px, 1fr) minmax(160px, 1fr);
        align-items: center;
        gap: 18px;
        min-width: 520px;
        padding: 16px 20px;
    }

    body[class*="route-clients-"] .clients-mobile-orders-head {
        color: var(--text);
        font-size: 16px;
        font-weight: 600;
    }

    body[class*="route-clients-"] .clients-mobile-order-row {
        border-top: 1px solid var(--border);
        color: var(--text);
        text-decoration: none;
    }

    body[class*="route-clients-"] .clients-mobile-order-row strong,
    body[class*="route-clients-"] .clients-mobile-order-row small {
        display: block;
    }

    body[class*="route-clients-"] .clients-mobile-order-row strong {
        font-size: 16px;
        font-weight: 500;
    }

    body[class*="route-clients-"] .clients-mobile-order-row small {
        margin-top: 3px;
        color: var(--muted);
        font-size: 14px;
    }

    body[class*="route-clients-"] .clients-mobile-order-row em {
        display: inline-flex;
        align-items: center;
        min-height: 34px;
        padding: 5px 12px;
        border-radius: 9px;
        font-style: normal;
        font-size: 15px;
        font-weight: 500;
    }

    body[class*="route-clients-"] .clients-empty-orders {
        margin-bottom: 92px;
    }

    html[data-theme="dark"] body.route-clients .clients-mobile-search-field,
    html[data-theme="dark"] body.route-clients .clients-mobile-icon-button,
    html[data-theme="dark"] body.route-clients .clients-mobile-filter > summary,
    html[data-theme="dark"] body.route-clients .clients-mobile-filter-panel,
    html[data-theme="dark"] body[class*="route-clients-"] .clients-mobile-info-card,
    html[data-theme="dark"] body[class*="route-clients-"] .clients-mobile-summary-grid article,
    html[data-theme="dark"] body[class*="route-clients-"] .clients-mobile-orders-table {
        border-color: #2b2b2b;
        background: #1a1a1a;
        color: #f4f4f5;
    }

    html[data-theme="dark"] body.route-clients .clients-mobile-row:hover {
        background: #202020;
    }
}

@media (max-width: 430px) {
    body.route-clients .clients-mobile-search-form {
        grid-template-columns: minmax(0, 1fr) 50px 50px;
        gap: 8px;
    }

    body.route-clients .clients-mobile-search-field {
        height: 50px;
        min-height: 50px;
        grid-template-columns: 38px minmax(0, 1fr);
        padding: 0 14px;
    }

    body.route-clients .clients-mobile-search-field input[type="search"] {
        height: 48px;
        min-height: 48px;
        font-size: 18px;
    }

    body.route-clients .clients-mobile-icon-button,
    body.route-clients .clients-mobile-filter > summary {
        width: 50px;
        height: 50px;
        min-width: 50px;
        min-height: 50px;
        border-radius: 16px;
    }

    /* V258: keep the full-width clients list inside the mobile viewport.
       The page content has 14px horizontal padding at this breakpoint;
       using -20px created a 6px document overflow on each side and caused
       the fixed bottom navigation to drop by the scrollbar height. */
    body.route-clients .clients-mobile-list {
        margin-left: -14px;
        margin-right: -14px;
    }

    body.route-clients .clients-mobile-list-head,
    body.route-clients .clients-mobile-row {
        grid-template-columns: minmax(0, 1fr) minmax(138px, .78fr);
        gap: 12px;
        padding-left: 24px;
        padding-right: 24px;
    }

    body.route-clients .clients-mobile-person {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 12px;
    }

    body.route-clients .clients-mobile-avatar {
        width: 40px;
        height: 40px;
        font-size: 15px;
    }

    body.route-clients .clients-mobile-name,
    body.route-clients .clients-mobile-phone {
        font-size: 16px;
    }

    body[class*="route-clients-"] .clients-mobile-profile-head {
        gap: 10px;
    }

    body[class*="route-clients-"] .clients-mobile-profile-head h1 {
        font-size: 26px;
    }

    body[class*="route-clients-"] .clients-mobile-profile-actions {
        gap: 8px;
    }

    body[class*="route-clients-"] .clients-mobile-profile-actions a {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    body[class*="route-clients-"] .clients-mobile-profile-actions svg {
        width: 24px;
        height: 24px;
    }

    body[class*="route-clients-"] .clients-mobile-info-card {
        padding: 20px;
    }

    body[class*="route-clients-"] .clients-mobile-info-card dl {
        grid-template-columns: minmax(104px, .72fr) minmax(0, 1fr);
        column-gap: 16px;
    }
}


/* V90 — desktop only: tasks page header like orders page, search in the same line as task tabs */
@media (min-width: 901px) {
    body.route-tickets .desktop-topbar > div:first-child {
        display: block !important;
    }

    body.route-tickets .desktop-topbar {
        justify-content: space-between !important;
    }

    body.route-tickets .desktop-content {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 18px 28px 82px !important;
    }

    body.route-tickets .hc-tasks-page {
        display: grid !important;
        grid-template-columns: minmax(320px, max-content) minmax(280px, 1fr) auto !important;
        align-items: center !important;
        align-content: start !important;
        column-gap: 14px !important;
        row-gap: 16px !important;
        padding: 0 0 96px !important;
        min-height: auto !important;
    }

    body.route-tickets .hc-tasks-topline {
        display: contents !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
    }

    body.route-tickets .hc-tasks-tabs {
        grid-column: 1 !important;
        grid-row: 1 !important;
        align-self: center !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.route-tickets .hc-task-search-row {
        grid-column: 2 !important;
        grid-row: 1 !important;
        display: grid !important;
        grid-template-columns: minmax(260px, 1fr) 42px !important;
        align-items: center !important;
        gap: 10px !important;
        min-width: 0 !important;
        width: 100% !important;
        margin: 0 !important;
    }

    body.route-tickets .hc-task-searchbar {
        width: 100% !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        grid-template-columns: 38px minmax(0, 1fr) !important;
        border-radius: 999px !important;
    }

    body.route-tickets .hc-task-searchbar > span {
        height: 38px !important;
        font-size: 17px !important;
    }

    body.route-tickets .hc-task-searchbar input[type="search"] {
        height: 38px !important;
        min-height: 38px !important;
        line-height: 38px !important;
        font-size: 14px !important;
        font-weight: 400 !important;
    }

    body.route-tickets .hc-task-help {
        width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        margin: 0 !important;
        border-radius: 12px !important;
    }

    body.route-tickets .hc-tasks-top-actions {
        grid-column: 3 !important;
        grid-row: 1 !important;
        align-self: center !important;
        justify-self: end !important;
        justify-content: flex-end !important;
        width: auto !important;
        margin: 0 !important;
        gap: 8px !important;
    }

    body.route-tickets .hc-round-action {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        border-radius: 999px !important;
    }

    body.route-tickets .flash,
    body.route-tickets .hc-task-filter-line,
    body.route-tickets .hc-task-empty,
    body.route-tickets .hc-task-section,
    body.route-tickets .hc-task-floating,
    body.route-tickets .hc-task-modal,
    body.route-tickets .hc-create-task-form,
    body.route-tickets .hc-notification-list,
    body.route-tickets .hc-task-page-script-anchor {
        grid-column: 1 / -1 !important;
    }
}


/* V91 — desktop only: make “Задачи” top row visually identical to “Заявки” */
@media (min-width: 901px) {
    body.route-tickets .desktop-topbar > div:first-child {
        display: block !important;
    }

    body.route-tickets .desktop-topbar {
        justify-content: space-between !important;
    }

    body.route-tickets .desktop-content {
        width: min(100% - 28px, 1460px) !important;
        max-width: 1460px !important;
        margin: 14px auto 44px !important;
        padding: 0 !important;
    }

    body.route-tickets .hc-tasks-page {
        display: grid !important;
        grid-template-columns: minmax(520px, 1fr) minmax(360px, 560px) auto !important;
        align-items: center !important;
        align-content: start !important;
        column-gap: 10px !important;
        row-gap: 12px !important;
        width: 100% !important;
        min-height: auto !important;
        padding: 0 0 82px !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    body.route-tickets .hc-tasks-topline {
        display: contents !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
    }

    body.route-tickets .hc-tasks-tabs {
        grid-column: 1 !important;
        grid-row: 1 !important;
        display: flex !important;
        align-items: center !important;
        gap: 24px !important;
        min-width: 0 !important;
        height: 48px !important;
        min-height: 48px !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow-x: auto !important;
        border-bottom: 1px solid var(--border) !important;
        white-space: nowrap !important;
        scrollbar-width: none !important;
    }

    body.route-tickets .hc-tasks-tabs::-webkit-scrollbar {
        display: none !important;
    }

    body.route-tickets .hc-tasks-tabs span,
    body.route-tickets .hc-tasks-tabs i,
    body.route-tickets .hc-tasks-tabs a {
        display: inline-flex !important;
        align-items: center !important;
        height: 48px !important;
        min-height: 48px !important;
        padding: 0 !important;
        color: var(--muted) !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        line-height: 1 !important;
        text-decoration: none !important;
        white-space: nowrap !important;
    }

    body.route-tickets .hc-tasks-tabs i {
        opacity: .8 !important;
        font-style: normal !important;
    }

    body.route-tickets .hc-tasks-tabs a {
        position: relative !important;
    }

    body.route-tickets .hc-tasks-tabs a.active {
        color: var(--primary) !important;
        font-weight: 600 !important;
    }

    body.route-tickets .hc-tasks-tabs a.active::after {
        position: absolute !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        height: 2px !important;
        border-radius: 999px !important;
        background: var(--primary) !important;
        content: "" !important;
    }

    body.route-tickets .hc-task-search-row {
        grid-column: 2 !important;
        grid-row: 1 !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 44px !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
        border-bottom: 1px solid var(--border) !important;
    }

    body.route-tickets .hc-task-searchbar {
        display: grid !important;
        grid-template-columns: 42px minmax(0, 1fr) !important;
        align-items: center !important;
        width: 100% !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        margin: 0 !important;
        overflow: hidden !important;
        border: 1px solid var(--border) !important;
        border-radius: 999px !important;
        background: var(--card) !important;
        color: var(--text) !important;
        box-shadow: none !important;
    }

    body.route-tickets .hc-task-searchbar > span {
        display: grid !important;
        width: 42px !important;
        height: 42px !important;
        place-items: center !important;
        color: var(--muted) !important;
        font-size: 14px !important;
        font-weight: 400 !important;
    }

    body.route-tickets .hc-task-searchbar .hc-inline-icon {
        width: 20px !important;
        height: 20px !important;
    }

    body.route-tickets .hc-task-searchbar input[type="search"] {
        width: 100% !important;
        height: 42px !important;
        min-height: 42px !important;
        padding: 0 14px 0 0 !important;
        border: 0 !important;
        outline: 0 !important;
        background: transparent !important;
        color: var(--text) !important;
        font-size: 14px !important;
        font-weight: 400 !important;
        line-height: 42px !important;
    }

    body.route-tickets .hc-task-searchbar input[type="search"]::placeholder {
        color: var(--muted) !important;
        opacity: .88 !important;
    }

    body.route-tickets .hc-task-help {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid var(--border) !important;
        border-radius: 12px !important;
        background: var(--card) !important;
        color: var(--text) !important;
        box-shadow: none !important;
        cursor: pointer !important;
    }

    body.route-tickets .hc-task-help .hc-inline-icon {
        width: 18px !important;
        height: 18px !important;
    }

    body.route-tickets .hc-tasks-top-actions {
        grid-column: 3 !important;
        grid-row: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 10px !important;
        width: auto !important;
        height: 48px !important;
        min-height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
        border-bottom: 1px solid var(--border) !important;
    }

    body.route-tickets .hc-round-action {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 !important;
        border: 1px solid var(--border) !important;
        border-radius: 12px !important;
        background: var(--card) !important;
        color: var(--text) !important;
        box-shadow: none !important;
        text-decoration: none !important;
    }

    body.route-tickets .hc-round-action:hover,
    body.route-tickets .hc-task-help:hover {
        background: var(--card-2) !important;
        border-color: color-mix(in srgb, var(--border) 72%, var(--text)) !important;
    }

    body.route-tickets .hc-round-action .hc-inline-icon {
        width: 18px !important;
        height: 18px !important;
    }

    body.route-tickets .flash,
    body.route-tickets .hc-task-filter-line,
    body.route-tickets .hc-task-empty,
    body.route-tickets .hc-task-section,
    body.route-tickets .hc-task-floating,
    body.route-tickets .hc-task-modal,
    body.route-tickets .hc-create-task-form,
    body.route-tickets .hc-notification-list,
    body.route-tickets .hc-task-page-script-anchor {
        grid-column: 1 / -1 !important;
    }

    body.route-tickets .hc-task-empty {
        margin-top: 20px !important;
        color: var(--muted) !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        text-align: center !important;
    }

    html[data-theme="dark"] body.route-tickets .hc-tasks-tabs,
    html[data-theme="dark"] body.route-tickets .hc-task-search-row,
    html[data-theme="dark"] body.route-tickets .hc-tasks-top-actions {
        border-bottom-color: #242424 !important;
    }

    html[data-theme="dark"] body.route-tickets .hc-task-searchbar,
    html[data-theme="dark"] body.route-tickets .hc-task-help,
    html[data-theme="dark"] body.route-tickets .hc-round-action {
        border-color: #454545 !important;
        background: #1b1b1b !important;
        color: #eeeeee !important;
    }

    html[data-theme="dark"] body.route-tickets .hc-task-searchbar input[type="search"] {
        color: #eeeeee !important;
    }

    html[data-theme="dark"] body.route-tickets .hc-task-searchbar > span,
    html[data-theme="dark"] body.route-tickets .hc-task-searchbar input[type="search"]::placeholder {
        color: #a8a8a8 !important;
    }

    html[data-theme="dark"] body.route-tickets .hc-task-help:hover,
    html[data-theme="dark"] body.route-tickets .hc-round-action:hover {
        border-color: #626262 !important;
        background: #262626 !important;
    }
}

/* V92 — desktop only: copy orders top-line typography, spacing and sizing to tasks page */
@media (min-width: 901px) {
    body.route-tickets .desktop-topbar > div:first-child {
        display: block !important;
    }

    body.route-tickets .desktop-topbar {
        justify-content: space-between !important;
    }

    body.route-tickets .desktop-content {
        width: min(100% - 32px, 1480px) !important;
        max-width: 1480px !important;
        margin: 14px auto 44px !important;
        padding: 0 !important;
    }

    body.route-tickets .hc-tasks-page {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(300px, 560px) auto !important;
        align-items: center !important;
        align-content: start !important;
        column-gap: 10px !important;
        row-gap: 12px !important;
        width: 100% !important;
        min-height: auto !important;
        padding: 0 0 82px !important;
        margin: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    body.route-tickets .hc-tasks-topline {
        display: contents !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    body.route-tickets .hc-tasks-tabs {
        grid-column: 1 !important;
        grid-row: 1 !important;
        display: flex !important;
        flex: 1 1 auto !important;
        align-items: center !important;
        gap: 24px !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 48px !important;
        min-height: 48px !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        border: 0 !important;
        border-bottom: 1px solid var(--border) !important;
        background: transparent !important;
        color: var(--muted) !important;
        white-space: nowrap !important;
        scrollbar-width: none !important;
    }

    body.route-tickets .hc-tasks-tabs::-webkit-scrollbar {
        display: none !important;
    }

    body.route-tickets .hc-tasks-tabs span,
    body.route-tickets .hc-tasks-tabs i,
    body.route-tickets .hc-tasks-tabs a {
        position: relative !important;
        display: inline-flex !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        justify-content: center !important;
        height: 48px !important;
        min-height: 48px !important;
        padding: 0 !important;
        margin: 0 !important;
        color: var(--muted) !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        line-height: 1 !important;
        letter-spacing: 0 !important;
        text-decoration: none !important;
        white-space: nowrap !important;
    }

    body.route-tickets .hc-tasks-tabs i {
        opacity: .8 !important;
        font-style: normal !important;
    }

    body.route-tickets .hc-tasks-tabs a:hover,
    body.route-tickets .hc-tasks-tabs a.active {
        color: var(--primary) !important;
        font-weight: 500 !important;
    }

    body.route-tickets .hc-tasks-tabs a.active::after {
        position: absolute !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        height: 2px !important;
        border-radius: 999px !important;
        background: var(--primary) !important;
        content: "" !important;
    }

    body.route-tickets .hc-task-search-row {
        grid-column: 2 !important;
        grid-row: 1 !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 44px !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 48px !important;
        min-height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-bottom: 1px solid var(--border) !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    body.route-tickets .hc-task-searchbar {
        display: grid !important;
        grid-template-columns: 42px minmax(0, 1fr) !important;
        align-items: center !important;
        width: 100% !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        border: 1px solid var(--border) !important;
        border-radius: 999px !important;
        background: var(--card) !important;
        color: var(--text) !important;
        box-shadow: none !important;
    }

    body.route-tickets .hc-task-searchbar > span {
        display: grid !important;
        width: 42px !important;
        height: 42px !important;
        place-items: center !important;
        color: var(--muted) !important;
        font-size: 14px !important;
        font-weight: 400 !important;
        line-height: 1 !important;
    }

    body.route-tickets .hc-task-searchbar .hc-inline-icon {
        width: 20px !important;
        height: 20px !important;
    }

    body.route-tickets .hc-task-searchbar input[type="search"] {
        width: 100% !important;
        height: 42px !important;
        min-height: 42px !important;
        padding: 0 14px 0 0 !important;
        border: 0 !important;
        outline: 0 !important;
        background: transparent !important;
        color: var(--text) !important;
        font-size: 14px !important;
        font-weight: 400 !important;
        line-height: 42px !important;
        letter-spacing: 0 !important;
        box-shadow: none !important;
    }

    body.route-tickets .hc-task-searchbar input[type="search"]::placeholder {
        color: var(--muted) !important;
        opacity: .88 !important;
    }

    body.route-tickets .hc-task-help {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid var(--border) !important;
        border-radius: 12px !important;
        background: var(--card) !important;
        color: var(--text) !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        line-height: 1 !important;
        box-shadow: none !important;
        cursor: pointer !important;
    }

    body.route-tickets .hc-task-help .hc-inline-icon {
        width: 18px !important;
        height: 18px !important;
    }

    body.route-tickets .hc-tasks-top-actions {
        grid-column: 3 !important;
        grid-row: 1 !important;
        display: flex !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 10px !important;
        width: auto !important;
        height: 48px !important;
        min-height: 48px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-bottom: 1px solid var(--border) !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    body.route-tickets .hc-round-action {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid var(--border) !important;
        border-radius: 12px !important;
        background: var(--card) !important;
        color: var(--text) !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        line-height: 1 !important;
        box-shadow: none !important;
        text-decoration: none !important;
        cursor: pointer !important;
    }

    body.route-tickets .hc-round-action:hover,
    body.route-tickets .hc-task-help:hover {
        background: var(--card-2) !important;
        border-color: color-mix(in srgb, var(--border) 72%, var(--text)) !important;
        transform: translateY(-1px) !important;
    }

    body.route-tickets .hc-round-action .hc-inline-icon {
        width: 18px !important;
        height: 18px !important;
    }

    body.route-tickets .flash,
    body.route-tickets .hc-task-filter-line,
    body.route-tickets .hc-task-empty,
    body.route-tickets .hc-task-section,
    body.route-tickets .hc-task-floating,
    body.route-tickets .hc-task-modal,
    body.route-tickets .hc-create-task-form,
    body.route-tickets .hc-notification-list,
    body.route-tickets .hc-task-page-script-anchor {
        grid-column: 1 / -1 !important;
    }

    body.route-tickets .hc-task-empty {
        margin-top: 20px !important;
        color: var(--muted) !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        text-align: center !important;
    }

    html[data-theme="dark"] body.route-tickets .hc-tasks-tabs,
    html[data-theme="dark"] body.route-tickets .hc-task-search-row,
    html[data-theme="dark"] body.route-tickets .hc-tasks-top-actions {
        border-bottom-color: #242424 !important;
    }

    html[data-theme="dark"] body.route-tickets .hc-task-searchbar,
    html[data-theme="dark"] body.route-tickets .hc-task-help,
    html[data-theme="dark"] body.route-tickets .hc-round-action {
        border-color: #454545 !important;
        background: #1b1b1b !important;
        color: #eeeeee !important;
    }

    html[data-theme="dark"] body.route-tickets .hc-task-searchbar input[type="search"] {
        color: #eeeeee !important;
    }

    html[data-theme="dark"] body.route-tickets .hc-task-searchbar > span,
    html[data-theme="dark"] body.route-tickets .hc-task-searchbar input[type="search"]::placeholder {
        color: #a8a8a8 !important;
    }

    html[data-theme="dark"] body.route-tickets .hc-task-help:hover,
    html[data-theme="dark"] body.route-tickets .hc-round-action:hover {
        border-color: #626262 !important;
        background: #262626 !important;
    }
}

/* V93 — desktop clients header/search aligned with Orders page. Desktop only. */
@media (min-width: 769px) {
    body.route-clients .clients-desktop-header {
        display: none !important;
    }

    body.route-clients .desktop-new-client-button {
        order: -1 !important;
    }

    body.route-clients .clients-desktop-search-row {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 10px !important;
        width: 100% !important;
        margin: 0 0 8px !important;
        padding: 0 0 12px !important;
        border: 0 !important;
        border-bottom: 1px solid var(--border) !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    body.route-clients .clients-top-search {
        display: grid !important;
        grid-template-columns: 42px minmax(0, 1fr) !important;
        align-items: center !important;
        width: min(100%, 560px) !important;
        height: 44px !important;
        min-height: 44px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 1px solid var(--border) !important;
        border-radius: 999px !important;
        background: var(--card) !important;
        color: var(--text) !important;
        box-shadow: none !important;
        overflow: hidden !important;
    }

    body.route-clients .clients-top-search-icon {
        display: grid !important;
        width: 42px !important;
        height: 42px !important;
        place-items: center !important;
        color: var(--muted) !important;
    }

    body.route-clients .clients-top-search input[type="search"] {
        width: 100% !important;
        height: 42px !important;
        min-height: 42px !important;
        padding: 0 14px 0 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        outline: none !important;
        background: transparent !important;
        color: var(--text) !important;
        font-size: 14px !important;
        font-weight: 400 !important;
        line-height: 42px !important;
        box-shadow: none !important;
    }

    body.route-clients .clients-top-search input[type="search"]::placeholder {
        color: var(--muted) !important;
        opacity: 0.88 !important;
    }

    body.route-clients .clients-status-filter {
        display: block !important;
        width: 220px !important;
        min-width: 220px !important;
        height: 44px !important;
        margin: 0 !important;
        padding: 0 !important;
        color: var(--text) !important;
        font-size: 14px !important;
        font-weight: 400 !important;
    }

    body.route-clients .clients-status-filter select {
        width: 100% !important;
        height: 44px !important;
        min-height: 44px !important;
        margin: 0 !important;
        padding: 0 16px !important;
        border: 1px solid var(--border) !important;
        border-radius: 999px !important;
        background-color: var(--card) !important;
        background-image: none !important;
        color: var(--muted) !important;
        font-size: 14px !important;
        font-weight: 400 !important;
        line-height: 44px !important;
        box-shadow: none !important;
        appearance: none !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
    }

    body.route-clients .clients-desktop-note {
        margin: 0 0 16px !important;
        color: var(--muted) !important;
        font-size: 11px !important;
        font-weight: 400 !important;
        line-height: 1.35 !important;
    }

    body.route-clients .clients-desktop-table {
        margin-top: 0 !important;
    }

    html[data-theme="dark"] body.route-clients .clients-top-search,
    html[data-theme="dark"] body.route-clients .clients-status-filter select {
        border-color: #2f2f2f !important;
        background: #1b1b1b !important;
        color: #eeeeee !important;
    }

    html[data-theme="dark"] body.route-clients .clients-top-search-icon,
    html[data-theme="dark"] body.route-clients .clients-top-search input[type="search"]::placeholder,
    html[data-theme="dark"] body.route-clients .clients-status-filter select {
        color: #a8a8a8 !important;
    }
}

@media (max-width: 768px) {
    body.route-clients .clients-desktop-note {
        display: none !important;
    }
}

/* V94 — desktop clients page like HelloClient: compact list + modal card/edit. Desktop only. */
.hc-client-modal {
    display: none;
}

@media (min-width: 769px) {
    body.route-clients .desktop-content {
        width: min(100% - 32px, 1480px) !important;
        max-width: 1480px !important;
        margin: 14px auto 44px !important;
        padding: 0 !important;
    }

    body.route-clients .clients-desktop-note {
        display: block !important;
        margin: 0 0 14px !important;
        padding: 0 !important;
        color: var(--muted) !important;
        font-size: 11px !important;
        font-weight: 400 !important;
        line-height: 1.35 !important;
    }

    body.route-clients .hc-clients-desktop-list {
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    body.route-clients .hc-clients-desktop-list .table-responsive {
        overflow-x: auto !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
    }

    body.route-clients .hc-clients-table {
        width: 100% !important;
        min-width: 1180px !important;
        border-collapse: collapse !important;
        border-spacing: 0 !important;
        background: transparent !important;
        color: var(--text) !important;
    }

    body.route-clients .hc-clients-table thead th {
        height: 38px !important;
        padding: 0 14px !important;
        border: 0 !important;
        border-bottom: 1px solid var(--border) !important;
        background: transparent !important;
        color: var(--text) !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        line-height: 1.2 !important;
        text-align: left !important;
        text-transform: none !important;
        letter-spacing: 0 !important;
        white-space: nowrap !important;
    }

    body.route-clients .hc-clients-table tbody td {
        height: 48px !important;
        padding: 6px 14px !important;
        border: 0 !important;
        border-bottom: 1px solid var(--border) !important;
        background: transparent !important;
        color: var(--text) !important;
        font-size: 14px !important;
        font-weight: 400 !important;
        line-height: 1.25 !important;
        vertical-align: middle !important;
        white-space: nowrap !important;
    }

    body.route-clients .hc-clients-table tbody tr {
        cursor: pointer !important;
        transition: background .14s ease !important;
    }

    body.route-clients .hc-clients-table tbody tr:hover,
    body.route-clients .hc-clients-table tbody tr:focus {
        background: rgba(37, 99, 235, .045) !important;
        outline: none !important;
    }

    body.route-clients .hc-client-name-cell {
        display: inline-flex !important;
        align-items: center !important;
        gap: 10px !important;
        min-width: 0 !important;
        color: var(--text) !important;
        font-weight: 400 !important;
    }

    body.route-clients .hc-client-name-cell .clients-mobile-avatar {
        display: inline-flex !important;
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        font-size: 12px !important;
        font-weight: 500 !important;
    }

    body.route-clients .hc-clients-table a {
        color: var(--primary) !important;
        text-decoration: none !important;
    }

    body.route-clients .hc-client-modal:target {
        position: fixed !important;
        inset: 0 !important;
        z-index: 4000 !important;
        display: flex !important;
        align-items: flex-start !important;
        justify-content: center !important;
        padding: 34px 24px !important;
        overflow-y: auto !important;
    }

    body.route-clients .hc-client-modal-backdrop {
        position: fixed !important;
        inset: 0 !important;
        z-index: 0 !important;
        background: rgba(0, 0, 0, .62) !important;
        backdrop-filter: blur(1px) !important;
    }

    body.route-clients .hc-client-modal-panel {
        position: relative !important;
        z-index: 1 !important;
        width: min(100%, 560px) !important;
        max-height: calc(100vh - 68px) !important;
        overflow-y: auto !important;
        padding: 28px 30px 34px !important;
        border: 1px solid var(--border) !important;
        border-radius: 10px !important;
        background: var(--card) !important;
        color: var(--text) !important;
        box-shadow: 0 24px 80px rgba(0, 0, 0, .26) !important;
    }

    body.route-clients .hc-client-card-panel {
        width: min(100%, 560px) !important;
    }

    body.route-clients .hc-client-edit-panel {
        width: min(100%, 520px) !important;
        padding-bottom: 26px !important;
    }

    body.route-clients .hc-client-modal-head {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 18px !important;
        margin: 0 0 34px !important;
    }

    body.route-clients .hc-client-modal-head h2 {
        margin: 0 !important;
        color: var(--text) !important;
        font-size: 28px !important;
        font-weight: 600 !important;
        line-height: 1.15 !important;
        letter-spacing: -.03em !important;
    }

    body.route-clients .hc-client-modal-actions {
        display: flex !important;
        align-items: center !important;
        gap: 18px !important;
    }

    body.route-clients .hc-client-modal-actions a {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 28px !important;
        height: 28px !important;
        color: var(--text) !important;
        text-decoration: none !important;
        opacity: .92 !important;
    }

    body.route-clients .hc-client-modal-actions a:hover {
        opacity: 1 !important;
    }

    body.route-clients .hc-client-modal-actions svg {
        width: 24px !important;
        height: 24px !important;
    }

    body.route-clients .hc-client-modal-section {
        margin: 0 0 34px !important;
    }

    body.route-clients .hc-client-modal-section:last-child {
        margin-bottom: 0 !important;
    }

    body.route-clients .hc-client-modal-section h3 {
        display: flex !important;
        align-items: center !important;
        gap: 20px !important;
        margin: 0 0 18px !important;
        color: var(--text) !important;
        font-size: 20px !important;
        font-weight: 600 !important;
        line-height: 1.2 !important;
        letter-spacing: -.02em !important;
    }

    body.route-clients .hc-client-modal-section h3 span {
        color: var(--muted) !important;
        font-size: 16px !important;
        letter-spacing: .08em !important;
    }

    body.route-clients .hc-client-info-box,
    body.route-clients .hc-client-summary-grid article,
    body.route-clients .hc-client-orders-box {
        border: 1px solid var(--border) !important;
        border-radius: 10px !important;
        background: var(--card) !important;
        color: var(--text) !important;
    }

    body.route-clients .hc-client-info-box {
        padding: 24px 28px !important;
    }

    body.route-clients .hc-client-info-box dl {
        display: grid !important;
        grid-template-columns: 160px minmax(0, 1fr) !important;
        column-gap: 36px !important;
        row-gap: 18px !important;
        margin: 0 !important;
    }

    body.route-clients .hc-client-info-box dt,
    body.route-clients .hc-client-info-box dd {
        margin: 0 !important;
        min-width: 0 !important;
        overflow-wrap: anywhere !important;
        font-size: 15px !important;
        font-weight: 400 !important;
        line-height: 1.25 !important;
    }

    body.route-clients .hc-client-info-box dt {
        color: var(--muted) !important;
    }

    body.route-clients .hc-client-info-box dd {
        color: var(--text) !important;
    }

    body.route-clients .hc-client-info-box a {
        color: var(--primary) !important;
        text-decoration: none !important;
    }

    body.route-clients .hc-client-summary-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }

    body.route-clients .hc-client-summary-grid article {
        padding: 24px 28px !important;
    }

    body.route-clients .hc-client-summary-grid span {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        margin: 0 0 20px !important;
        color: var(--text) !important;
        font-size: 20px !important;
        font-weight: 500 !important;
        line-height: 1.2 !important;
    }

    body.route-clients .hc-client-summary-grid small {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 18px !important;
        height: 18px !important;
        border: 1px solid currentColor !important;
        border-radius: 999px !important;
        color: var(--muted) !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        line-height: 1 !important;
    }

    body.route-clients .hc-client-summary-grid strong {
        display: block !important;
        color: var(--text) !important;
        font-size: 38px !important;
        font-weight: 600 !important;
        line-height: 1.05 !important;
        letter-spacing: -.04em !important;
    }

    body.route-clients .hc-client-summary-grid em {
        font-style: normal !important;
        font-size: 18px !important;
        font-weight: 600 !important;
        letter-spacing: 0 !important;
    }

    body.route-clients .hc-client-summary-grid small {
        display: none !important;
    }

    body.route-clients .hc-client-orders-box {
        overflow-x: auto !important;
    }

    body.route-clients .hc-client-orders-head,
    body.route-clients .hc-client-order-line {
        display: grid !important;
        grid-template-columns: 90px 150px minmax(150px, 1fr) 100px !important;
        align-items: center !important;
        gap: 18px !important;
        min-width: 560px !important;
        padding: 16px 18px !important;
        color: var(--text) !important;
    }

    body.route-clients .hc-client-orders-head {
        font-size: 15px !important;
        font-weight: 600 !important;
    }

    body.route-clients .hc-client-order-line {
        border-top: 1px solid var(--border) !important;
        font-size: 15px !important;
        font-weight: 400 !important;
        text-decoration: none !important;
    }

    body.route-clients .hc-client-order-line strong,
    body.route-clients .hc-client-order-line small {
        display: block !important;
    }

    body.route-clients .hc-client-order-line strong {
        color: var(--text) !important;
        font-weight: 500 !important;
    }

    body.route-clients .hc-client-order-line small {
        margin-top: 3px !important;
        color: var(--muted) !important;
        font-size: 14px !important;
        font-weight: 400 !important;
    }

    body.route-clients .hc-client-order-line em {
        display: inline-flex !important;
        align-items: center !important;
        min-height: 30px !important;
        padding: 4px 10px !important;
        border-radius: 8px !important;
        background: var(--card-2) !important;
        color: var(--text) !important;
        font-style: normal !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        white-space: nowrap !important;
    }

    body.route-clients .hc-client-order-empty {
        color: var(--muted) !important;
    }

    body.route-clients .hc-client-edit-form {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.route-clients .hc-client-type-row {
        display: flex !important;
        align-items: center !important;
        gap: 18px !important;
        margin: 0 0 18px !important;
        color: var(--text) !important;
        font-size: 15px !important;
        font-weight: 400 !important;
    }

    body.route-clients .hc-client-type-row label {
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
        margin: 0 !important;
        cursor: pointer !important;
    }

    body.route-clients .hc-client-type-row input[type="radio"] {
        width: 18px !important;
        height: 18px !important;
        accent-color: var(--primary) !important;
    }

    body.route-clients .hc-floating-field {
        position: relative !important;
        display: block !important;
        margin: 0 0 20px !important;
        color: var(--muted) !important;
        font-size: 13px !important;
        font-weight: 400 !important;
    }

    body.route-clients .hc-floating-field span {
        position: absolute !important;
        top: -8px !important;
        left: 12px !important;
        z-index: 1 !important;
        padding: 0 4px !important;
        background: var(--card) !important;
        color: var(--muted) !important;
        font-size: 12px !important;
        font-weight: 400 !important;
        line-height: 1 !important;
    }

    body.route-clients .hc-floating-field input,
    body.route-clients .hc-floating-field select,
    body.route-clients .hc-floating-field textarea {
        width: 100% !important;
        min-height: 56px !important;
        margin: 0 !important;
        padding: 16px 14px 10px !important;
        border: 1px solid var(--border) !important;
        border-radius: 9px !important;
        background: var(--card) !important;
        color: var(--text) !important;
        font-size: 15px !important;
        font-weight: 400 !important;
        line-height: 1.25 !important;
        outline: none !important;
        box-shadow: none !important;
    }

    body.route-clients .hc-floating-field textarea {
        min-height: 80px !important;
        resize: vertical !important;
    }

    body.route-clients .hc-floating-field input:focus,
    body.route-clients .hc-floating-field select:focus,
    body.route-clients .hc-floating-field textarea:focus {
        border-color: var(--primary) !important;
    }

    body.route-clients .hc-client-edit-grid {
        display: grid !important;
        grid-template-columns: 1fr 150px !important;
        gap: 14px !important;
    }

    body.route-clients .hc-phone-field input {
        padding-right: 52px !important;
    }

    body.route-clients .hc-phone-field b {
        position: absolute !important;
        right: 14px !important;
        top: 50% !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 22px !important;
        height: 22px !important;
        border: 2px solid var(--text) !important;
        border-radius: 999px !important;
        color: var(--text) !important;
        font-size: 18px !important;
        font-weight: 600 !important;
        line-height: 1 !important;
        transform: translateY(-50%) !important;
    }

    body.route-clients .hc-client-edit-actions {
        position: sticky !important;
        bottom: -26px !important;
        margin: 28px -30px -26px !important;
        padding: 16px 30px !important;
        background: var(--card) !important;
        border-top: 1px solid var(--border) !important;
    }

    body.route-clients .hc-client-edit-actions .button {
        width: 100% !important;
        height: 44px !important;
        border-radius: 8px !important;
        font-size: 15px !important;
        font-weight: 500 !important;
    }

    html[data-theme="dark"] body.route-clients .hc-clients-table thead th,
    html[data-theme="dark"] body.route-clients .hc-clients-table tbody td,
    html[data-theme="dark"] body.route-clients .hc-client-order-line,
    html[data-theme="dark"] body.route-clients .hc-client-orders-head {
        border-color: #2a2a2a !important;
    }

    html[data-theme="dark"] body.route-clients .hc-clients-table tbody tr:hover,
    html[data-theme="dark"] body.route-clients .hc-clients-table tbody tr:focus {
        background: #202020 !important;
    }

    html[data-theme="dark"] body.route-clients .hc-client-modal-panel,
    html[data-theme="dark"] body.route-clients .hc-client-info-box,
    html[data-theme="dark"] body.route-clients .hc-client-summary-grid article,
    html[data-theme="dark"] body.route-clients .hc-client-orders-box,
    html[data-theme="dark"] body.route-clients .hc-floating-field input,
    html[data-theme="dark"] body.route-clients .hc-floating-field select,
    html[data-theme="dark"] body.route-clients .hc-floating-field textarea,
    html[data-theme="dark"] body.route-clients .hc-client-edit-actions {
        border-color: #2d2d2d !important;
        background: #1a1a1a !important;
        color: #f4f4f5 !important;
    }

    html[data-theme="dark"] body.route-clients .hc-floating-field span {
        background: #1a1a1a !important;
        color: #a1a1aa !important;
    }

    html[data-theme="dark"] body.route-clients .hc-client-info-box dt,
    html[data-theme="dark"] body.route-clients .hc-client-order-line small,
    html[data-theme="dark"] body.route-clients .hc-floating-field,
    html[data-theme="dark"] body.route-clients .hc-client-summary-grid small {
        color: #a1a1aa !important;
    }

    html[data-theme="dark"] body.route-clients .hc-client-order-line em {
        background: #3f3f46 !important;
        color: #f4f4f5 !important;
    }
}

@media (max-width: 768px) {
    body.route-clients .hc-client-modal,
    body.route-clients .hc-client-modal:target {
        display: none !important;
    }
}

/* V96 reports hub: dark HelloClient-like reports landing page */
.reports-hub-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reports-hub-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.reports-hub-head h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.15;
}

.reports-hub-intro {
    margin: 8px 0 0;
    max-width: 760px;
    color: var(--muted);
    font-size: 14px;
}

.reports-hub-layout {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.reports-hub-sidebar {
    position: sticky;
    top: 18px;
}

.reports-hub-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 18px;
    border-left: 1px solid var(--border);
}

.reports-hub-nav a {
    position: relative;
    display: block;
    padding: 10px 0;
    color: var(--muted);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
}

.reports-hub-nav a.active,
.reports-hub-nav a:hover {
    color: var(--text);
}

.reports-hub-nav a.active::before {
    content: '';
    position: absolute;
    left: -19px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    border-radius: 999px;
    background: var(--primary);
}

.reports-hub-content {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.reports-hub-note {
    color: var(--muted);
    font-size: 13px;
}

.reports-hub-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.reports-hub-section h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.reports-hub-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reports-hub-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 58px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card) 96%, transparent);
    box-shadow: none;
}

.reports-hub-card-main {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.reports-hub-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--muted);
    flex: 0 0 auto;
}

.reports-hub-card-title {
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
}

.reports-hub-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary) 18%, transparent);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    flex: 0 0 auto;
}

html[data-theme="dark"] .reports-hub-card {
    background: color-mix(in srgb, var(--card) 92%, #111 8%);
}

@media (max-width: 1100px) {
    .reports-hub-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .reports-hub-sidebar {
        position: static;
    }

    .reports-hub-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
        padding-left: 0;
        border-left: 0;
    }

    .reports-hub-nav a {
        padding: 8px 12px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: color-mix(in srgb, var(--card) 96%, transparent);
    }

    .reports-hub-nav a.active::before {
        display: none;
    }
}

@media (max-width: 767px) {
    .reports-hub-head h1 {
        font-size: 17px;
    }

    .reports-hub-intro {
        font-size: 13px;
    }

    .reports-hub-card {
        min-height: 54px;
        padding: 0 14px;
        border-radius: 14px;
    }

    .reports-hub-card-title {
        font-size: 14px;
    }
}

/* V97 reports functionality: cash/incasso, profit, payment summary */
.reports-v97-page {
    gap: 18px;
}

.reports-v97-export {
    white-space: nowrap;
}

.reports-v97-filterbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--card) 92%, transparent);
}

.reports-v97-filterbar label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.reports-v97-filterbar label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.reports-v97-filterbar input,
.reports-v97-filterbar select {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-2);
    color: var(--text);
    font: inherit;
    font-size: 14px;
}

.reports-v97-search {
    grid-column: span 2;
}

.reports-v97-filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.reports-v97-filter-actions .button,
.reports-v97-filter-actions button {
    min-height: 42px;
}

.reports-v97-layout {
    grid-template-columns: 160px minmax(0, 1fr);
}

.reports-v97-content {
    gap: 20px;
}

.reports-v97-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.reports-v97-card {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 76px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--card) 94%, transparent);
    color: var(--text);
    text-decoration: none;
}

.reports-v97-card:hover {
    border-color: color-mix(in srgb, var(--primary) 52%, var(--border));
}

.reports-v97-card strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
}

.reports-v97-card small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.reports-v97-card em {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--primary) 16%, transparent);
    color: var(--primary);
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
}

.reports-v97-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: color-mix(in srgb, var(--card) 94%, transparent);
}

.reports-v97-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 2px;
}

.reports-v97-panel-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.reports-v97-panel-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.reports-v97-kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.reports-v97-kpi-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reports-v97-kpi-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reports-v97-kpi-grid > div {
    min-height: 82px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--card-2) 92%, transparent);
}

.reports-v97-kpi-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.reports-v97-kpi-grid strong {
    display: block;
    margin-top: 10px;
    color: var(--text);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.reports-v97-kpi-grid .is-positive,
.reports-v97-table .is-positive {
    color: var(--success);
}

.reports-v97-kpi-grid .is-negative,
.reports-v97-table .is-negative {
    color: var(--danger);
}

.reports-v97-table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.reports-v97-table-wrap.compact {
    max-height: 380px;
}

.reports-v97-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.reports-v97-table th,
.reports-v97-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    font-size: 13px;
}

.reports-v97-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    background: color-mix(in srgb, var(--card-2) 86%, transparent);
}

.reports-v97-table td {
    color: var(--text);
}

.reports-v97-table tr:last-child td {
    border-bottom: 0;
}

.reports-v97-table a {
    color: var(--primary);
    text-decoration: none;
}

.reports-v97-table small {
    color: var(--muted);
}

.reports-v97-two-tables {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.reports-v97-two-tables h3 {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
}

.reports-v97-details {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--card-2) 72%, transparent);
    overflow: hidden;
}

.reports-v97-details > summary {
    cursor: pointer;
    padding: 14px 16px;
    color: var(--text);
    font-weight: 600;
}

.reports-v97-details[open] > summary {
    border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] .reports-v97-filterbar,
html[data-theme="dark"] .reports-v97-panel,
html[data-theme="dark"] .reports-v97-card {
    background: #1a1a1a;
}

html[data-theme="dark"] .reports-v97-filterbar input,
html[data-theme="dark"] .reports-v97-filterbar select,
html[data-theme="dark"] .reports-v97-kpi-grid > div,
html[data-theme="dark"] .reports-v97-details {
    background: #202020;
}

@media (max-width: 1280px) {
    .reports-v97-filterbar {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .reports-v97-kpi-grid,
    .reports-v97-kpi-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .reports-v97-filterbar {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }

    .reports-v97-cards-grid,
    .reports-v97-two-tables,
    .reports-v97-kpi-grid,
    .reports-v97-kpi-3,
    .reports-v97-kpi-4 {
        grid-template-columns: 1fr;
    }

    .reports-v97-search {
        grid-column: auto;
    }
}

@media (max-width: 767px) {
    .reports-v97-filterbar {
        grid-template-columns: 1fr;
        padding: 12px;
        border-radius: 14px;
    }

    .reports-v97-filter-actions {
        align-items: stretch;
    }

    .reports-v97-filter-actions .button,
    .reports-v97-filter-actions button {
        flex: 1;
    }

    .reports-v97-panel {
        padding: 14px;
        border-radius: 16px;
    }

    .reports-v97-kpi-grid strong {
        font-size: 20px;
    }

    .reports-v97-card {
        min-height: 68px;
    }
}

/* V97.1 hotfix: mobile bottom nav must never appear as raw text on desktop */
.app-bottom-nav {
    display: none;
}

@media (max-width: 900px) {
    .app-bottom-nav {
        display: flex;
    }
}

/* V98 reports: layout corrected to match approved HelloClient-like concept */
.reports-v98-page {
    --reports-gap: 22px;
    width: 100%;
}

.reports-v98-layout {
    display: grid;
    grid-template-columns: 150px minmax(260px, 360px) minmax(520px, 1fr);
    gap: var(--reports-gap);
    align-items: start;
    width: 100%;
}

.reports-v98-categories {
    position: sticky;
    top: 18px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 260px;
    padding: 8px 0 8px 18px;
    border-left: 1px solid var(--border);
}

.reports-v98-categories a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 34px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.reports-v98-categories a:hover,
.reports-v98-categories a.active {
    color: var(--text);
}

.reports-v98-categories a.active::before {
    content: '';
    position: absolute;
    left: -19px;
    top: 7px;
    bottom: 7px;
    width: 2px;
    border-radius: 999px;
    background: var(--primary);
}

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

.reports-v98-list h1 {
    margin: 0 0 6px;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.reports-v98-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 78px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card) 96%, transparent);
    color: var(--text);
    text-decoration: none;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.reports-v98-card:hover {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    transform: translateY(-1px);
}

.reports-v98-card.is-selected {
    border-color: color-mix(in srgb, var(--primary) 72%, var(--border));
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--primary) 75%, transparent);
}

.reports-v98-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--muted);
    font-size: 18px;
    flex: 0 0 auto;
}

.reports-v98-card-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1 1 auto;
}

.reports-v98-card-text strong {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
}

.reports-v98-card-text small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.reports-v98-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 9px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--primary) 18%, transparent);
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    flex: 0 0 auto;
}

.reports-v98-detail {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.reports-v98-panel {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--card) 96%, transparent);
    overflow: hidden;
}

.reports-v98-panel-head,
.reports-v98-compact-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.reports-v98-panel-title {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.reports-v98-panel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--primary) 52%, var(--border));
    color: var(--primary);
    flex: 0 0 auto;
}

.reports-v98-panel h2,
.reports-v98-compact-head h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 600;
}

.reports-v98-panel p,
.reports-v98-compact-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.reports-v98-favorite,
.reports-v98-secondary,
.reports-v98-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--card) 82%, transparent);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.reports-v98-primary {
    border-color: color-mix(in srgb, var(--primary) 72%, transparent);
    background: var(--primary);
    color: var(--primary-contrast);
}

.reports-v98-filterline {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(150px, 1fr) minmax(130px, .85fr) minmax(130px, .85fr) auto auto;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    align-items: end;
}

.reports-v98-filterline label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.reports-v98-filterline label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.reports-v98-filterline input,
.reports-v98-filterline select {
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: color-mix(in srgb, var(--card-2) 84%, transparent);
    color: var(--text);
    padding: 0 11px;
    font: inherit;
    font-size: 13px;
}

.reports-v98-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 18px 20px 10px;
}

.reports-v98-kpis.is-five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.reports-v98-kpis.is-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reports-v98-kpis div {
    min-height: 78px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: color-mix(in srgb, var(--card-2) 72%, transparent);
}

.reports-v98-kpis span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.reports-v98-kpis strong {
    display: block;
    margin-top: 10px;
    font-size: 20px;
    line-height: 1.1;
    font-weight: 650;
}

.reports-v98-kpis strong.is-positive,
.reports-v98-table .is-positive {
    color: var(--success);
}

.reports-v98-kpis strong.is-negative,
.reports-v98-table .is-negative {
    color: var(--danger);
}

.reports-v98-note {
    margin: 0;
    padding: 0 20px 14px;
    color: var(--muted);
    font-size: 12px;
    font-style: italic;
}

.reports-v98-table-wrap {
    margin: 0 20px 20px;
    border: 1px solid var(--border);
    border-radius: 11px;
    overflow: auto;
}

.reports-v98-table-wrap.compact {
    margin-top: 0;
}

.reports-v98-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.reports-v98-table th,
.reports-v98-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 13px;
    line-height: 1.25;
    vertical-align: top;
}

.reports-v98-table th {
    color: var(--muted);
    background: color-mix(in srgb, var(--card-2) 76%, transparent);
    font-size: 12px;
    font-weight: 650;
    text-transform: none;
}

.reports-v98-table tr:last-child td {
    border-bottom: 0;
}

.reports-v98-table a {
    color: var(--primary);
    text-decoration: none;
}

.reports-v98-table small {
    color: var(--muted);
}

.reports-v98-small-panel .reports-v98-compact-head {
    border-bottom: 0;
    padding-bottom: 4px;
}

html[data-theme="dark"] .reports-v98-page {
    color-scheme: dark;
}

html[data-theme="dark"] .reports-v98-card,
html[data-theme="dark"] .reports-v98-panel {
    background: #1a1a1a;
}

html[data-theme="dark"] .reports-v98-kpis div,
html[data-theme="dark"] .reports-v98-filterline input,
html[data-theme="dark"] .reports-v98-filterline select,
html[data-theme="dark"] .reports-v98-table th {
    background: #202020;
}

@media (max-width: 1280px) {
    .reports-v98-layout {
        grid-template-columns: 140px minmax(240px, 320px) minmax(460px, 1fr);
        gap: 16px;
    }

    .reports-v98-filterline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .reports-v98-layout {
        grid-template-columns: 1fr;
    }

    .reports-v98-categories {
        position: static;
        flex-direction: row;
        gap: 10px;
        min-height: 0;
        overflow-x: auto;
        padding: 0 0 8px;
        border-left: 0;
    }

    .reports-v98-categories a {
        flex: 0 0 auto;
        min-height: 36px;
        padding: 0 12px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: color-mix(in srgb, var(--card) 94%, transparent);
    }

    .reports-v98-categories a.active::before {
        display: none;
    }

    .reports-v98-list {
        order: 1;
    }

    .reports-v98-detail {
        order: 2;
    }

    .reports-v98-kpis,
    .reports-v98-kpis.is-five,
    .reports-v98-kpis.is-four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .reports-v98-panel-head,
    .reports-v98-compact-head {
        flex-direction: column;
        padding: 15px;
    }

    .reports-v98-filterline {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .reports-v98-kpis,
    .reports-v98-kpis.is-five,
    .reports-v98-kpis.is-four {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .reports-v98-table-wrap {
        margin: 0 15px 15px;
    }
}

/* V99 reports: simplified cash/incasso page without duplicated category rail */
.reports-v99-page {
    min-height: calc(100vh - 90px);
}

.reports-v99-layout {
    display: grid;
    grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    max-width: 1500px;
    margin: 0 auto;
}

.reports-v99-list {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.reports-v99-list h1 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.reports-v99-card {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 76px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--card) 96%, transparent);
    color: var(--text);
    text-decoration: none;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.reports-v99-card:hover {
    border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
    transform: translateY(-1px);
}

.reports-v99-card.is-selected {
    border-color: var(--primary);
    box-shadow: inset 3px 0 0 var(--primary);
}

.reports-v99-card-icon {
    color: var(--muted);
    font-size: 16px;
    text-align: center;
}

.reports-v99-card-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.reports-v99-card-text strong {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
}

.reports-v99-card-text small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.3;
}

.reports-v99-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--primary) 18%, transparent);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
}

.reports-v99-detail {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.reports-v99-cash-panel,
.reports-v99-small-panel {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--card) 95%, transparent);
    overflow: hidden;
}

.reports-v99-panel-head,
.reports-v99-small-panel > header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.reports-v99-panel-head h2,
.reports-v99-small-panel h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.reports-v99-panel-head p,
.reports-v99-small-panel p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.reports-v99-cash-form {
    display: grid;
    grid-template-columns: minmax(150px, 1.15fr) minmax(150px, 1fr) minmax(132px, .85fr) minmax(132px, .85fr);
    gap: 10px 12px;
    align-items: end;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.reports-v99-cash-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.reports-v99-cash-form select,
.reports-v99-cash-form input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--card) 88%, transparent);
    color: var(--text);
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    outline: none;
}

.reports-v99-cash-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
    padding-top: 2px;
}

.reports-v99-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.reports-v99-btn.primary {
    border-color: color-mix(in srgb, var(--primary) 88%, #fff 12%);
    background: var(--primary);
    color: #fff;
}

.reports-v99-btn.danger {
    border-color: color-mix(in srgb, #ef4444 80%, #fff 20%);
    background: #dc3545;
    color: #fff;
}

.reports-v99-btn.secondary {
    background: color-mix(in srgb, var(--card) 88%, transparent);
}

.reports-v99-cash-simple {
    padding: 16px 20px 10px;
}

.reports-v99-cash-numbers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.reports-v99-cash-numbers div,
.reports-v99-mini-kpis div {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card-2) 74%, transparent);
    padding: 14px 16px;
}

.reports-v99-cash-numbers span,
.reports-v99-mini-kpis span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 7px;
}

.reports-v99-cash-numbers strong,
.reports-v99-mini-kpis strong {
    display: block;
    color: var(--primary);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
}

.reports-v99-cash-numbers strong.is-positive,
.reports-v99-mini-kpis strong.is-positive,
.reports-v99-table .is-positive {
    color: #22c55e;
}

.reports-v99-table .is-negative {
    color: #ff4d5e;
}

.reports-v99-cash-simple p {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-style: italic;
    line-height: 1.45;
}

.reports-v99-table-wrap {
    padding: 8px 20px 20px;
    overflow-x: auto;
}

.reports-v99-table-wrap.compact {
    padding-top: 0;
}

.reports-v99-table {
    width: 100%;
    min-width: 620px;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.reports-v99-table th,
.reports-v99-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-align: left;
    font-size: 13px;
    line-height: 1.35;
    vertical-align: top;
}

.reports-v99-table th {
    background: color-mix(in srgb, var(--card-2) 88%, transparent);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.reports-v99-table tr:last-child td {
    border-bottom: 0;
}

.reports-v99-table td:last-child,
.reports-v99-table th:last-child {
    text-align: right;
}

.reports-v99-table a {
    color: var(--primary);
    text-decoration: none;
}

.reports-v99-incasso-history {
    margin: 0 20px 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card-2) 66%, transparent);
    overflow: hidden;
}

.reports-v99-incasso-history summary {
    padding: 14px 16px;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.reports-v99-small-panel > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.reports-v99-mini-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 16px 20px;
}

html[data-theme="dark"] .reports-v99-card,
html[data-theme="dark"] .reports-v99-cash-panel,
html[data-theme="dark"] .reports-v99-small-panel {
    background: #1b1b1b;
}

html[data-theme="dark"] .reports-v99-cash-form select,
html[data-theme="dark"] .reports-v99-cash-form input,
html[data-theme="dark"] .reports-v99-btn.secondary {
    background: #191919;
}

@media (max-width: 1200px) {
    .reports-v99-layout {
        grid-template-columns: 1fr;
    }

    .reports-v99-cash-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reports-v99-cash-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .reports-v99-page {
        padding-bottom: 90px;
    }

    .reports-v99-layout {
        gap: 16px;
    }

    .reports-v99-list h1 {
        font-size: 17px;
    }

    .reports-v99-card {
        min-height: 66px;
        padding: 12px 13px;
        border-radius: 14px;
    }

    .reports-v99-cash-form,
    .reports-v99-cash-numbers,
    .reports-v99-mini-kpis {
        grid-template-columns: 1fr;
    }

    .reports-v99-cash-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .reports-v99-cash-actions .reports-v99-btn {
        width: 100%;
    }

    .reports-v99-panel-head,
    .reports-v99-small-panel > header,
    .reports-v99-cash-form,
    .reports-v99-cash-simple,
    .reports-v99-table-wrap {
        padding-left: 14px;
        padding-right: 14px;
    }

    .reports-v99-incasso-history {
        margin-left: 14px;
        margin-right: 14px;
    }
}

/* V104 SMS pages: clean HelloClient-like cards, readable filters and template editor. */
body.route-sms .desktop-content,
body.route-sms-templates .desktop-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 18px 28px 88px !important;
}

.sms-page {
    display: grid;
    gap: 16px;
}

.sms-hero-card,
.sms-filter-card,
.sms-panel-card {
    border: 1px solid var(--border);
    border-radius: 22px;
    background: color-mix(in srgb, var(--card) 96%, transparent);
    box-shadow: var(--shadow-soft);
}

.sms-hero-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
}

.sms-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sms-hero-card h1,
.sms-panel-head h2 {
    margin: 0;
    color: var(--text);
    font-size: 24px;
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -0.045em;
}

.sms-hero-card p,
.sms-panel-head p {
    max-width: 820px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 450;
    line-height: 1.45;
}

.sms-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.sms-filter-card {
    padding: 16px;
}

.sms-filter-form {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) minmax(180px, 0.7fr) minmax(170px, 0.6fr) auto;
    align-items: end;
    gap: 12px;
}

.sms-field {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.sms-field > span {
    line-height: 1.2;
}

.sms-field input,
.sms-field select,
.sms-field textarea,
.sms-template-card input,
.sms-template-card select,
.sms-template-card textarea,
.sms-rule-row input,
.sms-rule-row select,
.sms-rule-row textarea,
body.route-sms-templates .settings-table input,
body.route-sms-templates .settings-table select,
body.route-sms-templates .settings-table textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    background: var(--input);
    color: var(--text);
    outline: none;
    font-size: 14px;
    font-weight: 500;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.sms-field textarea,
.sms-template-card textarea,
body.route-sms-templates .settings-table textarea {
    min-height: 116px;
    line-height: 1.38;
    resize: vertical;
}

.sms-field input:focus,
.sms-field select:focus,
.sms-field textarea:focus,
.sms-template-card input:focus,
.sms-template-card select:focus,
.sms-template-card textarea:focus,
.sms-rule-row input:focus,
.sms-rule-row select:focus,
.sms-rule-row textarea:focus,
body.route-sms-templates .settings-table input:focus,
body.route-sms-templates .settings-table select:focus,
body.route-sms-templates .settings-table textarea:focus {
    border-color: color-mix(in srgb, var(--primary) 58%, var(--border));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-soft) 60%, transparent);
}

.sms-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.sms-filter-actions .button {
    min-width: 136px;
}

.sms-panel-card {
    overflow: hidden;
}

.sms-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.sms-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 30px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card-2);
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.sms-empty-state {
    display: grid;
    gap: 5px;
    margin: 18px;
    padding: 22px;
    border: 1px dashed color-mix(in srgb, var(--border) 86%, var(--muted));
    border-radius: 18px;
    background: var(--card-2);
    color: var(--muted);
}

.sms-empty-state strong {
    color: var(--text);
    font-size: 16px;
    font-weight: 650;
}

.sms-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.sms-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.sms-table th,
.sms-table td,
body.route-sms-templates .settings-table th,
body.route-sms-templates .settings-table td {
    border-bottom: 1px solid var(--border);
    padding: 13px 14px;
    vertical-align: middle;
}

.sms-table th,
body.route-sms-templates .settings-table th {
    background: color-mix(in srgb, var(--card-2) 88%, transparent);
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.035em;
}

.sms-table tbody tr,
body.route-sms-templates .settings-table tbody tr {
    background: color-mix(in srgb, var(--card) 98%, transparent);
}

.sms-table tbody tr:hover,
body.route-sms-templates .settings-table tbody tr:hover {
    background: color-mix(in srgb, var(--primary-soft) 26%, var(--card));
}

.sms-table tbody tr:last-child td,
body.route-sms-templates .settings-table tbody tr:last-child td {
    border-bottom: 0;
}

.sms-id-chip,
.sms-phone,
.sms-order-link {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--card-2);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.sms-order-link {
    color: var(--primary);
}

.sms-text-cell {
    min-width: 280px;
    max-width: 520px;
}

.sms-message-preview {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.sms-error-line {
    margin-top: 8px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.sms-row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.sms-row-actions form {
    margin: 0;
}

.sms-row-actions .button,
.sms-rule-save,
.sms-template-footer .button {
    white-space: nowrap;
}

.button-danger {
    border-color: color-mix(in srgb, var(--danger) 46%, var(--border));
    background: var(--danger-soft);
    color: var(--danger);
}

.button-danger:hover {
    border-color: var(--danger);
    background: color-mix(in srgb, var(--danger-soft) 72%, var(--danger) 10%);
    color: var(--danger);
}

.status-sms-queued {
    background: var(--warning-soft);
    color: var(--warning);
}

.status-sms-sending {
    background: var(--primary-soft);
    color: var(--primary);
}

.status-sms-sent {
    background: var(--success-soft);
    color: var(--success);
}

.status-sms-failed {
    background: var(--danger-soft);
    color: var(--danger);
}

.status-sms-cancelled {
    background: var(--card-2);
    color: var(--muted);
}

.sms-rules-list,
.sms-template-grid {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.sms-rule-row,
.sms-template-card {
    display: grid;
    gap: 14px;
    min-width: 0;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: color-mix(in srgb, var(--card) 96%, transparent);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.045);
}

.sms-rule-row {
    grid-template-columns: minmax(170px, 0.8fr) minmax(280px, 1.4fr) minmax(190px, 0.8fr) minmax(112px, 0.45fr) auto;
    align-items: end;
    padding: 14px;
}

.sms-rule-event {
    display: grid;
    gap: 5px;
    align-self: center;
    min-width: 0;
}

.sms-rule-event span,
.sms-template-card-head strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.2;
}

.sms-rule-event code,
.sms-template-meta code,
.sms-variable-strip code {
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 8px;
    background: var(--card-2);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.sms-rule-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 12px;
    align-self: center;
}

.sms-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    user-select: none;
}

.sms-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.sms-switch span {
    position: relative;
    width: 38px;
    height: 22px;
    flex: 0 0 38px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card-2);
    transition: background .16s ease, border-color .16s ease;
}

.sms-switch span::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--muted-2);
    transition: transform .16s ease, background .16s ease;
}

.sms-switch input:checked + span {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.sms-switch input:checked + span::after {
    transform: translateX(16px);
    background: var(--primary);
}

.sms-switch em {
    font-style: normal;
    white-space: nowrap;
}

.sms-rule-cooldown input {
    text-align: center;
}

.sms-variable-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 18px 0;
}

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

.sms-template-card {
    padding: 16px;
}

.sms-template-card-head,
.sms-template-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.sms-template-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

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

.sms-template-body-field {
    grid-column: 1 / -1;
}

.sms-template-textarea {
    min-height: 130px;
}

.sms-template-footer {
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

html[data-theme="dark"] .sms-hero-card,
html[data-theme="dark"] .sms-filter-card,
html[data-theme="dark"] .sms-panel-card,
html[data-theme="dark"] .sms-rule-row,
html[data-theme="dark"] .sms-template-card {
    background: #1b1b1b;
    border-color: #2d2d2d;
}

html[data-theme="dark"] .sms-table th,
html[data-theme="dark"] body.route-sms-templates .settings-table th,
html[data-theme="dark"] .sms-id-chip,
html[data-theme="dark"] .sms-phone,
html[data-theme="dark"] .sms-empty-state,
html[data-theme="dark"] .sms-count-badge,
html[data-theme="dark"] .sms-rule-event code,
html[data-theme="dark"] .sms-template-meta code,
html[data-theme="dark"] .sms-variable-strip code,
html[data-theme="dark"] .sms-switch span {
    background: #242424;
    border-color: #323232;
}

html[data-theme="dark"] .sms-table tbody tr,
html[data-theme="dark"] body.route-sms-templates .settings-table tbody tr {
    background: #1b1b1b;
}

html[data-theme="dark"] .sms-table tbody tr:hover,
html[data-theme="dark"] body.route-sms-templates .settings-table tbody tr:hover {
    background: #242424;
}

html[data-theme="dark"] .sms-field input,
html[data-theme="dark"] .sms-field select,
html[data-theme="dark"] .sms-field textarea,
html[data-theme="dark"] .sms-template-card input,
html[data-theme="dark"] .sms-template-card select,
html[data-theme="dark"] .sms-template-card textarea,
html[data-theme="dark"] .sms-rule-row input,
html[data-theme="dark"] .sms-rule-row select,
html[data-theme="dark"] .sms-rule-row textarea {
    background: #151515;
    border-color: #333333;
}

@media (max-width: 1180px) {
    .sms-filter-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sms-field-search {
        grid-column: 1 / -1;
    }

    .sms-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .sms-rule-row {
        grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.2fr) minmax(180px, 0.8fr) minmax(100px, 0.4fr);
    }

    .sms-rule-save {
        grid-column: 1 / -1;
        justify-self: start;
    }

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

@media (max-width: 760px) {
    body.route-sms .desktop-content,
    body.route-sms-templates .desktop-content {
        padding: 12px 12px 104px !important;
    }

    .sms-page {
        gap: 12px;
    }

    .sms-hero-card,
    .sms-panel-head,
    .sms-template-card-head,
    .sms-template-footer {
        display: grid;
        align-items: start;
    }

    .sms-hero-card,
    .sms-filter-card,
    .sms-panel-card {
        border-radius: 18px;
    }

    .sms-hero-card,
    .sms-panel-head {
        padding: 16px;
    }

    .sms-hero-card h1,
    .sms-panel-head h2 {
        font-size: 21px;
    }

    .sms-hero-actions,
    .sms-filter-actions {
        justify-content: stretch;
    }

    .sms-hero-actions .button,
    .sms-filter-actions .button,
    .sms-filter-actions button {
        width: 100%;
    }

    .sms-filter-form,
    .sms-rule-row,
    .sms-template-fields {
        grid-template-columns: 1fr;
    }

    .sms-rules-list,
    .sms-template-grid {
        padding: 12px;
    }

    .sms-rule-row,
    .sms-template-card {
        border-radius: 16px;
        padding: 13px;
    }

    .sms-rule-checks {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sms-variable-strip {
        padding: 12px 12px 0;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .sms-template-footer .button {
        width: 100%;
    }

    .sms-table,
    .sms-table thead,
    .sms-table tbody,
    .sms-table tr,
    .sms-table th,
    .sms-table td {
        display: block;
        width: 100%;
    }

    .sms-table thead {
        display: none;
    }

    .sms-table tbody {
        display: grid;
        gap: 12px;
        padding: 12px;
    }

    .sms-table tbody tr {
        border: 1px solid var(--border);
        border-radius: 16px;
        overflow: hidden;
        box-shadow: none;
    }

    .sms-table td {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 12px;
        min-height: 38px;
        padding: 10px 12px;
        border-bottom: 1px solid var(--border);
    }

    .sms-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 750;
        line-height: 1.25;
        text-transform: none;
        letter-spacing: 0;
    }

    .sms-table td:last-child {
        border-bottom: 0;
    }

    .sms-text-cell {
        min-width: 0;
        max-width: none;
    }

    .sms-row-actions {
        justify-content: flex-start;
    }
}

/* Service Orders V2 — V105 Settings UI polish */
body.route-settings .desktop-content {
    width: min(100% - 32px, 1520px);
}

.settings-page {
    display: grid;
    gap: 16px;
}

.settings-hero-card,
.settings-panel-card {
    border: 1px solid var(--border);
    border-radius: 22px;
    background: color-mix(in srgb, var(--card) 96%, transparent);
    box-shadow: var(--shadow-soft);
}

.settings-hero-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
}

.settings-eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    padding: 4px 9px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card-2);
    color: var(--muted);
    font-size: 11px;
    font-weight: 450;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.settings-hero-card h1 {
    margin: 0 0 6px;
    font-size: 29px;
    line-height: 1.05;
    letter-spacing: -0.055em;
}

.settings-hero-card p,
.settings-section-header p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.settings-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.settings-alert {
    margin: 0;
}

.settings-tabs {
    position: sticky;
    top: 76px;
    z-index: 7;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: color-mix(in srgb, var(--card) 88%, transparent);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    scrollbar-width: thin;
}

.settings-tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 450;
    white-space: nowrap;
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.settings-tabs a:hover,
.settings-tabs a:focus-visible {
    border-color: var(--border);
    background: var(--card-2);
    color: var(--text);
    outline: none;
}

.settings-tabs a em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 23px;
    height: 23px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
    font-style: normal;
    font-weight: 450;
}

.settings-section {
    scroll-margin-top: 150px;
}

.settings-panel-card {
    overflow: hidden;
}

.settings-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
}

.settings-section-header h2 {
    margin: 0 0 5px;
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: -0.045em;
}

.settings-table-wrap {
    overflow-x: auto;
    padding: 0 20px 18px;
}

.settings-data-table {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
}

.settings-data-table th,
.settings-data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.settings-data-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--card-2);
    color: var(--muted);
    font-size: 11px;
    font-weight: 450;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.settings-data-table tbody tr {
    transition: background .16s ease;
}

.settings-data-table tbody tr:hover {
    background: color-mix(in srgb, var(--card-2) 72%, transparent);
}

.settings-data-table tbody tr:last-child td {
    border-bottom: 0;
}

.settings-data-table input,
.settings-data-table select,
.settings-data-table textarea,
.settings-system-field input,
.settings-system-field select,
.settings-system-field textarea {
    width: 100%;
    min-height: 36px;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 8px 10px;
    background: var(--input);
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.settings-data-table input:focus,
.settings-data-table select:focus,
.settings-data-table textarea:focus,
.settings-system-field input:focus,
.settings-system-field select:focus,
.settings-system-field textarea:focus {
    border-color: color-mix(in srgb, var(--primary) 70%, var(--border));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-soft) 62%, transparent);
}

.settings-data-table .tiny-input,
.settings-data-table .short-input {
    max-width: 142px;
}

.settings-status-table {
    min-width: 1180px;
}

.settings-status-table th:nth-child(1),
.settings-status-table td:nth-child(1) {
    width: 15%;
}

.settings-status-table th:nth-child(2),
.settings-status-table td:nth-child(2) {
    width: 20%;
}

.settings-status-table th:nth-child(3),
.settings-status-table td:nth-child(3) {
    width: 20%;
}

.settings-status-table th:nth-child(4),
.settings-status-table td:nth-child(4) {
    width: 16%;
}

.settings-status-table th:nth-child(5),
.settings-status-table td:nth-child(5) {
    width: 9%;
}

.settings-status-table th:nth-child(6),
.settings-status-table td:nth-child(6) {
    width: 8%;
}

.settings-status-table th:nth-child(7),
.settings-status-table td:nth-child(7),
.settings-simple-table th:last-child,
.settings-simple-table td:last-child,
.settings-parking-table th:last-child,
.settings-parking-table td:last-child {
    width: 126px;
    text-align: right;
}

.settings-inline-fields,
.settings-color-fields {
    display: grid;
    gap: 7px;
}

.settings-inline-fields-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-color-fields {
    grid-template-columns: minmax(90px, .8fr) minmax(90px, .8fr) auto;
    align-items: center;
}

.settings-preview-pill {
    min-height: 28px;
    padding-inline: 10px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
}

.settings-code,
.settings-zone-code {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-2);
    color: var(--text);
    font-size: 12px;
    font-weight: 450;
    line-height: 1.15;
    white-space: nowrap;
}

.settings-check-grid {
    display: grid;
    gap: 6px;
}

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

.settings-data-table .checkline,
.settings-switch-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}

.settings-data-table input[type="checkbox"],
.settings-switch-line input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 16px;
    padding: 0;
    accent-color: var(--primary);
}

.settings-add-row td {
    background: color-mix(in srgb, var(--primary-soft) 30%, transparent);
}

.settings-add-row .button {
    background: var(--card);
}

.settings-system-form {
    padding: 18px 20px 20px;
}

.settings-system-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px 16px;
}

.settings-system-field {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card-2);
}

.settings-system-field span {
    color: var(--text);
    font-size: 13px;
    font-weight: 450;
    line-height: 1.25;
}

.settings-system-field small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.25;
}

.settings-system-field small code {
    color: inherit;
    font-size: 11px;
}

.settings-form-actions {
    display: flex;
    justify-content: flex-start;
    padding-top: 16px;
}

html[data-theme="dark"] .settings-hero-card,
html[data-theme="dark"] .settings-panel-card,
html[data-theme="dark"] .settings-tabs {
    background: #1b1b1b;
    border-color: #2d2d2d;
}

html[data-theme="dark"] .settings-eyebrow,
html[data-theme="dark"] .settings-data-table th,
html[data-theme="dark"] .settings-code,
html[data-theme="dark"] .settings-zone-code,
html[data-theme="dark"] .settings-system-field {
    background: #242424;
    border-color: #323232;
}

html[data-theme="dark"] .settings-data-table tbody tr:hover,
html[data-theme="dark"] .settings-add-row td {
    background: #222222;
}

html[data-theme="dark"] .settings-data-table input,
html[data-theme="dark"] .settings-data-table select,
html[data-theme="dark"] .settings-data-table textarea,
html[data-theme="dark"] .settings-system-field input,
html[data-theme="dark"] .settings-system-field select,
html[data-theme="dark"] .settings-system-field textarea {
    background: #151515;
    border-color: #333333;
}

@media (max-width: 1180px) {
    .settings-hero-card {
        display: grid;
    }

    .settings-tabs {
        top: 68px;
    }

    .settings-system-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    body.route-settings .desktop-content {
        width: 100%;
        padding: 12px 12px 104px !important;
    }

    .settings-page {
        gap: 12px;
    }

    .settings-hero-card,
    .settings-panel-card {
        border-radius: 18px;
    }

    .settings-hero-card,
    .settings-section-header {
        padding: 16px;
    }

    .settings-hero-card h1 {
        font-size: 24px;
    }

    .settings-section-header h2 {
        font-size: 20px;
    }

    .settings-hero-actions .button,
    .settings-form-actions .button {
        width: 100%;
    }

    .settings-tabs {
        position: static;
        margin-inline: 0;
        border-radius: 16px;
    }

    .settings-tabs a {
        min-height: 38px;
        padding: 8px 12px;
    }

    .settings-section {
        scroll-margin-top: 92px;
    }

    .settings-table-wrap {
        padding: 0 12px 12px;
        overflow: visible;
    }

    .settings-data-table,
    .settings-data-table thead,
    .settings-data-table tbody,
    .settings-data-table tr,
    .settings-data-table th,
    .settings-data-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .settings-data-table thead {
        display: none;
    }

    .settings-data-table tbody {
        display: grid;
        gap: 12px;
        padding-top: 12px;
    }

    .settings-data-table tbody tr {
        border: 1px solid var(--border);
        border-radius: 16px;
        background: var(--card);
        overflow: hidden;
    }

    .settings-data-table td {
        display: grid;
        grid-template-columns: 110px minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        min-height: 44px;
        padding: 10px 12px;
        border-bottom: 1px solid var(--border);
    }

    .settings-data-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 450;
        line-height: 1.2;
    }

    .settings-data-table td:last-child {
        border-bottom: 0;
    }

    .settings-data-table td:last-child .button {
        width: 100%;
    }

    .settings-inline-fields-2,
    .settings-color-fields,
    .settings-check-grid-roles {
        grid-template-columns: 1fr;
    }

    .settings-data-table .tiny-input,
    .settings-data-table .short-input {
        max-width: none;
    }

    .settings-system-form {
        padding: 12px;
    }

    .settings-system-field {
        border-radius: 14px;
        padding: 11px;
    }

    html[data-theme="dark"] .settings-data-table tbody tr {
        background: #1b1b1b;
        border-color: #2d2d2d;
    }
}

/* Service Orders V2 — V106 Settings compact typography and mobile cards */
body.route-settings .settings-page,
body.route-settings .settings-hero-card,
body.route-settings .settings-panel-card,
body.route-settings .settings-data-table,
body.route-settings .settings-system-form {
    font-weight: 400;
}

body.route-settings .settings-hero-card h1,
body.route-settings .settings-section-header h2 {
    font-weight: 760;
}

body.route-settings .settings-hero-card p,
body.route-settings .settings-section-header p,
body.route-settings .settings-system-field small {
    font-weight: 400;
}

body.route-settings .settings-eyebrow,
body.route-settings .settings-tabs a,
body.route-settings .settings-tabs a em,
body.route-settings .settings-data-table th {
    font-weight: 650;
}

body.route-settings .settings-data-table input,
body.route-settings .settings-data-table select,
body.route-settings .settings-data-table textarea,
body.route-settings .settings-system-field input,
body.route-settings .settings-system-field select,
body.route-settings .settings-system-field textarea {
    font-weight: 500;
}

body.route-settings .settings-code,
body.route-settings .settings-zone-code,
body.route-settings .settings-system-field span,
body.route-settings .settings-data-table .checkline,
body.route-settings .settings-switch-line {
    font-weight: 600;
}

body.route-settings .settings-data-table tr > form {
    display: contents;
}

body.route-settings .settings-data-table td:last-child .button {
    font-weight: 600;
}

@media (max-width: 760px) {
    body.route-settings .desktop-content {
        padding: 10px 10px 100px !important;
    }

    body.route-settings .settings-page {
        gap: 10px;
    }

    body.route-settings .settings-hero-card,
    body.route-settings .settings-panel-card {
        border-radius: 18px;
    }

    body.route-settings .settings-hero-card,
    body.route-settings .settings-section-header {
        padding: 14px;
    }

    body.route-settings .settings-eyebrow {
        min-height: 22px;
        padding: 3px 8px;
        font-size: 10px;
        font-weight: 650;
    }

    body.route-settings .settings-hero-card h1 {
        font-size: 23px;
        font-weight: 760;
        letter-spacing: -0.04em;
    }

    body.route-settings .settings-section-header h2 {
        font-size: 21px;
        font-weight: 760;
        letter-spacing: -0.035em;
    }

    body.route-settings .settings-hero-card p,
    body.route-settings .settings-section-header p {
        font-size: 14px;
        font-weight: 400;
        line-height: 1.42;
    }

    body.route-settings .settings-tabs {
        gap: 6px;
        padding: 7px;
    }

    body.route-settings .settings-tabs a {
        min-height: 36px;
        padding: 7px 10px;
        font-size: 13px;
        font-weight: 600;
    }

    body.route-settings .settings-tabs a em {
        min-width: 21px;
        height: 21px;
        font-size: 11px;
        font-weight: 700;
    }

    body.route-settings .settings-table-wrap {
        padding: 0 10px 10px;
    }

    body.route-settings .settings-data-table tbody {
        gap: 10px;
        padding-top: 10px;
    }

    body.route-settings .settings-data-table tbody tr {
        border-radius: 16px;
    }

    body.route-settings .settings-data-table td {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 8px;
        min-height: 38px;
        padding: 8px 10px;
    }

    body.route-settings .settings-data-table td::before {
        font-size: 13px;
        font-weight: 600;
        line-height: 1.2;
    }

    body.route-settings .settings-data-table input,
    body.route-settings .settings-data-table select,
    body.route-settings .settings-data-table textarea,
    body.route-settings .settings-system-field input,
    body.route-settings .settings-system-field select,
    body.route-settings .settings-system-field textarea {
        min-width: 0;
        min-height: 38px;
        border-radius: 12px;
        padding: 7px 9px;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.25;
    }

    body.route-settings .settings-code,
    body.route-settings .settings-zone-code {
        min-height: 27px;
        padding: 4px 8px;
        border-radius: 10px;
        font-size: 12px;
        font-weight: 650;
    }

    body.route-settings .settings-data-table .tiny-input,
    body.route-settings .settings-data-table .short-input {
        max-width: none;
    }

    body.route-settings .settings-status-table .settings-inline-fields-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    body.route-settings .settings-status-table .settings-color-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    body.route-settings .settings-status-table .settings-preview-pill {
        grid-column: 1 / -1;
        justify-content: center;
        min-height: 28px;
        font-size: 12px;
        font-weight: 650;
    }

    body.route-settings .settings-status-table .settings-check-grid-roles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
        row-gap: 7px;
    }

    body.route-settings .settings-data-table .checkline,
    body.route-settings .settings-switch-line {
        gap: 7px;
        font-size: 14px;
        font-weight: 500;
    }

    body.route-settings .settings-data-table input[type="checkbox"],
    body.route-settings .settings-switch-line input[type="checkbox"] {
        width: 18px;
        height: 18px;
        min-height: 18px;
        border-radius: 5px;
    }

    body.route-settings .settings-simple-table tbody tr,
    body.route-settings .settings-parking-table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.route-settings .settings-simple-table td,
    body.route-settings .settings-parking-table td {
        grid-column: 1 / -1;
    }

    body.route-settings .settings-simple-table td:nth-last-child(3),
    body.route-settings .settings-simple-table td:nth-last-child(2) {
        grid-column: auto;
        display: grid;
        grid-template-columns: 1fr;
        align-items: start;
        gap: 6px;
    }

    body.route-settings .settings-parking-table td:nth-child(2),
    body.route-settings .settings-parking-table td:nth-child(3) {
        grid-column: auto;
        display: grid;
        grid-template-columns: 1fr;
        align-items: start;
        gap: 6px;
    }

    body.route-settings .settings-simple-table td:nth-last-child(3)::before,
    body.route-settings .settings-simple-table td:nth-last-child(2)::before,
    body.route-settings .settings-parking-table td:nth-child(2)::before,
    body.route-settings .settings-parking-table td:nth-child(3)::before {
        font-size: 12px;
    }

    body.route-settings .settings-status-table td:last-child,
    body.route-settings .settings-simple-table td:last-child,
    body.route-settings .settings-parking-table td:last-child {
        display: block;
        padding: 10px;
        border-bottom: 0;
    }

    body.route-settings .settings-status-table td:last-child::before,
    body.route-settings .settings-simple-table td:last-child::before,
    body.route-settings .settings-parking-table td:last-child::before {
        content: none;
        display: none;
    }

    body.route-settings .settings-status-table td:last-child .button,
    body.route-settings .settings-simple-table td:last-child .button,
    body.route-settings .settings-parking-table td:last-child .button {
        width: 100%;
        min-height: 40px;
        border-radius: 14px;
        font-size: 14px;
        font-weight: 600;
        white-space: nowrap;
    }

    body.route-settings .settings-system-form {
        padding: 10px;
    }

    body.route-settings .settings-system-grid {
        gap: 10px;
    }

    body.route-settings .settings-system-field {
        gap: 6px;
        border-radius: 14px;
        padding: 10px;
    }

    body.route-settings .settings-system-field span {
        font-size: 14px;
        font-weight: 650;
    }

    body.route-settings .settings-system-field small,
    body.route-settings .settings-system-field small code {
        font-size: 11px;
        font-weight: 500;
    }

    body.route-settings .settings-form-actions {
        padding-top: 10px;
    }
}

/* Service Orders V2 — V107 Settings mobile repair after V106 compact pass */
@media (max-width: 760px) {
    body.route-settings .settings-data-table,
    body.route-settings .settings-data-table thead,
    body.route-settings .settings-data-table tbody,
    body.route-settings .settings-data-table tr,
    body.route-settings .settings-data-table th,
    body.route-settings .settings-data-table td {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    body.route-settings .settings-data-table tbody tr {
        display: block;
        width: 100%;
        border-radius: 16px;
        overflow: hidden;
    }

    body.route-settings .settings-data-table tr > form {
        display: contents;
    }

    body.route-settings .settings-data-table td {
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        width: 100% !important;
        min-height: 46px;
        padding: 10px 12px;
        text-align: left !important;
    }

    body.route-settings .settings-data-table td::before {
        flex: 0 0 92px;
        width: 92px;
        min-width: 92px;
        color: var(--muted);
        font-size: 13px;
        font-weight: 600;
        line-height: 1.2;
    }

    body.route-settings .settings-data-table td > * {
        min-width: 0;
        max-width: 100%;
    }

    body.route-settings .settings-data-table input,
    body.route-settings .settings-data-table select,
    body.route-settings .settings-data-table textarea {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    body.route-settings .settings-data-table .settings-inline-fields,
    body.route-settings .settings-data-table .settings-color-fields,
    body.route-settings .settings-data-table .settings-check-grid {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    body.route-settings .settings-status-table td[data-label="Название"] .settings-inline-fields-2 {
        display: grid;
        grid-template-columns: 1fr;
        gap: 7px;
    }

    body.route-settings .settings-status-table td[data-label="Цвет"] .settings-color-fields {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 7px;
        align-items: center;
    }

    body.route-settings .settings-status-table td[data-label="Цвет"] .settings-preview-pill {
        grid-column: 1 / -1;
        justify-content: center;
        width: 100%;
        min-height: 30px;
    }

    body.route-settings .settings-status-table td[data-label="Доступ"] {
        align-items: flex-start;
    }

    body.route-settings .settings-status-table td[data-label="Доступ"] .settings-check-grid-roles {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 10px;
        row-gap: 8px;
        align-items: center;
        width: 100%;
    }

    body.route-settings .settings-data-table .checkline,
    body.route-settings .settings-switch-line {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        min-width: 0;
        width: 100%;
        overflow: hidden;
        color: var(--text);
        font-size: 13px;
        font-weight: 500;
        line-height: 1.2;
        white-space: nowrap;
    }

    body.route-settings .settings-data-table .checkline input,
    body.route-settings .settings-switch-line input {
        flex: 0 0 auto;
    }

    body.route-settings .settings-code,
    body.route-settings .settings-zone-code {
        flex: 0 1 auto;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.route-settings .settings-simple-table tbody tr,
    body.route-settings .settings-parking-table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0;
    }

    body.route-settings .settings-simple-table td,
    body.route-settings .settings-parking-table td {
        grid-column: 1 / -1;
    }

    body.route-settings .settings-simple-table td[data-label="Порядок"],
    body.route-settings .settings-simple-table td[data-label="Активна"] {
        grid-column: auto;
        display: grid !important;
        grid-template-columns: 1fr;
        align-items: start;
        gap: 6px;
    }

    body.route-settings .settings-simple-table td[data-label="Порядок"]::before,
    body.route-settings .settings-simple-table td[data-label="Активна"]::before {
        width: auto;
        min-width: 0;
        flex: none;
        font-size: 12px;
    }

    body.route-settings .settings-parking-table td[data-label="Базовая ставка"],
    body.route-settings .settings-parking-table td[data-label="Шаг часов"] {
        grid-column: auto;
        display: grid !important;
        grid-template-columns: 1fr;
        align-items: start;
        gap: 6px;
    }

    body.route-settings .settings-parking-table td[data-label="Базовая ставка"]::before,
    body.route-settings .settings-parking-table td[data-label="Шаг часов"]::before {
        width: auto;
        min-width: 0;
        flex: none;
        font-size: 12px;
    }

    body.route-settings .settings-data-table td[data-label="Действие"] {
        display: block !important;
        width: 100% !important;
        padding: 10px 12px 12px;
        border-bottom: 0;
        text-align: left !important;
    }

    body.route-settings .settings-data-table td[data-label="Действие"]::before {
        content: none !important;
        display: none !important;
    }

    body.route-settings .settings-data-table td[data-label="Действие"] .button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-width: 0;
        min-height: 42px;
        border-radius: 14px;
        font-size: 14px;
        font-weight: 600;
        line-height: 1;
        white-space: nowrap;
        text-align: center;
    }

    body.route-settings .settings-data-table td[data-label="Порядок"] .tiny-input,
    body.route-settings .settings-data-table td[data-label="Порядок"] .short-input {
        width: 100%;
        max-width: none;
    }
}

/* V109 multilingual support */
.language-first-login-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
}
.language-first-login-card {
  width: min(520px, 100%);
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .28);
  padding: 22px;
}
.language-first-login-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.25;
}
.language-first-login-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.45;
}
.language-first-login-actions {
  display: grid;
  gap: 10px;
}
.language-first-login-select-form {
  display: flex;
  gap: 10px;
}
.language-first-login-select-form select {
  min-width: 110px;
}
.settings-language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.settings-language-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(127, 127, 127, .04);
}
.settings-language-card.is-default {
  border-color: var(--primary);
}
.settings-language-main {
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-language-main strong {
  font-weight: 600;
}
.settings-language-main em {
  margin-left: auto;
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .06em;
}
.settings-language-sub,
.settings-language-flags {
  color: var(--muted);
  font-size: 12px;
}
.settings-language-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.settings-language-flags small {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 7px;
}
.settings-default-language-field {
  max-width: 420px;
  margin-top: 8px;
}
.settings-language-add {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.settings-language-add h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}
.settings-language-add-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
}
.settings-language-add-form label {
  display: grid;
  gap: 5px;
  font-weight: 400;
}
.settings-language-add-form label span {
  color: var(--muted);
  font-size: 12px;
}
.sms-template-multilang-grid {
  grid-template-columns: 1fr;
}
.sms-template-card-multilang form {
  display: block;
}
.sms-template-language-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.sms-template-language-block {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  background: rgba(127, 127, 127, .035);
}
.sms-template-language-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.sms-template-language-head span {
  font-weight: 600;
}
.sms-template-language-head label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.sms-ai-note {
  display: inline-block;
  color: var(--muted);
  margin-top: 6px;
}
.sms-ai-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
.sms-ai-source {
  min-width: 130px;
  margin: 0;
}
@media (max-width: 760px) {
  .settings-language-add-form {
    grid-template-columns: 1fr 1fr;
  }
  .settings-language-add-form .settings-form-actions {
    grid-column: 1 / -1;
  }
  .language-first-login-select-form {
    display: grid;
  }
  .sms-template-language-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ================================
   V110 orders polish: dashboard widgets + inline columns
   ================================ */
body.so-v50-orders-groups .orders-widget-row {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
}

body.so-v50-orders-groups .orders-widget-card {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}

body.so-v50-orders-groups .orders-widget-card:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
    box-shadow: var(--shadow);
}

body.so-v50-orders-groups .orders-widget-card.is-active {
    border-color: color-mix(in srgb, var(--primary) 48%, var(--border));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 12%, transparent), var(--shadow-soft);
}

body.so-v50-orders-groups .orders-widget-card small {
    font-weight: 750;
}

body.so-v50-orders-groups .orders-modern-table th:nth-child(3),
body.so-v50-orders-groups .orders-modern-table td:nth-child(3) {
    width: 145px;
}

body.so-v50-orders-groups .orders-modern-table th:nth-child(8),
body.so-v50-orders-groups .orders-modern-table td:nth-child(8) {
    width: 135px;
}

body.so-v50-orders-groups .orders-modern-table th:nth-child(9),
body.so-v50-orders-groups .orders-modern-table td:nth-child(9) {
    width: 115px;
}

body.so-v50-orders-groups .orders-inline-select {
    -webkit-appearance: none;
    appearance: none;
    background-image: none !important;
    padding-right: 10px;
}

body.so-v50-orders-groups .orders-inline-status {
    max-width: 145px;
}

body.so-v50-orders-groups .orders-inline-master {
    max-width: 135px;
}

body.so-v50-orders-groups .orders-inline-document {
    max-width: 135px;
}

@media (max-width: 760px) {
    body.so-v50-orders-groups .orders-widget-row {
        grid-template-columns: repeat(3, minmax(142px, 1fr)) !important;
    }
}

/* V117: orders search submit button and reliable search UI */
body.so-v50-orders-groups .orders-top-search {
    grid-template-columns: 42px minmax(0, 1fr) 42px !important;
}

body.so-v50-orders-groups .orders-top-search-submit {
    display: grid !important;
    width: 38px !important;
    height: 38px !important;
    margin-right: 3px !important;
    place-items: center !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: var(--muted) !important;
    cursor: pointer !important;
    transition: background .15s ease, color .15s ease !important;
}

body.so-v50-orders-groups .orders-top-search-submit:hover {
    background: color-mix(in srgb, var(--primary) 10%, transparent) !important;
    color: var(--primary) !important;
}

@media (max-width: 760px) {
    body.so-v50-orders-groups .orders-top-search {
        grid-template-columns: 46px minmax(0, 1fr) 46px !important;
    }

    body.so-v50-orders-groups .orders-top-search-submit {
        width: 42px !important;
        height: 42px !important;
    }
}


/* V118: language is selected on login page only; no repeated modal after session restore. */
.auth-locale-note-v118 {
    display: grid;
    gap: 4px;
    margin: 12px 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--card) 92%, var(--primary) 8%);
    color: var(--text);
}
.auth-locale-note-v118 strong {
    font-size: 14px;
    font-weight: 700;
}
.auth-locale-note-v118 span {
    font-size: 13px;
    line-height: 1.35;
    color: var(--muted);
}

/* V133 — master mobile classic compact UI. Scoped only to master role pages. */
body.so-master-shell {
    --master-blue: #075bbb;
    --master-blue-2: #0b83f6;
    --master-purple: #8b5cf6;
    --master-red: #a9151b;
    --master-green: #16a34a;
    --master-gray: #9ca3af;
    background: #ffffff;
}

body.so-master-shell .master-topbar {
    border-bottom: 1px solid #dbe3ef;
    background: #ffffff;
}

body.so-master-shell .master-page-wrap {
    width: min(100% - 20px, 760px);
    margin: 12px auto 94px;
}

body.so-master-shell .master-classic-page,
body.so-master-shell .master-old-order-page {
    display: grid;
    gap: 10px;
    color: #0f172a;
}

body.so-master-shell .master-classic-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body.so-master-shell .master-classic-head h1 {
    margin: 0;
    color: #000;
    font-size: clamp(30px, 8vw, 44px);
    line-height: 1.02;
    letter-spacing: -0.065em;
}

body.so-master-shell .master-cash-link {
    display: inline-flex;
    margin-left: 8px;
    color: #075bbb;
    font-size: 16px;
    font-weight: 450;
    text-decoration: underline;
}

body.so-master-shell .master-classic-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

body.so-master-shell .master-online-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #0f172a;
    font-size: 12px;
    font-weight: 450;
    white-space: nowrap;
}

body.so-master-shell .master-online-dot i {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: #22c55e;
}

body.so-master-shell .master-gear {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 2px solid #d1d5db;
    border-radius: 15px;
    background: #fff;
    font-size: 25px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}

body.so-master-shell .master-classic-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 8px;
}

body.so-master-shell .master-classic-search input {
    width: 100%;
    min-height: 54px;
    border: 2px solid #cfd7e3;
    border-radius: 12px;
    padding: 0 16px;
    background: #fff;
    color: #111827;
    font-size: 18px;
    font-weight: 450;
    outline: 0;
}

body.so-master-shell .master-classic-search input::placeholder {
    color: #a3a3a3;
}

body.so-master-shell .master-classic-search button,
body.so-master-shell .master-classic-tabs a {
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font-weight: 450;
}

body.so-master-shell .master-classic-tabs {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

body.so-master-shell .master-classic-tabs::-webkit-scrollbar {
    display: none;
}

body.so-master-shell .master-classic-tabs a {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #64748b;
}

body.so-master-shell .master-classic-tabs a.active {
    background: #0b63ce;
    border-color: #0b63ce;
    color: #fff;
}

body.so-master-shell .master-classic-tabs span {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 99px;
    background: rgba(255,255,255,.22);
}

body.so-master-shell .master-classic-empty {
    padding: 28px 14px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: #fff;
    color: #64748b;
    text-align: center;
    font-weight: 450;
}

body.so-master-shell .master-classic-groups,
body.so-master-shell .master-classic-days,
body.so-master-shell .master-classic-order-lines {
    display: grid;
    gap: 8px;
}

body.so-master-shell .master-classic-week,
body.so-master-shell .master-classic-day {
    display: block;
}

body.so-master-shell .master-classic-week > summary,
body.so-master-shell .master-classic-day > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

body.so-master-shell .master-classic-week > summary::-webkit-details-marker,
body.so-master-shell .master-classic-day > summary::-webkit-details-marker {
    display: none;
}

body.so-master-shell .master-classic-week > summary {
    min-height: 58px;
    padding: 0 18px;
    border-radius: 10px;
    background: var(--master-blue);
    color: #fff;
    font-size: 24px;
    font-weight: 450;
    letter-spacing: -0.04em;
}

body.so-master-shell .master-classic-week.is-red > summary {
    background: var(--master-red);
}

body.so-master-shell .master-classic-week.is-purple > summary {
    background: var(--master-purple);
}

body.so-master-shell .master-classic-week.is-gray > summary {
    background: var(--master-gray);
}

body.so-master-shell .master-classic-week > summary::before,
body.so-master-shell .master-classic-day > summary::before {
    content: '▼';
    margin-right: 4px;
    font-size: .72em;
}

body.so-master-shell .master-classic-week:not([open]) > summary::before,
body.so-master-shell .master-classic-day:not([open]) > summary::before {
    content: '▶';
}

body.so-master-shell .master-classic-week > summary span {
    flex: 1;
}

body.so-master-shell .master-classic-week > summary em {
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,.20);
    font-size: 12px;
    font-style: normal;
    white-space: nowrap;
}

body.so-master-shell .master-classic-week[open] > .master-classic-days {
    margin-top: 8px;
}

body.so-master-shell .master-classic-day > summary {
    min-height: 46px;
    padding: 0 14px;
    border-radius: 9px;
    background: var(--master-blue-2);
    color: #fff;
    font-size: 18px;
    font-weight: 450;
}

body.so-master-shell .master-classic-day:not([open]) > summary {
    background: #9b9b9b;
}

body.so-master-shell .master-classic-day[open] > .master-classic-order-lines {
    margin-top: 7px;
}

body.so-master-shell .master-classic-order-line {
    position: relative;
    display: grid;
    grid-template-columns: 18px auto minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    min-height: 58px;
    padding: 8px 11px;
    border-radius: 8px;
    background: #e5e7eb;
    color: #0f172a;
    border-left: 4px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .04);
}

body.so-master-shell .master-classic-order-line:nth-child(odd) {
    background: #f0f5ff;
}

body.so-master-shell .master-classic-order-line.is-approval {
    background: #ede9fe;
    border-left-color: var(--master-purple);
}

body.so-master-shell .master-classic-order-line.is-overdue {
    background: #fee2e2;
    border-left-color: #ef4444;
}

body.so-master-shell .master-line-arrow,
body.so-master-shell .master-line-time,
body.so-master-shell .master-line-main b,
body.so-master-shell .master-line-price {
    font-weight: 450;
}

body.so-master-shell .master-line-time {
    white-space: nowrap;
    color: #0f172a;
}

body.so-master-shell .master-line-main {
    min-width: 0;
    display: grid;
    gap: 2px;
}

body.so-master-shell .master-line-main b,
body.so-master-shell .master-line-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.so-master-shell .master-line-main small {
    color: #475569;
    font-size: 12px;
    font-weight: 450;
}

body.so-master-shell .master-line-badges {
    display: flex;
    align-items: center;
    gap: 4px;
}

body.so-master-shell .master-line-badges i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 23px;
    min-height: 23px;
    border-radius: 999px;
    background: #fff;
    color: #075bbb;
    font-size: 12px;
    font-style: normal;
    font-weight: 450;
}

body.so-master-shell .master-line-status {
    max-width: 140px;
    padding: 5px 8px;
    border-radius: 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    font-size: 12px;
    font-weight: 450;
}

body.so-master-shell .master-line-price {
    white-space: nowrap;
    color: #0f172a;
    font-size: 13px;
}

body.so-master-shell .master-classic-quickbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 2px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

body.so-master-shell .master-classic-quickbar a {
    position: relative;
    display: grid;
    place-items: center;
    gap: 3px;
    min-height: 58px;
    border-right: 1px solid #dbe3ef;
    color: #334155;
    font-size: 12px;
    font-weight: 450;
}

body.so-master-shell .master-classic-quickbar a:last-child {
    border-right: 0;
}

body.so-master-shell .master-classic-quickbar span {
    font-size: 19px;
}

body.so-master-shell .master-classic-quickbar em {
    position: absolute;
    top: 6px;
    right: 12px;
    min-width: 18px;
    padding: 1px 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-style: normal;
    font-size: 11px;
}

body.so-master-shell .master-old-order-head {
    display: grid;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #dbe3ef;
}

body.so-master-shell .master-old-order-head > a {
    color: #64748b;
    font-size: 13px;
    font-weight: 450;
}

body.so-master-shell .master-old-order-head > div {
    display: flex;
    align-items: baseline;
    gap: 9px;
}

body.so-master-shell .master-old-order-head h1 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(24px, 7vw, 34px);
    line-height: 1.08;
    letter-spacing: -0.06em;
}

body.so-master-shell .master-old-order-head strong {
    color: #2563eb;
    font-size: 24px;
    font-weight: 450;
}

body.so-master-shell .master-old-approval-banner {
    padding: 10px 12px;
    border: 1px solid #c4b5fd;
    border-radius: 12px;
    background: #ede9fe;
    color: #5b21b6;
    font-weight: 450;
}

body.so-master-shell .master-old-status-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
}

body.so-master-shell .master-old-status-form label,
body.so-master-shell .master-old-payment-form label,
body.so-master-shell .master-old-work-form label,
body.so-master-shell .master-mobile-form label {
    color: #64748b;
    font-size: 12px;
    font-weight: 450;
}

body.so-master-shell .master-old-status-form select,
body.so-master-shell .master-old-status-form button,
body.so-master-shell .master-mobile-form input,
body.so-master-shell .master-mobile-form select,
body.so-master-shell .master-mobile-form textarea {
    border: 1px solid #dbe3ef;
    border-radius: 11px;
    background: #fff;
    color: #0f172a;
    font-weight: 450;
}

body.so-master-shell .master-old-status-form select {
    min-height: 44px;
    padding: 0 12px;
}

body.so-master-shell .master-old-actions,
body.so-master-shell .master-old-section-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

body.so-master-shell .master-old-actions::-webkit-scrollbar,
body.so-master-shell .master-old-section-tabs::-webkit-scrollbar {
    display: none;
}

body.so-master-shell .master-old-actions a,
body.so-master-shell .master-old-section-tabs a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 37px;
    padding: 0 12px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 450;
}

body.so-master-shell .master-old-section-tabs a:first-child {
    background: #0b63ce;
    border-color: #0b63ce;
    color: #fff;
}

body.so-master-shell .master-old-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .07);
}

body.so-master-shell .master-old-card h2,
body.so-master-shell .master-old-card-title h2 {
    margin: 0;
    color: #0f172a;
    font-size: 19px;
    line-height: 1.12;
    font-weight: 450;
    letter-spacing: -0.04em;
}

body.so-master-shell .master-old-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

body.so-master-shell .master-old-info-list,
body.so-master-shell .master-old-payment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    border: 1px solid #dbe3ef;
    border-radius: 13px;
    background: #fff;
}

body.so-master-shell .master-old-info-list div,
body.so-master-shell .master-old-payment-grid div {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 10px 12px;
    border-right: 1px solid #dbe3ef;
    border-bottom: 1px solid #dbe3ef;
}

body.so-master-shell .master-old-info-list div:nth-child(2n),
body.so-master-shell .master-old-payment-grid div:nth-child(2n) {
    border-right: 0;
}

body.so-master-shell .master-old-info-list div:nth-last-child(-n+2),
body.so-master-shell .master-old-payment-grid div:nth-last-child(-n+2) {
    border-bottom: 0;
}

body.so-master-shell .master-old-info-list dt,
body.so-master-shell .master-old-payment-grid span {
    color: #64748b;
    font-size: 12px;
    font-weight: 450;
}

body.so-master-shell .master-old-info-list dd,
body.so-master-shell .master-old-payment-grid strong {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: #0f172a;
    font-size: 15px;
    font-weight: 450;
}

body.so-master-shell .master-old-note {
    display: grid;
    gap: 5px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 450;
}

body.so-master-shell .master-old-payment-history,
body.so-master-shell .master-old-task-group {
    display: grid;
    gap: 7px;
}

body.so-master-shell .master-old-payment-history div {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid #dbe3ef;
    border-radius: 11px;
}

body.so-master-shell .master-old-payment-history strong {
    color: #0f172a;
    font-weight: 450;
}

body.so-master-shell .master-old-payment-history span,
body.so-master-shell .master-old-muted {
    color: #64748b;
    font-size: 13px;
    font-weight: 450;
}

body.so-master-shell .master-old-payment-form,
body.so-master-shell .master-old-work-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

body.so-master-shell .master-old-payment-form .full-width,
body.so-master-shell .master-old-work-form .full-width,
body.so-master-shell .master-old-payment-form button,
body.so-master-shell .master-old-work-form button {
    grid-column: 1 / -1;
}

body.so-master-shell .master-old-task-lines {
    display: grid;
    border-top: 1px solid #dbe3ef;
}

body.so-master-shell .master-old-task-line {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-height: 42px;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid #dbe3ef;
    background: transparent;
    color: #0f172a;
    text-align: left;
}

body.so-master-shell .master-old-task-line > span {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 2px solid #94a3b8;
    border-radius: 4px;
    color: #2563eb;
    font-weight: 450;
}

body.so-master-shell .master-old-task-line strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 450;
}

body.so-master-shell .master-old-task-line time {
    color: #64748b;
    font-size: 12px;
    font-weight: 450;
    white-space: nowrap;
}

body.so-master-shell .master-old-task-line.is-overdue time {
    color: #ef4444;
}

body.so-master-shell .master-old-media-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

body.so-master-shell .master-old-media-thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #f8fafc;
    padding: 0;
}

body.so-master-shell .master-old-media-thumb img,
body.so-master-shell .master-old-media-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.so-master-shell .master-old-video-thumb,
body.so-master-shell .master-old-file-thumb {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #0f172a;
    font-size: 30px;
}

body.so-master-shell .master-old-upload-form {
    display: grid;
    gap: 8px;
}

body.so-master-shell .master-old-media-modal {
    position: fixed;
    inset: 0;
    z-index: 160;
    display: none;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, .72);
}

body.so-master-shell .master-old-media-modal.is-open {
    display: grid;
}

body.so-master-shell .master-old-media-modal > button {
    position: fixed;
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font-size: 30px;
    line-height: 1;
}

body.so-master-shell .master-old-media-modal [data-media-content] {
    display: grid;
    place-items: center;
    width: min(92vw, 900px);
    height: min(80vh, 720px);
}

body.so-master-shell .master-old-media-modal img,
body.so-master-shell .master-old-media-modal video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 14px;
    background: #000;
}

html[data-theme="dark"] body.so-master-shell {
    background: #0f1115;
}
html[data-theme="dark"] body.so-master-shell .master-topbar,
html[data-theme="dark"] body.so-master-shell .master-old-card,
html[data-theme="dark"] body.so-master-shell .master-classic-search input,
html[data-theme="dark"] body.so-master-shell .master-classic-search button,
html[data-theme="dark"] body.so-master-shell .master-classic-tabs a,
html[data-theme="dark"] body.so-master-shell .master-gear,
html[data-theme="dark"] body.so-master-shell .master-old-actions a,
html[data-theme="dark"] body.so-master-shell .master-old-section-tabs a,
html[data-theme="dark"] body.so-master-shell .master-old-info-list,
html[data-theme="dark"] body.so-master-shell .master-old-payment-grid,
html[data-theme="dark"] body.so-master-shell .master-old-payment-history div {
    background: #17191d;
    border-color: #2a2d33;
    color: #f8fafc;
}
html[data-theme="dark"] body.so-master-shell .master-classic-head h1,
html[data-theme="dark"] body.so-master-shell .master-old-order-head h1,
html[data-theme="dark"] body.so-master-shell .master-old-card h2,
html[data-theme="dark"] body.so-master-shell .master-old-card-title h2,
html[data-theme="dark"] body.so-master-shell .master-old-info-list dd,
html[data-theme="dark"] body.so-master-shell .master-old-payment-grid strong,
html[data-theme="dark"] body.so-master-shell .master-old-task-line,
html[data-theme="dark"] body.so-master-shell .master-line-price,
html[data-theme="dark"] body.so-master-shell .master-line-time {
    color: #f8fafc;
}
html[data-theme="dark"] body.so-master-shell .master-classic-order-line,
html[data-theme="dark"] body.so-master-shell .master-classic-order-line:nth-child(odd) {
    background: #20242b;
    color: #f8fafc;
}
html[data-theme="dark"] body.so-master-shell .master-classic-order-line.is-approval {
    background: #2e214d;
}
html[data-theme="dark"] body.so-master-shell .master-classic-order-line.is-overdue {
    background: #42191d;
}
html[data-theme="dark"] body.so-master-shell .master-line-main small,
html[data-theme="dark"] body.so-master-shell .master-old-info-list dt,
html[data-theme="dark"] body.so-master-shell .master-old-payment-grid span,
html[data-theme="dark"] body.so-master-shell .master-old-muted,
html[data-theme="dark"] body.so-master-shell .master-old-payment-history span {
    color: #a8b3c7;
}
html[data-theme="dark"] body.so-master-shell .master-old-note,
html[data-theme="dark"] body.so-master-shell .master-old-media-thumb {
    background: #20242b;
}

@media (max-width: 760px) {
    body.so-master-shell .master-page-wrap {
        width: min(100% - 18px, 560px) !important;
        margin-top: 10px !important;
        margin-bottom: calc(84px + env(safe-area-inset-bottom)) !important;
    }

    body.so-master-shell .master-classic-page,
    body.so-master-shell .master-old-order-page {
        gap: 9px;
    }

    body.so-master-shell .master-classic-head h1 {
        font-size: 37px;
    }

    body.so-master-shell .master-online-dot {
        display: none;
    }

    body.so-master-shell .master-classic-week > summary {
        min-height: 52px;
        padding: 0 14px;
        font-size: 24px;
    }

    body.so-master-shell .master-classic-day > summary {
        min-height: 43px;
        font-size: 17px;
    }

    body.so-master-shell .master-classic-order-line {
        grid-template-columns: 14px auto minmax(0, 1fr) auto;
        gap: 8px;
        min-height: 56px;
        padding: 8px 9px;
    }

    body.so-master-shell .master-line-status {
        max-width: 104px;
        font-size: 11px;
    }

    body.so-master-shell .master-line-price {
        grid-column: 3 / 5;
        justify-self: end;
        font-size: 12px;
    }

    body.so-master-shell .master-line-badges {
        grid-column: 4;
    }

    body.so-master-shell .master-old-status-form {
        grid-template-columns: 1fr;
    }

    body.so-master-shell .master-old-order-head > div {
        flex-wrap: wrap;
    }

    body.so-master-shell .master-old-info-list,
    body.so-master-shell .master-old-payment-grid,
    body.so-master-shell .master-old-payment-form,
    body.so-master-shell .master-old-work-form {
        grid-template-columns: 1fr;
    }

    body.so-master-shell .master-old-info-list div,
    body.so-master-shell .master-old-payment-grid div {
        border-right: 0 !important;
        border-bottom: 1px solid #dbe3ef !important;
    }

    body.so-master-shell .master-old-info-list div:last-child,
    body.so-master-shell .master-old-payment-grid div:last-child {
        border-bottom: 0 !important;
    }

    body.so-master-shell .master-old-media-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.so-master-shell .master-classic-quickbar {
        position: sticky;
        bottom: calc(64px + env(safe-area-inset-bottom));
        z-index: 12;
    }
}

@media (max-width: 420px) {
    body.so-master-shell .master-classic-head h1 {
        font-size: 33px;
    }

    body.so-master-shell .master-cash-link {
        display: block;
        margin: 4px 0 0;
        font-size: 14px;
    }

    body.so-master-shell .master-gear {
        width: 48px;
        height: 48px;
    }

    body.so-master-shell .master-classic-search {
        grid-template-columns: 1fr;
    }

    body.so-master-shell .master-classic-search button {
        display: none;
    }

    body.so-master-shell .master-classic-order-line {
        grid-template-columns: 14px minmax(0, 1fr) auto;
    }

    body.so-master-shell .master-line-time {
        grid-column: 2;
    }

    body.so-master-shell .master-line-main {
        grid-column: 2 / 4;
    }

    body.so-master-shell .master-line-status {
        grid-column: 3;
        grid-row: 1;
    }

    body.so-master-shell .master-line-badges,
    body.so-master-shell .master-line-price {
        grid-column: 2 / 4;
        justify-self: end;
    }

    body.so-master-shell .master-old-actions a,
    body.so-master-shell .master-old-section-tabs a {
        min-height: 34px;
        padding: 0 10px;
        font-size: 12px;
    }
}


/* V134 — master classic cleanup: master pages only, manager pages are not affected. */
body.so-master-shell {
    --master-page-bg: #f3f6fb;
    --master-card-bg: #ffffff;
    --master-border: #dbe3ef;
    --master-text: #0f172a;
    --master-muted: #64748b;
    background: var(--master-page-bg) !important;
}

body.so-master-shell .master-page-wrap {
    width: min(100% - 20px, 980px) !important;
    margin-top: 12px !important;
}

body.so-master-shell .master-classic-page,
body.so-master-shell .master-old-order-page {
    gap: 8px !important;
    color: var(--master-text) !important;
}

body.so-master-shell .master-old-order-head {
    padding-bottom: 8px !important;
    border-bottom: 1px solid var(--master-border) !important;
}

body.so-master-shell .master-old-order-head h1,
body.so-master-shell .master-old-card h2,
body.so-master-shell .master-old-card-title h2,
body.so-master-shell .master-classic-head h1 {
    font-weight: 760 !important;
    letter-spacing: -0.035em !important;
}

body.so-master-shell .master-old-order-head h1 {
    font-size: clamp(24px, 4vw, 34px) !important;
}

body.so-master-shell .master-old-order-head strong {
    font-size: clamp(22px, 3vw, 30px) !important;
    font-weight: 760 !important;
    color: #2563eb !important;
}

body.so-master-shell .master-old-actions,
body.so-master-shell .master-old-status-form,
body.so-master-shell .master-classic-quickbar {
    display: none !important;
}

body.so-master-shell .master-old-section-tabs {
    gap: 8px !important;
    margin: 2px 0 0 !important;
    padding-bottom: 4px !important;
    border-bottom: 1px solid var(--master-border) !important;
}

body.so-master-shell .master-old-section-tabs a {
    min-height: 34px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    background: var(--master-card-bg) !important;
    border: 1px solid var(--master-border) !important;
    color: var(--master-muted) !important;
    font-weight: 720 !important;
    font-size: 14px !important;
}

body.so-master-shell .master-old-section-tabs a:first-child,
body.so-master-shell .master-old-section-tabs a:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

body.so-master-shell .master-old-card {
    padding: 0 !important;
    border: 1px solid var(--master-border) !important;
    border-radius: 16px !important;
    background: var(--master-card-bg) !important;
    box-shadow: 0 10px 28px rgba(15,23,42,.05) !important;
    overflow: hidden !important;
}

body.so-master-shell .master-old-card > h2,
body.so-master-shell .master-old-card-title {
    min-height: 44px !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--master-border) !important;
}

body.so-master-shell .master-old-card h2,
body.so-master-shell .master-old-card-title h2 {
    margin: 0 !important;
    font-size: 18px !important;
    line-height: 1.15 !important;
}

body.so-master-shell .master-old-info-list,
body.so-master-shell .master-old-payment-grid {
    border: 0 !important;
    border-radius: 0 !important;
}

body.so-master-shell .master-old-info-list div,
body.so-master-shell .master-old-payment-grid div {
    min-height: 60px !important;
    padding: 10px 16px !important;
}

body.so-master-shell .master-old-info-list dt,
body.so-master-shell .master-old-payment-grid span,
body.so-master-shell .master-mobile-form label {
    font-size: 13px !important;
    font-weight: 650 !important;
    color: var(--master-muted) !important;
}

body.so-master-shell .master-old-info-list dd,
body.so-master-shell .master-old-payment-grid strong {
    font-size: 17px !important;
    font-weight: 720 !important;
}

body.so-master-shell .master-old-note {
    margin: 10px 16px 14px !important;
    padding: 12px 14px !important;
    border-radius: 12px !important;
    font-size: 15px !important;
}

body.so-master-shell .master-old-note strong {
    display: block;
    margin-bottom: 5px;
    color: var(--master-muted);
    font-weight: 650;
}

body.so-master-shell .master-old-inline-status-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

body.so-master-shell .master-old-inline-status-form select {
    min-width: 118px;
    max-width: 180px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    padding: 0 34px 0 14px;
    font-size: 13px;
    font-weight: 720;
    outline: 0;
    box-shadow: inset 0 0 0 1px rgba(15,23,42,.08);
}

body.so-master-shell .master-status-save-state {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 450;
}

body.so-master-shell .master-status-save-state[data-mode="success"] { background: #dcfce7; color: #15803d; }
body.so-master-shell .master-status-save-state[data-mode="error"] { background: #fee2e2; color: #b91c1c; }
body.so-master-shell .master-status-save-state[data-mode="loading"] { background: #e0f2fe; color: #0369a1; }

body.so-master-shell .master-old-payment-history {
    padding: 10px 16px 0 !important;
}

body.so-master-shell .master-old-payment-form,
body.so-master-shell .master-old-work-form {
    padding: 12px 16px 16px !important;
}

body.so-master-shell .master-old-payment-form-v134 {
    grid-template-columns: minmax(0, .75fr) minmax(0, 1fr) !important;
    align-items: end;
}

body.so-master-shell .master-old-payment-kind {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

body.so-master-shell .master-old-payment-kind label {
    cursor: pointer;
}

body.so-master-shell .master-old-payment-kind input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

body.so-master-shell .master-old-payment-kind span {
    display: grid;
    place-items: center;
    min-height: 38px;
    border: 1px solid var(--master-border);
    border-radius: 999px;
    background: #fff;
    color: var(--master-text);
    font-size: 15px;
    font-weight: 720;
}

body.so-master-shell .master-old-payment-kind input:checked + span {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

body.so-master-shell .master-mobile-form input,
body.so-master-shell .master-mobile-form select,
body.so-master-shell .master-mobile-form textarea {
    min-height: 42px !important;
    border: 1px solid var(--master-border) !important;
    border-radius: 12px !important;
    padding: 8px 12px !important;
    background: #fff !important;
    color: var(--master-text) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
}

body.so-master-shell .master-mobile-form textarea {
    min-height: 76px !important;
}

body.so-master-shell .master-old-payment-form button,
body.so-master-shell .master-old-work-form button,
body.so-master-shell .button.button-primary.button-wide {
    min-height: 44px !important;
    border-radius: 999px !important;
    font-weight: 720 !important;
}

body.so-master-shell .master-order-ticket-card,
body.so-master-shell #tracking,
body.so-master-shell #media,
body.so-master-shell #signature,
body.so-master-shell #work-notes {
    scroll-margin-top: 80px;
}

body.so-master-shell .master-old-task-group,
body.so-master-shell .master-order-task-actions,
body.so-master-shell .master-old-media-strip,
body.so-master-shell .master-old-upload-form,
body.so-master-shell #tracking > p,
body.so-master-shell #tracking > form,
body.so-master-shell #signature > p,
body.so-master-shell #signature > form,
body.so-master-shell #signature > img {
    margin: 12px 16px !important;
}

body.so-master-shell .master-bottom-nav-v134 {
    grid-template-columns: none !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(76px, 1fr) !important;
    overflow-x: auto !important;
    scrollbar-width: none;
}

body.so-master-shell .master-bottom-nav-v134::-webkit-scrollbar {
    display: none;
}

body.so-master-shell .master-bottom-nav-v134 a {
    min-width: 76px !important;
}

html[data-theme="dark"] body.so-master-shell {
    --master-page-bg: #0f1115;
    --master-card-bg: #17191d;
    --master-border: #2a2d33;
    --master-text: #f8fafc;
    --master-muted: #a8b3c7;
}

html[data-theme="dark"] body.so-master-shell .master-old-card,
html[data-theme="dark"] body.so-master-shell .master-old-section-tabs a,
html[data-theme="dark"] body.so-master-shell .master-old-payment-kind span,
html[data-theme="dark"] body.so-master-shell .master-mobile-form input,
html[data-theme="dark"] body.so-master-shell .master-mobile-form select,
html[data-theme="dark"] body.so-master-shell .master-mobile-form textarea {
    background: var(--master-card-bg) !important;
    border-color: var(--master-border) !important;
    color: var(--master-text) !important;
}

@media (min-width: 900px) {
    body.so-master-shell .master-old-order-page {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    body.so-master-shell .master-old-order-head,
    body.so-master-shell .alert,
    body.so-master-shell .master-old-approval-banner,
    body.so-master-shell .master-mobile-locked,
    body.so-master-shell .master-old-section-tabs,
    body.so-master-shell #payments,
    body.so-master-shell #tickets,
    body.so-master-shell #media,
    body.so-master-shell #signature {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    body.so-master-shell .master-page-wrap {
        width: min(100% - 18px, 560px) !important;
    }

    body.so-master-shell .master-old-card-title {
        align-items: center !important;
    }

    body.so-master-shell .master-old-card h2,
    body.so-master-shell .master-old-card-title h2 {
        font-size: 17px !important;
    }

    body.so-master-shell .master-old-inline-status-form select {
        min-width: 108px;
        max-width: 140px;
        height: 32px;
        font-size: 12px;
    }

    body.so-master-shell .master-old-info-list div,
    body.so-master-shell .master-old-payment-grid div {
        min-height: 52px !important;
        padding: 9px 12px !important;
    }

    body.so-master-shell .master-old-payment-form-v134,
    body.so-master-shell .master-old-work-form {
        grid-template-columns: 1fr !important;
    }

    body.so-master-shell .master-old-section-tabs {
        display: flex !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }

    body.so-master-shell .master-bottom-nav-v134 {
        bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    }
}

/* V135: master mobile order/card/signature compact cleanup */
body.so-master-shell,
body.so-master-shell * {
    font-weight: 400 !important;
}

body.so-master-shell h1,
body.so-master-shell h2,
body.so-master-shell h3,
body.so-master-shell .master-classic-head h1,
body.so-master-shell .master-old-order-head h1,
body.so-master-shell .master-old-card h2,
body.so-master-shell .master-old-card-title h2,
body.so-master-shell .master-classic-week > summary,
body.so-master-shell .master-classic-day > summary {
    font-weight: 600 !important;
    letter-spacing: -0.02em !important;
}

body.so-master-shell strong,
body.so-master-shell b,
body.so-master-shell .master-line-time,
body.so-master-shell .master-line-main b,
body.so-master-shell .master-line-price,
body.so-master-shell .master-line-status,
body.so-master-shell .master-line-badges i,
body.so-master-shell .master-old-info-list dd,
body.so-master-shell .master-old-payment-grid strong,
body.so-master-shell .master-old-payment-kind span,
body.so-master-shell .master-bottom-nav a strong {
    font-weight: 500 !important;
}

body.so-master-shell .master-classic-order-line {
    grid-template-columns: 13px auto minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto !important;
    column-gap: 8px !important;
    row-gap: 4px !important;
    align-items: center !important;
    min-height: 74px !important;
    padding: 8px 10px !important;
}

body.so-master-shell .master-line-arrow {
    grid-column: 1;
    grid-row: 1;
    font-size: 11px !important;
}

body.so-master-shell .master-line-time {
    grid-column: 2;
    grid-row: 1;
    font-size: 16px !important;
    line-height: 1.1 !important;
}

body.so-master-shell .master-line-status {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
    max-width: 112px !important;
    padding: 6px 10px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    line-height: 1.1 !important;
}

body.so-master-shell .master-line-main {
    grid-column: 2 / 4;
    grid-row: 2;
    gap: 1px !important;
    min-width: 0;
}

body.so-master-shell .master-line-main b {
    font-size: 14px !important;
    line-height: 1.18 !important;
}

body.so-master-shell .master-line-main small {
    font-size: 12px !important;
    line-height: 1.15 !important;
    font-weight: 400 !important;
}

body.so-master-shell .master-line-meta {
    grid-column: 4;
    grid-row: 2;
    justify-self: end;
    align-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: max-content;
}

body.so-master-shell .master-line-badges {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

body.so-master-shell .master-line-badges i {
    min-width: 21px !important;
    min-height: 21px !important;
    font-size: 11px !important;
}

body.so-master-shell .master-line-price {
    grid-column: auto !important;
    grid-row: auto !important;
    justify-self: auto !important;
    color: #0f172a !important;
    font-size: 13px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
}

html[data-theme="dark"] body.so-master-shell .master-line-price {
    color: #f8fafc !important;
}

body.so-master-shell .master-bottom-nav-v134 {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    z-index: 90 !important;
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    grid-auto-columns: auto !important;
    gap: 2px !important;
    width: auto !important;
    max-width: 680px !important;
    margin: 0 auto !important;
    padding: 5px !important;
    overflow: visible !important;
    scrollbar-width: none !important;
    border-radius: 18px !important;
}

body.so-master-shell .master-bottom-nav-v134 a {
    flex: initial !important;
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 4px 1px !important;
    border-radius: 13px !important;
    gap: 1px !important;
}

body.so-master-shell .master-bottom-nav-v134 a span {
    font-size: 16px !important;
    line-height: 1 !important;
}

body.so-master-shell .master-bottom-nav-v134 a strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 8.5px !important;
    line-height: 1.1 !important;
}

body.so-master-shell .master-page-wrap {
    margin-bottom: calc(78px + env(safe-area-inset-bottom)) !important;
}

body.so-master-shell .master-signature-preview-wrap {
    margin: 12px 16px !important;
}

body.so-master-shell .master-signature-preview-button {
    display: block;
    width: 100%;
    max-width: 340px;
    padding: 0;
    border: 1px solid var(--master-border, #dbe3ef);
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
    cursor: pointer;
}

body.so-master-shell .master-signature-preview-button img,
body.so-master-shell .master-mobile-signature-preview {
    display: block;
    width: 100%;
    min-height: 82px;
    max-height: 150px;
    object-fit: contain;
    background: #ffffff;
}

body.so-master-shell .master-signature-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 260;
    display: none;
    background: #ffffff;
}

body.so-master-shell .master-signature-fullscreen.is-open {
    display: block;
}

html.master-signature-open,
html.master-signature-open body {
    overflow: hidden !important;
}

body.so-master-shell .master-signature-panel {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100dvh;
    background: #ffffff;
    color: #0f172a;
}

body.so-master-shell .master-signature-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 62px;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    border-bottom: 1px solid #dbe3ef;
    background: #ffffff;
}

body.so-master-shell .master-signature-head > strong {
    font-size: 18px !important;
    line-height: 1.1;
}

body.so-master-shell .master-signature-head > div {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

body.so-master-shell .master-signature-head form {
    display: inline-flex;
}

body.so-master-shell .master-signature-close {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #ffffff;
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
}

body.so-master-shell .master-signature-draw-form {
    flex: 1;
    min-height: 0;
    display: flex;
}

body.so-master-shell .master-signature-canvas {
    flex: 1;
    width: 100%;
    height: calc(100dvh - 64px - env(safe-area-inset-top));
    border: 0;
    border-radius: 0;
    background: #ffffff;
    touch-action: none;
}

body.so-master-shell .master-signature-existing {
    flex: 1;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: #f8fafc;
}

body.so-master-shell .master-signature-existing img {
    max-width: 96vw;
    max-height: calc(100dvh - 110px);
    object-fit: contain;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    background: #ffffff;
}

body.so-master-shell .button-danger {
    border-color: #fecaca !important;
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

html[data-theme="dark"] body.so-master-shell .master-signature-fullscreen,
html[data-theme="dark"] body.so-master-shell .master-signature-panel,
html[data-theme="dark"] body.so-master-shell .master-signature-head,
html[data-theme="dark"] body.so-master-shell .master-signature-close {
    background: #17191d;
    color: #f8fafc;
    border-color: #2a2d33;
}

html[data-theme="dark"] body.so-master-shell .master-signature-existing {
    background: #0f1115;
}

@media (max-width: 760px) {
    body.so-master-shell .master-classic-order-line {
        min-height: 74px !important;
        padding: 8px 9px !important;
    }

    body.so-master-shell .master-line-time {
        font-size: 15px !important;
    }

    body.so-master-shell .master-line-status {
        max-width: 100px !important;
        padding: 6px 9px !important;
        font-size: 12px !important;
    }

    body.so-master-shell .master-line-main b {
        font-size: 14px !important;
    }

    body.so-master-shell .master-line-price {
        font-size: 12px !important;
    }

    body.so-master-shell .master-bottom-nav-v134 {
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
        overflow: visible !important;
    }
}

@media (max-width: 390px) {
    body.so-master-shell .master-bottom-nav-v134 a span {
        font-size: 15px !important;
    }
    body.so-master-shell .master-bottom-nav-v134 a strong {
        font-size: 7.8px !important;
    }
}

/* V136: master mobile header/bottom-nav/list compact fixes. Only master pages. */
body.so-master-shell {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

body.so-master-shell .master-topbar-brand-mobile {
    display: none;
}

body.so-master-shell .master-gear,
body.so-master-shell .master-cash-link {
    display: none !important;
}

body.so-master-shell .master-classic-search input {
    min-height: 46px !important;
    font-size: 16px !important;
    font-weight: 400 !important;
}

body.so-master-shell .master-classic-week > summary {
    min-height: 38px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: -0.01em !important;
}

body.so-master-shell .master-classic-day > summary {
    min-height: 32px !important;
    padding: 0 12px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    letter-spacing: -0.01em !important;
}

body.so-master-shell .master-classic-week > summary em {
    font-size: 9px !important;
    font-weight: 400 !important;
}

body.so-master-shell .master-classic-week[open] > .master-classic-days,
body.so-master-shell .master-classic-day[open] > .master-classic-order-lines {
    margin-top: 6px !important;
}

body.so-master-shell .master-bottom-nav-v134 {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    transform: translateX(-50%) !important;
    z-index: 120 !important;
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    width: min(calc(100vw - 16px), 680px) !important;
    max-width: calc(100vw - 16px) !important;
    margin: 0 !important;
    padding: 5px !important;
    gap: 2px !important;
    overflow: hidden !important;
    border: 1px solid var(--master-border, #dbe3ef) !important;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, .94) !important;
    box-shadow: 0 14px 35px rgba(15, 23, 42, .14) !important;
    backdrop-filter: blur(18px) !important;
    box-sizing: border-box !important;
}

body.so-master-shell .master-bottom-nav-v134 a {
    min-width: 0 !important;
    min-height: 46px !important;
    padding: 4px 1px !important;
    display: grid !important;
    place-items: center !important;
    gap: 2px !important;
    border-radius: 14px !important;
    color: #64748b !important;
    text-decoration: none !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

body.so-master-shell .master-bottom-nav-v134 a span {
    display: grid !important;
    place-items: center !important;
    width: 22px !important;
    height: 22px !important;
    font-size: 0 !important;
    line-height: 1 !important;
}

body.so-master-shell .master-bottom-nav-v134 .app-nav-icon {
    width: 22px !important;
    height: 22px !important;
    stroke-width: 2 !important;
}

body.so-master-shell .master-bottom-nav-v134 a strong {
    display: block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: inherit !important;
    font-size: 8.5px !important;
    line-height: 1.1 !important;
    font-weight: 500 !important;
}

body.so-master-shell .master-bottom-nav-v134 a.active,
body.so-master-shell .master-bottom-nav-v134 a:hover {
    background: #dbeafe !important;
    color: #2563eb !important;
}

html[data-theme="dark"] body.so-master-shell .master-bottom-nav-v134 {
    background: rgba(23, 25, 29, .94) !important;
    border-color: #2a2d33 !important;
}

html[data-theme="dark"] body.so-master-shell .master-bottom-nav-v134 a {
    color: #a8b3c7 !important;
}

html[data-theme="dark"] body.so-master-shell .master-bottom-nav-v134 a.active,
html[data-theme="dark"] body.so-master-shell .master-bottom-nav-v134 a:hover {
    background: #1e3a8a !important;
    color: #ffffff !important;
}

body.so-master-shell .master-page-wrap {
    margin-bottom: calc(78px + env(safe-area-inset-bottom)) !important;
}

@media (max-width: 760px) {
    body.so-master-shell .master-topbar {
        min-height: 60px !important;
        padding: 8px 12px !important;
    }

    body.so-master-shell .master-topbar-brand .brand-mark,
    body.so-master-shell .master-topbar-brand-default {
        display: none !important;
    }

    body.so-master-shell .master-topbar-brand-mobile {
        display: block !important;
        color: #0f172a !important;
        font-size: 19px !important;
        line-height: 1.1 !important;
        font-weight: 500 !important;
        letter-spacing: -0.02em !important;
    }

    body.so-master-shell .master-topbar-brand {
        min-width: 0 !important;
        gap: 0 !important;
    }

    body.so-master-shell .master-topbar-actions {
        gap: 6px !important;
    }

    body.so-master-shell .master-topbar-actions .icon-button,
    body.so-master-shell .master-topbar-actions .lang-form select {
        min-width: 44px !important;
        min-height: 44px !important;
        border-radius: 14px !important;
    }

    body.so-master-shell .master-classic-head {
        display: none !important;
    }

    body.so-master-shell .master-page-wrap {
        width: min(100% - 18px, 560px) !important;
        margin-top: 10px !important;
    }

    body.so-master-shell .master-classic-search {
        grid-template-columns: 1fr !important;
    }

    body.so-master-shell .master-classic-search button {
        display: none !important;
    }

    body.so-master-shell .master-classic-tabs {
        gap: 6px !important;
        overflow-x: auto !important;
        max-width: 100% !important;
    }

    body.so-master-shell .master-classic-tabs a {
        min-height: 34px !important;
        padding: 0 12px !important;
        font-size: 14px !important;
        font-weight: 500 !important;
    }

    body.so-master-shell .master-classic-week > summary {
        min-height: 36px !important;
        font-size: 14px !important;
    }

    body.so-master-shell .master-classic-day > summary {
        min-height: 31px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 420px) {
    body.so-master-shell .master-bottom-nav-v134 {
        width: min(calc(100vw - 10px), 680px) !important;
        max-width: calc(100vw - 10px) !important;
        padding: 4px !important;
        border-radius: 18px !important;
    }

    body.so-master-shell .master-bottom-nav-v134 a {
        min-height: 43px !important;
        border-radius: 12px !important;
    }

    body.so-master-shell .master-bottom-nav-v134 a span,
    body.so-master-shell .master-bottom-nav-v134 .app-nav-icon {
        width: 19px !important;
        height: 19px !important;
    }

    body.so-master-shell .master-bottom-nav-v134 a strong {
        font-size: 7.4px !important;
    }

    body.so-master-shell .master-classic-week > summary {
        font-size: 13px !important;
    }

    body.so-master-shell .master-classic-day > summary {
        font-size: 11px !important;
    }
}


/* V137: master mobile bottom navigation fixed like manager/admin. Master pages only. */
@media (max-width: 900px) {
    html,
    body.so-master-shell {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    body.so-master-shell {
        width: 100% !important;
        min-width: 0 !important;
        padding-bottom: calc(86px + env(safe-area-inset-bottom)) !important;
        overscroll-behavior-x: none !important;
    }

    body.so-master-shell .master-page-wrap {
        width: min(calc(100vw - 18px), 560px) !important;
        max-width: calc(100vw - 18px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        margin-bottom: calc(94px + env(safe-area-inset-bottom)) !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    body.so-master-shell .master-classic-page,
    body.so-master-shell .master-old-order-page,
    body.so-master-shell .master-old-card,
    body.so-master-shell .master-classic-search,
    body.so-master-shell .master-classic-tabs,
    body.so-master-shell .master-classic-groups,
    body.so-master-shell .master-classic-days,
    body.so-master-shell .master-classic-order-lines {
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    body.so-master-shell .master-old-order-page,
    body.so-master-shell .master-classic-page {
        overflow-x: hidden !important;
    }

    body.so-master-shell .master-old-card img,
    body.so-master-shell .master-old-card video,
    body.so-master-shell .master-old-card canvas,
    body.so-master-shell .master-old-card input,
    body.so-master-shell .master-old-card select,
    body.so-master-shell .master-old-card textarea,
    body.so-master-shell .master-old-card button {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    body.so-master-shell .master-bottom-nav-v134 {
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        bottom: calc(8px + env(safe-area-inset-bottom)) !important;
        transform: none !important;
        z-index: 999 !important;
        display: flex !important;
        grid-template-columns: none !important;
        grid-auto-flow: initial !important;
        grid-auto-columns: initial !important;
        align-items: stretch !important;
        gap: 6px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        min-height: 64px !important;
        margin: 0 !important;
        padding: 6px 8px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        overscroll-behavior-x: contain !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-x !important;
        scrollbar-width: none !important;
        border: 1px solid var(--border, #dbe3ef) !important;
        border-radius: 18px !important;
        background: color-mix(in srgb, var(--card, #ffffff) 94%, transparent) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
        backdrop-filter: blur(18px) !important;
        box-sizing: border-box !important;
        contain: layout paint !important;
    }

    body.so-master-shell .master-bottom-nav-v134::-webkit-scrollbar {
        display: none !important;
    }

    body.so-master-shell .master-bottom-nav-v134 a {
        flex: 0 0 78px !important;
        display: grid !important;
        grid-template-rows: 24px auto !important;
        place-items: center !important;
        gap: 3px !important;
        min-width: 78px !important;
        max-width: 78px !important;
        min-height: 54px !important;
        padding: 6px 6px !important;
        border-radius: 15px !important;
        color: var(--muted, #64748b) !important;
        font-size: 11px !important;
        line-height: 1.05 !important;
        text-align: center !important;
        text-decoration: none !important;
        box-sizing: border-box !important;
        scroll-snap-align: start !important;
    }

    body.so-master-shell .master-bottom-nav-v134 a span,
    body.so-master-shell .master-bottom-nav-v134 a svg,
    body.so-master-shell .master-bottom-nav-v134 .app-nav-icon {
        display: grid !important;
        width: 22px !important;
        height: 22px !important;
        place-items: center !important;
        font-size: 0 !important;
        line-height: 1 !important;
        stroke-width: 2 !important;
    }

    body.so-master-shell .master-bottom-nav-v134 a strong {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        color: inherit !important;
        font-size: 11px !important;
        font-weight: 500 !important;
        line-height: 1.05 !important;
        text-align: center !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    body.so-master-shell .master-bottom-nav-v134 a.active,
    body.so-master-shell .master-bottom-nav-v134 a:hover {
        background: var(--primary-soft, #dbeafe) !important;
        color: var(--primary, #2563eb) !important;
    }

    body.so-master-shell .master-bottom-nav-v134::after {
        content: '';
        flex: 0 0 1px;
        min-width: 1px;
    }

    html[data-theme="dark"] body.so-master-shell .master-bottom-nav-v134 {
        background: #1b1b1b !important;
        border-color: #2a2d33 !important;
        box-shadow: none !important;
    }

    html[data-theme="dark"] body.so-master-shell .master-bottom-nav-v134 a {
        color: #a8b3c7 !important;
    }

    html[data-theme="dark"] body.so-master-shell .master-bottom-nav-v134 a.active,
    html[data-theme="dark"] body.so-master-shell .master-bottom-nav-v134 a:hover {
        background: #1e3a8a !important;
        color: #ffffff !important;
    }
}

@media (max-width: 420px) {
    body.so-master-shell .master-bottom-nav-v134 {
        left: 8px !important;
        right: 8px !important;
        max-width: calc(100vw - 16px) !important;
        padding: 6px 7px !important;
        gap: 6px !important;
        border-radius: 18px !important;
    }

    body.so-master-shell .master-bottom-nav-v134 a {
        flex-basis: 76px !important;
        min-width: 76px !important;
        max-width: 76px !important;
        min-height: 54px !important;
    }

    body.so-master-shell .master-bottom-nav-v134 a strong {
        font-size: 10px !important;
    }
}

/* V138: master mobile signature modal and signature action buttons */
body.so-master-shell .master-signature-title-row {
    align-items: center !important;
    gap: 10px !important;
}

body.so-master-shell .master-signature-card-actions {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

body.so-master-shell .master-signature-card-actions form {
    display: inline-flex !important;
    margin: 0 !important;
}

body.so-master-shell .master-signature-card-actions [hidden] {
    display: none !important;
}

body.so-master-shell .master-signature-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 520 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)) !important;
    overflow: hidden !important;
    background: rgba(15, 23, 42, 0.48) !important;
}

body.so-master-shell .master-signature-fullscreen.is-open {
    display: flex !important;
}

body.so-master-shell .master-signature-panel {
    display: flex !important;
    flex-direction: column !important;
    width: 90vw !important;
    height: 90dvh !important;
    max-width: 980px !important;
    max-height: 90dvh !important;
    overflow: hidden !important;
    border: 1px solid var(--master-border, #dbe3ef) !important;
    border-radius: 24px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.26) !important;
}

body.so-master-shell .master-signature-head {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 10px !important;
    flex: 0 0 auto !important;
    min-height: 58px !important;
    padding: 9px 12px !important;
    border-bottom: 1px solid var(--master-border, #dbe3ef) !important;
    background: #ffffff !important;
}

body.so-master-shell .master-signature-head > strong {
    min-width: 0 !important;
    text-align: center !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 16px !important;
    line-height: 1.15 !important;
    font-weight: 600 !important;
}

body.so-master-shell .master-signature-save-top {
    min-height: 40px !important;
    padding: 0 16px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
}

body.so-master-shell .master-signature-close {
    display: inline-grid !important;
    place-items: center !important;
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    border: 1px solid var(--master-border, #dbe3ef) !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 28px !important;
    line-height: 1 !important;
}

body.so-master-shell .master-signature-draw-form {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    display: flex !important;
    overflow: hidden !important;
    margin: 0 !important;
    background: #ffffff !important;
}

body.so-master-shell .master-signature-canvas {
    flex: 1 1 auto !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    touch-action: none !important;
}

html.master-signature-open,
html.master-signature-open body {
    overflow: hidden !important;
    overscroll-behavior: none !important;
}

html[data-theme="dark"] body.so-master-shell .master-signature-fullscreen {
    background: rgba(0, 0, 0, 0.62) !important;
}

html[data-theme="dark"] body.so-master-shell .master-signature-panel,
html[data-theme="dark"] body.so-master-shell .master-signature-head,
html[data-theme="dark"] body.so-master-shell .master-signature-draw-form,
html[data-theme="dark"] body.so-master-shell .master-signature-canvas,
html[data-theme="dark"] body.so-master-shell .master-signature-close {
    background: #17191d !important;
    color: #f8fafc !important;
    border-color: #2a2d33 !important;
}

html[data-theme="dark"] body.so-master-shell .master-signature-canvas {
    background: #ffffff !important;
}

@media (max-width: 760px) {
    body.so-master-shell .master-signature-title-row {
        align-items: flex-start !important;
    }

    body.so-master-shell .master-signature-card-actions {
        gap: 7px !important;
    }

    body.so-master-shell .master-signature-card-actions .button {
        min-height: 38px !important;
        padding: 0 12px !important;
        font-size: 13px !important;
    }

    body.so-master-shell .master-signature-panel {
        width: 90vw !important;
        height: 90dvh !important;
        border-radius: 20px !important;
    }

    body.so-master-shell .master-signature-head {
        min-height: 54px !important;
        padding: 7px 9px !important;
        gap: 7px !important;
    }

    body.so-master-shell .master-signature-head > strong {
        font-size: 14px !important;
    }

    body.so-master-shell .master-signature-save-top {
        min-height: 38px !important;
        padding: 0 12px !important;
        font-size: 13px !important;
    }

    body.so-master-shell .master-signature-close {
        width: 38px !important;
        height: 38px !important;
        font-size: 26px !important;
    }
}

/* V139: fixed master signature modal viewport positioning and save action */
body.so-master-shell .master-signature-fullscreen,
.master-signature-fullscreen[data-signature-modal] {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 9999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)) !important;
    margin: 0 !important;
    overflow: hidden !important;
    transform: none !important;
    background: rgba(15, 23, 42, 0.48) !important;
}

body.so-master-shell .master-signature-fullscreen.is-open,
.master-signature-fullscreen[data-signature-modal].is-open {
    display: flex !important;
}

body.so-master-shell .master-signature-panel,
.master-signature-fullscreen[data-signature-modal] .master-signature-panel {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    width: 90vw !important;
    height: 90vh !important;
    height: 90dvh !important;
    max-width: 980px !important;
    max-height: calc(100vh - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    margin: 0 !important;
    border: 1px solid var(--master-border, #dbe3ef) !important;
    border-radius: 22px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    transform: none !important;
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.26) !important;
}

body.so-master-shell .master-signature-head,
.master-signature-fullscreen[data-signature-modal] .master-signature-head {
    flex: 0 0 auto !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 56px !important;
    box-sizing: border-box !important;
    padding: 8px 10px !important;
    margin: 0 !important;
    border-bottom: 1px solid var(--master-border, #dbe3ef) !important;
    background: #ffffff !important;
}

body.so-master-shell .master-signature-save-top,
.master-signature-fullscreen[data-signature-modal] .master-signature-save-top {
    min-width: 0 !important;
    min-height: 40px !important;
    padding: 0 16px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
    touch-action: manipulation !important;
}

body.so-master-shell .master-signature-head > strong,
.master-signature-fullscreen[data-signature-modal] .master-signature-head > strong {
    min-width: 0 !important;
    overflow: hidden !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 16px !important;
    line-height: 1.15 !important;
    font-weight: 600 !important;
}

body.so-master-shell .master-signature-close,
.master-signature-fullscreen[data-signature-modal] .master-signature-close {
    display: inline-grid !important;
    place-items: center !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border: 1px solid var(--master-border, #dbe3ef) !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 26px !important;
    line-height: 1 !important;
}

body.so-master-shell .master-signature-draw-form,
.master-signature-fullscreen[data-signature-modal] .master-signature-draw-form {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
}

body.so-master-shell .master-signature-canvas,
.master-signature-fullscreen[data-signature-modal] .master-signature-canvas {
    flex: 1 1 auto !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    touch-action: none !important;
}

html.master-signature-open,
html.master-signature-open body {
    overflow: hidden !important;
    overscroll-behavior: none !important;
}

html[data-theme="dark"] body.so-master-shell .master-signature-fullscreen,
html[data-theme="dark"] .master-signature-fullscreen[data-signature-modal] {
    background: rgba(0, 0, 0, 0.62) !important;
}

html[data-theme="dark"] body.so-master-shell .master-signature-panel,
html[data-theme="dark"] body.so-master-shell .master-signature-head,
html[data-theme="dark"] .master-signature-fullscreen[data-signature-modal] .master-signature-panel,
html[data-theme="dark"] .master-signature-fullscreen[data-signature-modal] .master-signature-head {
    background: #17191d !important;
    color: #f8fafc !important;
    border-color: #2a2d33 !important;
}

html[data-theme="dark"] body.so-master-shell .master-signature-draw-form,
html[data-theme="dark"] body.so-master-shell .master-signature-canvas,
html[data-theme="dark"] .master-signature-fullscreen[data-signature-modal] .master-signature-draw-form,
html[data-theme="dark"] .master-signature-fullscreen[data-signature-modal] .master-signature-canvas {
    background: #ffffff !important;
}

html[data-theme="dark"] body.so-master-shell .master-signature-close,
html[data-theme="dark"] .master-signature-fullscreen[data-signature-modal] .master-signature-close {
    background: #17191d !important;
    color: #f8fafc !important;
    border-color: #2a2d33 !important;
}

@media (max-width: 760px) {
    body.so-master-shell .master-signature-panel,
    .master-signature-fullscreen[data-signature-modal] .master-signature-panel {
        width: 90vw !important;
        height: 90vh !important;
        height: 90dvh !important;
        max-height: calc(100vh - 16px) !important;
        max-height: calc(100dvh - 16px) !important;
        border-radius: 20px !important;
    }

    body.so-master-shell .master-signature-head,
    .master-signature-fullscreen[data-signature-modal] .master-signature-head {
        min-height: 52px !important;
        padding: 7px 8px !important;
        gap: 6px !important;
    }

    body.so-master-shell .master-signature-save-top,
    .master-signature-fullscreen[data-signature-modal] .master-signature-save-top {
        min-height: 38px !important;
        padding: 0 12px !important;
        font-size: 13px !important;
    }

    body.so-master-shell .master-signature-head > strong,
    .master-signature-fullscreen[data-signature-modal] .master-signature-head > strong {
        font-size: 14px !important;
    }

    body.so-master-shell .master-signature-close,
    .master-signature-fullscreen[data-signature-modal] .master-signature-close {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        font-size: 25px !important;
    }
}

/* V140: hard fix for master signature modal on mobile visual viewport.
   The modal is moved to document.body by JS, then positioned by visualViewport.
   This prevents the dialog from being shifted by horizontally scrollable parent blocks. */
body.so-master-shell .master-signature-fullscreen,
.master-signature-fullscreen[data-signature-modal] {
    position: fixed !important;
    inset: auto !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: 100vw !important;
    width: 100dvw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 2147483000 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    padding: 10px !important;
    margin: 0 !important;
    overflow: hidden !important;
    transform: none !important;
    translate: none !important;
    background: rgba(15, 23, 42, 0.48) !important;
    overscroll-behavior: contain !important;
    touch-action: none !important;
}

body.so-master-shell .master-signature-fullscreen.is-open,
.master-signature-fullscreen[data-signature-modal].is-open {
    display: flex !important;
}

body.so-master-shell .master-signature-panel,
.master-signature-fullscreen[data-signature-modal] .master-signature-panel {
    position: relative !important;
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    width: min(90vw, calc(100% - 20px)) !important;
    width: min(90dvw, calc(100% - 20px)) !important;
    height: min(90vh, calc(100% - 20px)) !important;
    height: min(90dvh, calc(100% - 20px)) !important;
    max-width: 980px !important;
    max-height: calc(100% - 20px) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    margin: 0 !important;
    border: 1px solid var(--master-border, #dbe3ef) !important;
    border-radius: 22px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    transform: none !important;
    translate: none !important;
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.26) !important;
    touch-action: auto !important;
}

body.so-master-shell .master-signature-head,
.master-signature-fullscreen[data-signature-modal] .master-signature-head {
    flex: 0 0 auto !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 54px !important;
    box-sizing: border-box !important;
    padding: 7px 10px !important;
    margin: 0 !important;
    border-bottom: 1px solid var(--master-border, #dbe3ef) !important;
    background: #ffffff !important;
}

body.so-master-shell .master-signature-save-top,
.master-signature-fullscreen[data-signature-modal] .master-signature-save-top {
    min-width: 0 !important;
    min-height: 38px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
    touch-action: manipulation !important;
}

body.so-master-shell .master-signature-head > strong,
.master-signature-fullscreen[data-signature-modal] .master-signature-head > strong {
    min-width: 0 !important;
    overflow: hidden !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 16px !important;
    line-height: 1.15 !important;
    font-weight: 600 !important;
}

body.so-master-shell .master-signature-close,
.master-signature-fullscreen[data-signature-modal] .master-signature-close {
    display: inline-grid !important;
    place-items: center !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    border: 1px solid var(--master-border, #dbe3ef) !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 25px !important;
    line-height: 1 !important;
}

body.so-master-shell .master-signature-draw-form,
.master-signature-fullscreen[data-signature-modal] .master-signature-draw-form {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    touch-action: none !important;
}

body.so-master-shell .master-signature-canvas,
.master-signature-fullscreen[data-signature-modal] .master-signature-canvas {
    flex: 1 1 auto !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    touch-action: none !important;
}

html.master-signature-open,
html.master-signature-open body {
    overflow: hidden !important;
    overflow-x: hidden !important;
    overscroll-behavior: none !important;
}

html[data-theme="dark"] body.so-master-shell .master-signature-fullscreen,
html[data-theme="dark"] .master-signature-fullscreen[data-signature-modal] {
    background: rgba(0, 0, 0, 0.62) !important;
}

html[data-theme="dark"] body.so-master-shell .master-signature-panel,
html[data-theme="dark"] body.so-master-shell .master-signature-head,
html[data-theme="dark"] .master-signature-fullscreen[data-signature-modal] .master-signature-panel,
html[data-theme="dark"] .master-signature-fullscreen[data-signature-modal] .master-signature-head,
html[data-theme="dark"] body.so-master-shell .master-signature-close,
html[data-theme="dark"] .master-signature-fullscreen[data-signature-modal] .master-signature-close {
    background: #17191d !important;
    color: #f8fafc !important;
    border-color: #2a2d33 !important;
}

html[data-theme="dark"] body.so-master-shell .master-signature-draw-form,
html[data-theme="dark"] body.so-master-shell .master-signature-canvas,
html[data-theme="dark"] .master-signature-fullscreen[data-signature-modal] .master-signature-draw-form,
html[data-theme="dark"] .master-signature-fullscreen[data-signature-modal] .master-signature-canvas {
    background: #ffffff !important;
}

@media (max-width: 760px) {
    body.so-master-shell .master-signature-fullscreen,
    .master-signature-fullscreen[data-signature-modal] {
        padding: 8px !important;
    }

    body.so-master-shell .master-signature-panel,
    .master-signature-fullscreen[data-signature-modal] .master-signature-panel {
        width: calc(100% - 14px) !important;
        height: calc(100% - 14px) !important;
        max-width: calc(100% - 14px) !important;
        max-height: calc(100% - 14px) !important;
        border-radius: 18px !important;
    }

    body.so-master-shell .master-signature-head,
    .master-signature-fullscreen[data-signature-modal] .master-signature-head {
        min-height: 50px !important;
        padding: 6px 8px !important;
        gap: 6px !important;
    }

    body.so-master-shell .master-signature-save-top,
    .master-signature-fullscreen[data-signature-modal] .master-signature-save-top {
        min-height: 36px !important;
        padding: 0 11px !important;
        font-size: 13px !important;
    }

    body.so-master-shell .master-signature-head > strong,
    .master-signature-fullscreen[data-signature-modal] .master-signature-head > strong {
        font-size: 14px !important;
    }

    body.so-master-shell .master-signature-close,
    .master-signature-fullscreen[data-signature-modal] .master-signature-close {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        font-size: 24px !important;
    }
}

/* V141: final hard viewport lock for master signature modal.
   The modal itself is the fixed full-screen overlay.
   The panel is fixed to exactly 90% of the current viewport by JS,
   so it cannot be pushed by page scroll, horizontal scroll, or parent blocks. */
.master-signature-fullscreen[data-signature-modal] {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    transform: none !important;
    translate: none !important;
    background: rgba(15, 23, 42, 0.48) !important;
    touch-action: none !important;
    overscroll-behavior: contain !important;
}

.master-signature-fullscreen[data-signature-modal].is-open {
    display: flex !important;
}

.master-signature-fullscreen[data-signature-modal] .master-signature-panel {
    position: fixed !important;
    width: 90vw !important;
    height: 90vh !important;
    max-width: 90vw !important;
    max-height: 90vh !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    border: 1px solid var(--master-border, #dbe3ef) !important;
    border-radius: 22px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    transform: none !important;
    translate: none !important;
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.26) !important;
    touch-action: auto !important;
}

.master-signature-fullscreen[data-signature-modal] .master-signature-head {
    flex: 0 0 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 7px 10px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border-bottom: 1px solid var(--master-border, #dbe3ef) !important;
    background: #ffffff !important;
}

.master-signature-fullscreen[data-signature-modal] .master-signature-draw-form {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    display: flex !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    background: #ffffff !important;
    touch-action: none !important;
}

.master-signature-fullscreen[data-signature-modal] .master-signature-canvas {
    flex: 1 1 auto !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    touch-action: none !important;
}

html.master-signature-open,
html.master-signature-open body {
    overflow: hidden !important;
    overflow-x: hidden !important;
    overscroll-behavior: none !important;
}

@media (max-width: 760px) {
    .master-signature-fullscreen[data-signature-modal] .master-signature-panel {
        border-radius: 18px !important;
    }

    .master-signature-fullscreen[data-signature-modal] .master-signature-head {
        flex-basis: 50px !important;
        min-height: 50px !important;
        max-height: 50px !important;
        padding: 6px 8px !important;
        gap: 6px !important;
    }
}

/* V144 finance periods */
.settings-grid-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 12px;
    align-items: end;
}

.settings-grid-form label,
.settings-inline-action-form {
    display: grid;
    gap: 6px;
}

.settings-inline-action-form {
    grid-template-columns: minmax(180px, 1fr) auto;
    align-items: center;
}

@media (max-width: 900px) {
    .settings-grid-form,
    .settings-inline-action-form {
        grid-template-columns: 1fr;
    }
}

/* V145: client company/NIP fields and fixed client search route support. */
.client-type-switch,
.hc-client-type-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.client-type-switch label,
.hc-client-type-row label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
}

.client-type-switch input,
.hc-client-type-row input {
    margin: 0;
}

.client-company-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.client-company-fields[hidden],
.hc-client-company-fields[hidden] {
    display: none !important;
}

.hc-client-company-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (max-width: 720px) {
    .client-company-fields {
        grid-template-columns: 1fr;
    }
}

/* V422: reports tables scroll horizontally instead of squeezing text into vertical letters. */
.reports-v99-page .reports-v99-table-wrap {
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.reports-v99-page .reports-v99-table {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
}

.reports-v99-page .reports-v99-table th,
.reports-v99-page .reports-v99-table td {
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none;
}

.reports-v99-page .reports-v99-table th {
    min-width: 92px;
    max-width: 142px;
    white-space: normal;
    line-height: 1.16;
}

.reports-v99-page .reports-v99-table td {
    white-space: nowrap;
}

.reports-v99-page .reports-v99-table th:first-child,
.reports-v99-page .reports-v99-table td:first-child {
    min-width: 124px;
}

.reports-v99-page .reports-v154-salary-table {
    min-width: 1580px;
}

.reports-v99-page .oev162-contractor-table {
    min-width: 1360px;
}

.reports-v99-page .reports-v171-adjustments-table {
    min-width: 820px;
}

@media (max-width: 760px) {
    .reports-v99-page .reports-v99-table-wrap {
        padding-left: 12px;
        padding-right: 12px;
    }

    .reports-v99-page .reports-v99-incasso-history .reports-v99-table-wrap {
        padding-left: 10px;
        padding-right: 10px;
    }

    .reports-v99-page .reports-v99-table th {
        min-width: 84px;
        padding: 10px 12px;
        font-size: 11px;
        line-height: 1.16;
    }

    .reports-v99-page .reports-v99-table td {
        padding: 11px 12px;
        font-size: 13px;
        line-height: 1.25;
    }

    .reports-v99-page .reports-v99-table th:first-child,
    .reports-v99-page .reports-v99-table td:first-child {
        min-width: 118px;
    }
}

/* V414: cash page compact filters, KPI and horizontal table scroll */
body.route-cash .cash-v414-filters {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 0.9fr) minmax(180px, 1fr) auto;
    align-items: end;
    gap: 14px;
}

body.route-cash .cash-v414-filters .filter-actions {
    display: contents;
}

body.route-cash .cash-v414-filters .filter-actions .button {
    min-height: 44px;
    align-self: end;
    white-space: nowrap;
}

body.route-cash .cash-v414-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

body.route-cash .cash-v414-stat-card {
    min-height: 88px;
    padding: 18px 20px;
}

body.route-cash .cash-v414-stat-card .stat-label {
    font-size: 13px;
}

body.route-cash .cash-v414-stat-card strong {
    font-size: clamp(22px, 2vw, 30px);
    line-height: 1.05;
}

body.route-cash .cash-v414-table-scroll {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

body.route-cash .details-card,
body.route-cash .full-width-card,
body.route-cash .cash-table,
body.route-cash .cash-v414-table-scroll {
    min-width: 0;
}

body.route-cash .cash-v414-balance-table {
    width: max-content;
    min-width: 760px;
}

body.route-cash .cash-v414-balance-table th,
body.route-cash .cash-v414-balance-table td,
body.route-cash .cash-v414-detail-table th,
body.route-cash .cash-v414-detail-table td,
body.route-cash .cash-v414-collections-table th,
body.route-cash .cash-v414-collections-table td {
    overflow-wrap: normal;
    word-break: normal;
}

body.route-cash .cash-v414-detail-table {
    width: max-content;
    min-width: 900px;
}

body.route-cash .cash-v414-collections-table {
    width: max-content;
    min-width: 760px;
}

body.route-cash .cash-v413-modal-panel {
    margin-top: 72px;
}

@media (max-width: 900px) {
    body.route-cash .cash-v414-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.route-cash .cash-v414-filters .filter-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    body.route-cash .cash-v416-date-from,
    body.route-cash .cash-v416-date-to,
    body.route-cash .cash-v416-master,
    body.route-cash .cash-v416-method {
        grid-column: auto;
    }

    body.route-cash .cash-v414-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    body.route-cash .cash-v414-stat-total {
        order: 1;
    }

    body.route-cash .cash-v414-stat-orders {
        order: 2;
    }

    body.route-cash .cash-v414-stat-cash {
        order: 3;
    }

    body.route-cash .cash-v414-stat-cardpay {
        order: 4;
    }

    body.route-cash .cash-v414-stat-card {
        min-height: 76px;
        padding: 14px 16px;
    }

    body.route-cash .cash-v414-stat-card .stat-label {
        font-size: 12px;
    }

    body.route-cash .cash-v414-stat-card strong {
        font-size: 22px;
    }

    body.route-cash .cash-v414-table-scroll {
        margin-inline: -12px;
        padding-inline: 12px;
        max-width: calc(100% + 24px);
    }

    body.route-cash .cash-v414-balance-table {
        min-width: 680px;
    }

    body.route-cash .cash-v414-detail-table {
        min-width: 820px;
    }

    body.route-cash .cash-v413-modal-panel,
    body.route-cash .cash-v413-modal-panel-wide {
        margin-top: 64px;
    }
}

@media (max-width: 520px) {
    body.route-cash .cash-v414-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    body.route-cash .cash-v414-filters .filter-actions {
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
    }
}

/* V148: compact client order history table inside client card. */
body.route-clients .hc-client-orders-box-compact,
body[class*="route-clients-"] .clients-mobile-orders-box-compact {
    overflow-x: auto !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    background: var(--card) !important;
    color: var(--text) !important;
}

body.route-clients .hc-client-orders-table,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table {
    width: 100% !important;
    min-width: 0 !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    table-layout: fixed !important;
    background: transparent !important;
    color: var(--text) !important;
}

body.route-clients .hc-client-orders-table th,
body.route-clients .hc-client-orders-table td,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td {
    padding: 11px 10px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    background: transparent !important;
    color: var(--text) !important;
    font-size: 13px !important;
    line-height: 1.22 !important;
    text-align: left !important;
    vertical-align: middle !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

body.route-clients .hc-client-orders-table th,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th {
    color: var(--muted) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    text-transform: uppercase !important;
    letter-spacing: .02em !important;
}

body.route-clients .hc-client-orders-table tr:last-child td,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table tr:last-child td {
    border-bottom: 0 !important;
}

body.route-clients .hc-client-orders-table tbody tr,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table tbody tr {
    cursor: pointer !important;
    transition: background .14s ease !important;
}

body.route-clients .hc-client-orders-table tbody tr:hover,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table tbody tr:hover {
    background: rgba(37, 99, 235, .045) !important;
}

body.route-clients .hc-client-orders-table th:nth-child(1),
body.route-clients .hc-client-orders-table td:nth-child(1),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th:nth-child(1),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td:nth-child(1) {
    width: 22% !important;
}

body.route-clients .hc-client-orders-table th:nth-child(2),
body.route-clients .hc-client-orders-table td:nth-child(2),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th:nth-child(2),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td:nth-child(2) {
    width: 16% !important;
}

body.route-clients .hc-client-orders-table th:nth-child(3),
body.route-clients .hc-client-orders-table td:nth-child(3),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th:nth-child(3),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td:nth-child(3) {
    width: 16% !important;
}

body.route-clients .hc-client-orders-table th:nth-child(4),
body.route-clients .hc-client-orders-table td:nth-child(4),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th:nth-child(4),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td:nth-child(4) {
    width: 18% !important;
}

body.route-clients .hc-client-orders-table th:nth-child(5),
body.route-clients .hc-client-orders-table td:nth-child(5),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th:nth-child(5),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td:nth-child(5) {
    width: 18% !important;
}

body.route-clients .hc-client-orders-table th:nth-child(6),
body.route-clients .hc-client-orders-table td:nth-child(6),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th:nth-child(6),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td:nth-child(6) {
    width: 10% !important;
}

body.route-clients .hc-client-orders-table strong,
body.route-clients .hc-client-orders-table small,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table strong,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table small {
    display: block !important;
}

body.route-clients .hc-client-orders-table strong,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table strong {
    color: var(--text) !important;
    font-size: 13px !important;
    font-weight: 450 !important;
}

body.route-clients .hc-client-orders-table small,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table small {
    margin-top: 3px !important;
    color: var(--muted) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

body.route-clients .hc-client-orders-table em,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table em {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 30px !important;
    max-width: 100% !important;
    padding: 5px 10px !important;
    border-radius: 10px !important;
    background: var(--card-2) !important;
    color: var(--text) !important;
    font-style: normal !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    text-align: center !important;
}

body.route-clients .hc-client-orders-table .hc-client-order-empty td,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table .hc-client-order-empty td {
    color: var(--muted) !important;
    text-align: center !important;
    cursor: default !important;
}

html[data-theme="dark"] body.route-clients .hc-client-orders-box-compact,
html[data-theme="dark"] body[class*="route-clients-"] .clients-mobile-orders-box-compact {
    border-color: #2d2d2d !important;
    background: #1a1a1a !important;
    color: #f4f4f5 !important;
}

html[data-theme="dark"] body.route-clients .hc-client-orders-table th,
html[data-theme="dark"] body.route-clients .hc-client-orders-table td,
html[data-theme="dark"] body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th,
html[data-theme="dark"] body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td {
    border-color: #2a2a2a !important;
}

html[data-theme="dark"] body.route-clients .hc-client-orders-table tbody tr:hover,
html[data-theme="dark"] body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table tbody tr:hover {
    background: #202020 !important;
}

@media (max-width: 560px) {
    body.route-clients .hc-client-orders-table,
    body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table {
        min-width: 560px !important;
    }
}

/* V149: clients additional phones. */
body.route-clients .hc-client-phone-extra,
body.route-clients .clients-mobile-phone small {
    display: block !important;
    margin-top: 3px !important;
    color: var(--muted) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
}

body.route-clients .hc-client-extra-phones {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px 12px !important;
}

body.route-clients .hc-client-extra-phones a {
    color: var(--primary) !important;
    text-decoration: none !important;
}

body.route-clients .hc-client-phones {
    margin: 0 0 20px !important;
}

body.route-clients .hc-client-phones .hc-floating-field {
    margin-bottom: 12px !important;
}

body.route-clients .hc-client-extra-phone-list {
    display: grid !important;
    gap: 12px !important;
}

body.route-clients .hc-phone-field input {
    padding-right: 56px !important;
}

body.route-clients .hc-client-phone-add,
body.route-clients .hc-client-phone-remove {
    position: absolute !important;
    right: 13px !important;
    top: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 2px solid var(--text) !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: var(--text) !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    transform: translateY(-50%) !important;
}

body.route-clients .hc-client-phone-remove {
    border-color: var(--muted) !important;
    color: var(--muted) !important;
    font-size: 20px !important;
}

body.route-clients .hc-client-phone-add:hover,
body.route-clients .hc-client-phone-remove:hover {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}

.client-phone-list {
    display: grid !important;
    gap: 12px !important;
}

.client-phone-list label,
.client-phone-main-field,
.client-phone-extra-field {
    display: grid !important;
    gap: 7px !important;
}

.client-phone-inline {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 44px !important;
    align-items: center !important;
    gap: 8px !important;
}

.client-phone-inline input {
    width: 100% !important;
}

.client-phone-inline .button {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    border-radius: 12px !important;
    font-size: 22px !important;
    font-weight: 450 !important;
    line-height: 1 !important;
}

/* V151: clients edit modal sticky save bar must cover fields below it. */
@media (min-width: 769px) {
    body.route-clients .hc-client-edit-panel {
        isolation: isolate !important;
    }

    body.route-clients .hc-client-edit-actions {
        z-index: 120 !important;
        background: var(--card) !important;
        box-shadow: 0 -14px 28px rgba(15, 23, 42, .08) !important;
    }

    body.route-clients .hc-client-edit-actions .button {
        position: relative !important;
        z-index: 2 !important;
        overflow: hidden !important;
        background: var(--primary) !important;
        color: #fff !important;
    }

    html[data-theme="dark"] body.route-clients .hc-client-edit-actions {
        background: #1a1a1a !important;
        box-shadow: 0 -14px 28px rgba(0, 0, 0, .36) !important;
    }
}


/* V152: client card orders table without order number column. */
body.route-clients .hc-client-orders-table th:nth-child(1),
body.route-clients .hc-client-orders-table td:nth-child(1),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th:nth-child(1),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td:nth-child(1) {
    width: 20% !important;
}

body.route-clients .hc-client-orders-table th:nth-child(2),
body.route-clients .hc-client-orders-table td:nth-child(2),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th:nth-child(2),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td:nth-child(2) {
    width: 18% !important;
}

body.route-clients .hc-client-orders-table th:nth-child(3),
body.route-clients .hc-client-orders-table td:nth-child(3),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th:nth-child(3),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td:nth-child(3) {
    width: 26% !important;
}

body.route-clients .hc-client-orders-table th:nth-child(4),
body.route-clients .hc-client-orders-table td:nth-child(4),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th:nth-child(4),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td:nth-child(4) {
    width: 24% !important;
}

body.route-clients .hc-client-orders-table th:nth-child(5),
body.route-clients .hc-client-orders-table td:nth-child(5),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th:nth-child(5),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td:nth-child(5) {
    width: 12% !important;
}

@media (max-width: 560px) {
    body.route-clients .hc-client-orders-table,
    body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table {
        min-width: 460px !important;
    }
}


/* V153: cleaner client card order table headers and tighter column spacing. */
body.route-clients .hc-client-orders-box-compact,
body[class*="route-clients-"] .clients-mobile-orders-box-compact {
    border-radius: 12px !important;
}

body.route-clients .hc-client-orders-table th,
body.route-clients .hc-client-orders-table td,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td {
    padding-left: 8px !important;
    padding-right: 8px !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

body.route-clients .hc-client-orders-table th,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th {
    font-size: 10px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
}

body.route-clients .hc-client-orders-table .hc-client-order-th-label,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table .hc-client-order-th-label {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 18px !important;
    white-space: nowrap !important;
}

body.route-clients .hc-client-orders-table td,
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td {
    font-size: 12px !important;
}

body.route-clients .hc-client-orders-table th:nth-child(1),
body.route-clients .hc-client-orders-table td:nth-child(1),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th:nth-child(1),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td:nth-child(1) {
    width: 19% !important;
}

body.route-clients .hc-client-orders-table th:nth-child(2),
body.route-clients .hc-client-orders-table td:nth-child(2),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th:nth-child(2),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td:nth-child(2) {
    width: 17% !important;
}

body.route-clients .hc-client-orders-table th:nth-child(3),
body.route-clients .hc-client-orders-table td:nth-child(3),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th:nth-child(3),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td:nth-child(3) {
    width: 25% !important;
}

body.route-clients .hc-client-orders-table th:nth-child(4),
body.route-clients .hc-client-orders-table td:nth-child(4),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th:nth-child(4),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td:nth-child(4) {
    width: 24% !important;
}

body.route-clients .hc-client-orders-table th:nth-child(5),
body.route-clients .hc-client-orders-table td:nth-child(5),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table th:nth-child(5),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td:nth-child(5) {
    width: 15% !important;
    white-space: nowrap !important;
}

body.route-clients .hc-client-orders-table td:nth-child(1),
body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table td:nth-child(1) {
    white-space: nowrap !important;
}

@media (max-width: 560px) {
    body.route-clients .hc-client-orders-table,
    body[class*="route-clients-"] .clients-mobile-orders-box-compact .hc-client-orders-table {
        min-width: 480px !important;
    }
}

/* V157: Settings page tabs like Orders tabs. */
body.route-settings .settings-tabs.settings-main-tabs {
    position: static;
    top: auto;
    z-index: auto;
    display: flex;
    align-items: center;
    gap: 26px;
    overflow-x: auto;
    margin: 0;
    padding: 0 0 10px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    scrollbar-width: none;
}

body.route-settings .settings-tabs.settings-main-tabs::-webkit-scrollbar {
    display: none;
}

body.route-settings .settings-tabs.settings-main-tabs .settings-main-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font-size: 16px;
    font-weight: 760;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: color .16s ease;
}

body.route-settings .settings-tabs.settings-main-tabs .settings-main-tab:hover,
body.route-settings .settings-tabs.settings-main-tabs .settings-main-tab:focus-visible,
body.route-settings .settings-tabs.settings-main-tabs .settings-main-tab.is-active {
    color: var(--primary);
    outline: none;
}

body.route-settings .settings-tabs.settings-main-tabs .settings-main-tab::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -11px;
    height: 3px;
    border-radius: 999px;
    background: transparent;
}

body.route-settings .settings-tabs.settings-main-tabs .settings-main-tab.is-active::after {
    background: var(--primary);
}

body.route-settings .settings-tabs.settings-main-tabs .settings-main-tab em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    font-size: 13px;
    font-style: normal;
    font-weight: 450;
    line-height: 1;
}

body.route-settings .settings-tabs.settings-main-tabs .settings-main-tab:not(.is-active) em {
    background: var(--primary-soft);
    color: var(--primary);
}

body.route-settings .settings-tab-panel[hidden] {
    display: none !important;
}

body.route-settings .settings-tab-panel.is-active {
    display: block;
}

body.route-settings .settings-period-add-form {
    padding: 18px 20px 8px;
}

body.route-settings .settings-periods-table {
    min-width: 860px;
}

@media (max-width: 760px) {
    body.route-settings .settings-tabs.settings-main-tabs {
        gap: 22px;
        padding-bottom: 9px;
    }

    body.route-settings .settings-tabs.settings-main-tabs .settings-main-tab {
        min-height: 40px;
        font-size: 15px;
        font-weight: 720;
    }

    body.route-settings .settings-tabs.settings-main-tabs .settings-main-tab::after {
        bottom: -10px;
    }

    body.route-settings .settings-tabs.settings-main-tabs .settings-main-tab em {
        min-width: 25px;
        height: 25px;
        padding: 0 8px;
        font-size: 12px;
    }

    body.route-settings .settings-period-add-form {
        padding: 12px 10px 4px;
    }
}


/* Service Orders V2 — V158 settings periods/languages polish */
body.route-settings .settings-period-add-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 14px;
    align-items: end;
    padding: 18px 20px 16px;
}

body.route-settings .settings-period-add-form > label,
body.route-settings .settings-language-add-form > label {
    display: grid;
    gap: 6px;
}

body.route-settings .settings-period-add-form > label > span,
body.route-settings .settings-language-add-form > label > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

body.route-settings .settings-period-add-form input,
body.route-settings .settings-period-add-form select,
body.route-settings .settings-language-add-form input,
body.route-settings .settings-language-add-form select,
body.route-settings .settings-default-language-field select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    background: var(--input);
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

body.route-settings .settings-period-add-form input:focus,
body.route-settings .settings-period-add-form select:focus,
body.route-settings .settings-language-add-form input:focus,
body.route-settings .settings-language-add-form select:focus,
body.route-settings .settings-default-language-field select:focus {
    border-color: color-mix(in srgb, var(--primary) 70%, var(--border));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-soft) 62%, transparent);
}

body.route-settings .settings-period-add-form > .button {
    min-height: 44px;
    padding-inline: 18px;
    border-radius: 14px;
    white-space: nowrap;
}

body.route-settings .settings-periods-table {
    min-width: 900px;
}

body.route-settings .settings-periods-table td[data-label="Статус"] .status-pill {
    min-height: 28px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 450;
}

body.route-settings .settings-inline-action-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

body.route-settings .settings-inline-action-form input {
    min-width: 180px;
}

body.route-settings .settings-language-form {
    padding: 18px 20px 0;
}

body.route-settings .settings-language-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

body.route-settings .settings-language-card {
    gap: 8px;
    padding: 14px 15px;
    border-radius: 18px;
    background: var(--card);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .02);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}

body.route-settings .settings-language-card:hover {
    border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
    box-shadow: 0 12px 24px rgba(15, 23, 42, .05);
    transform: translateY(-1px);
}

body.route-settings .settings-language-card.is-default {
    border-color: color-mix(in srgb, var(--primary) 75%, white 25%);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-soft) 52%, transparent);
}

body.route-settings .settings-language-main {
    align-items: flex-start;
    gap: 10px;
}

body.route-settings .settings-language-main input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    margin-top: 2px;
    accent-color: var(--primary);
}

body.route-settings .settings-language-main strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 450;
    line-height: 1.2;
}

body.route-settings .settings-language-main em {
    font-size: 12px;
    font-weight: 450;
    letter-spacing: .08em;
}

body.route-settings .settings-language-sub {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

body.route-settings .settings-language-flags {
    gap: 7px;
}

body.route-settings .settings-language-flags small {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--card-2);
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    line-height: 1;
}

body.route-settings .settings-default-language-field {
    max-width: 430px;
    margin-top: 0;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card-2);
}

body.route-settings .settings-default-language-field span {
    font-size: 15px;
}

body.route-settings .settings-form-actions {
    padding-top: 14px;
}

body.route-settings .settings-form-actions .button {
    min-height: 44px;
    border-radius: 16px;
    padding-inline: 18px;
}

body.route-settings .settings-language-add {
    margin-top: 18px;
    padding: 18px 20px 20px;
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--card-2) 52%, transparent);
}

body.route-settings .settings-language-add h3 {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 24px;
    line-height: 1.08;
    letter-spacing: -0.03em;
    font-weight: 450;
}

body.route-settings .settings-language-add-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 12px;
    align-items: end;
}

body.route-settings .settings-language-add-form > .settings-switch-line {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    font-size: 13px;
    font-weight: 700;
}

body.route-settings .settings-language-add-form > .settings-switch-line input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    accent-color: var(--primary);
}

body.route-settings .settings-language-add-form .settings-form-actions {
    padding-top: 0;
    justify-content: flex-end;
}

body.route-settings .settings-language-add-form .settings-form-actions .button {
    width: auto;
    min-width: 180px;
}

body.route-settings .settings-periods-table tbody tr td[colspan="6"] {
    color: var(--muted);
    text-align: center;
    font-weight: 700;
    padding-block: 18px;
}

html[data-theme="dark"] body.route-settings .settings-language-card,
html[data-theme="dark"] body.route-settings .settings-default-language-field,
html[data-theme="dark"] body.route-settings .settings-language-add,
html[data-theme="dark"] body.route-settings .settings-language-add-form > .settings-switch-line {
    background: #1f1f1f;
    border-color: #2f2f2f;
}

html[data-theme="dark"] body.route-settings .settings-language-card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, .22);
}

html[data-theme="dark"] body.route-settings .settings-language-flags small {
    background: #252525;
    border-color: #343434;
}

@media (max-width: 1180px) {
    body.route-settings .settings-period-add-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.route-settings .settings-period-add-form > .button {
        grid-column: 1 / -1;
    }

    body.route-settings .settings-language-add-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.route-settings .settings-language-add-form .settings-form-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    body.route-settings .settings-period-add-form,
    body.route-settings .settings-language-form {
        padding: 12px;
    }

    body.route-settings .settings-period-add-form {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    body.route-settings .settings-period-add-form > .button {
        grid-column: auto;
        width: 100%;
    }

    body.route-settings .settings-inline-action-form {
        display: grid;
        gap: 8px;
    }

    body.route-settings .settings-inline-action-form input {
        min-width: 0;
        width: 100%;
    }

    body.route-settings .settings-language-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 14px;
    }

    body.route-settings .settings-language-card {
        padding: 12px;
        border-radius: 16px;
        transform: none;
    }

    body.route-settings .settings-default-language-field {
        max-width: none;
        padding: 12px;
        border-radius: 16px;
    }

    body.route-settings .settings-language-add {
        padding: 16px 12px;
    }

    body.route-settings .settings-language-add h3 {
        font-size: 20px;
    }

    body.route-settings .settings-language-add-form {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    body.route-settings .settings-language-add-form > .settings-switch-line {
        min-height: 42px;
        padding: 0 12px;
    }

    body.route-settings .settings-language-add-form .settings-form-actions {
        justify-content: stretch;
    }

    body.route-settings .settings-language-add-form .settings-form-actions .button {
        width: 100%;
        min-width: 0;
    }
}

/* ================================
   V160: no-visit manager review
   ================================ */
@keyframes ordersReviewBlink {
  0%, 100% {
    background-color: rgba(254, 226, 226, 0.72);
    box-shadow: inset 4px 0 0 rgba(220, 38, 38, 0.95);
  }
  50% {
    background-color: rgba(254, 202, 202, 0.96);
    box-shadow: inset 4px 0 0 rgba(185, 28, 28, 1);
  }
}

.orders-row-review {
  animation: ordersReviewBlink 1.45s ease-in-out infinite;
}

.orders-row-review td {
  background: transparent !important;
}

.orders-review-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin-top: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(254, 226, 226, 0.98);
  color: #b91c1c;
  font-size: 12px;
  font-weight: 450;
  line-height: 1.15;
  white-space: nowrap;
}

.mobile-legacy-order-review {
  animation: ordersReviewBlink 1.45s ease-in-out infinite;
  border-color: rgba(220, 38, 38, 0.45) !important;
}

.oev72-review-alert {
  margin: 10px 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(220, 38, 38, 0.24);
  border-radius: 16px;
  background: rgba(254, 226, 226, 0.82);
  color: #991b1b;
  font-weight: 450;
}

.oev72-review-alert label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  font-weight: 450;
  color: #7f1d1d;
}

.oev72-review-alert input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.oev72-parking-no-visit {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 16px;
  background: rgba(239, 246, 255, 0.74);
  color: var(--text);
  font-weight: 450;
}

.oev72-parking-no-visit input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  flex: 0 0 auto;
}

.oev72-parking-no-visit small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.oev72-parking-visits.is-disabled {
  opacity: 0.52;
  pointer-events: none;
}

.master-no-visit-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 16px;
  background: rgba(239, 246, 255, 0.74);
  color: var(--text);
}

.master-no-visit-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  flex: 0 0 auto;
}

.master-no-visit-check strong {
  display: block;
  font-weight: 450;
}

.master-no-visit-check small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.master-old-approval-banner.is-danger {
  border-color: rgba(220, 38, 38, 0.28);
  background: rgba(254, 226, 226, 0.92);
  color: #991b1b;
}

/* ================================
   V161: manager review blinking at 0.5Hz + generic review reason
   ================================ */
@keyframes ordersReviewBlinkV161 {
    0%, 100% {
        background-color: rgba(254, 226, 226, 0.60);
        box-shadow: inset 5px 0 0 rgba(220, 38, 38, 0.82);
    }
    50% {
        background-color: rgba(248, 113, 113, 0.46);
        box-shadow: inset 5px 0 0 rgba(185, 28, 28, 1), 0 0 0 3px rgba(220, 38, 38, 0.08);
    }
}

.orders-row-review,
.mobile-legacy-order-review,
body.route-orders .orders-group-danger > .orders-group-summary {
    animation: ordersReviewBlinkV161 2s ease-in-out infinite !important;
}

.oev72-review-alert {
    animation: ordersReviewBlinkV161 2s ease-in-out infinite !important;
}

.oev72-review-reason {
    margin: 8px 0 0;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .62);
    color: #7f1d1d;
    font-weight: 450;
}

html[data-theme="dark"] .oev72-review-reason {
    background: rgba(0, 0, 0, .22);
    color: #fecaca;
}


/* V171 subcontractors and master adjustments */
.oev162-contractor-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border, #d8e1ef);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.8);
    font-size: 13px;
}
.oev162-contractor-summary span {
    color: var(--muted, #64748b);
}
.oev162-contractor-summary strong {
    display: block;
    color: var(--text, #0f172a);
}
.contractor-v171-page .reports-v99-hero.compact,
.master-adjustments-v171-page .reports-v99-hero.compact {
    margin-bottom: 14px;
}
@media (max-width: 720px) {
    .oev162-contractor-summary {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* V172 order editor compact header and contractor fixes */
.oev162-contractor-note {
    margin: 8px 0 0;
    color: var(--muted, #64748b);
    font-size: 12px;
    font-weight: 450;
    line-height: 1.35;
}
.order-editor-v61-page .oev61-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
    margin-bottom: 10px;
}
.order-editor-v61-page .oev61-title-row {
    flex-wrap: nowrap;
    gap: 10px;
}
.order-editor-v61-page .oev61-title {
    font-size: clamp(24px, 2.1vw, 34px);
    letter-spacing: -0.045em;
}
.order-editor-v61-page .oev61-price {
    font-size: clamp(24px, 2.1vw, 34px);
}
.order-editor-v61-page .oev61-actions {
    flex-wrap: nowrap;
}
.order-editor-v61-page .oev61-sticky-save {
    display: none;
}
.order-editor-v61-page .oev72-parking-visit-row {
    grid-template-columns: 120px minmax(0, 1.35fr) minmax(0, 1fr) 56px;
}
.order-editor-v61-page .oev72-visit-num {
    align-content: center;
    justify-items: start;
    min-width: 0;
    padding-left: 18px;
}
.order-editor-v61-page .oev72-visit-num span {
    display: block;
    white-space: nowrap;
    background: transparent !important;
}
@media (max-width: 760px) {
    .order-editor-v61-page .oev61-sticky-save {
        display: flex;
    }
    .order-editor-v61-page .oev72-parking-visit-row {
        grid-template-columns: 72px 1fr 1fr;
    }
    .order-editor-v61-page .oev72-visit-num {
        padding-left: 10px;
    }
}

/* V174: collapsible desktop sidebar for admin/manager */
@media (min-width: 901px) {
    .sidebar-brand-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 0 8px 24px;
    }

    .sidebar-brand-row .sidebar-brand {
        min-width: 0;
        padding: 0;
    }

    .sidebar-brand-row .sidebar-brand span:last-child,
    .sidebar-nav a strong,
    .sidebar-user > div {
        transition: opacity .16s ease, width .16s ease, transform .16s ease;
    }

    .sidebar-collapse-toggle {
        flex: 0 0 auto;
        width: 28px;
        height: 28px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--card);
        color: var(--muted);
        font-size: 20px;
        font-weight: 450;
        line-height: 1;
        cursor: pointer;
    }

    .sidebar-collapse-toggle:hover {
        color: var(--primary);
        border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
        background: var(--primary-soft);
    }

    html[data-sidebar="collapsed"] .desktop-shell {
        grid-template-columns: 68px minmax(0, 1fr) !important;
    }

    html[data-sidebar="collapsed"] .sidebar {
        width: 68px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        overflow: hidden;
    }

    html[data-sidebar="collapsed"] .sidebar-brand-row {
        display: grid;
        justify-items: center;
        gap: 10px;
        padding-left: 0;
        padding-right: 0;
    }

    html[data-sidebar="collapsed"] .sidebar-brand-row .sidebar-brand {
        justify-content: center;
    }

    html[data-sidebar="collapsed"] .sidebar-brand-row .sidebar-brand span:last-child,
    html[data-sidebar="collapsed"] .sidebar-nav a strong,
    html[data-sidebar="collapsed"] .sidebar-user > div {
        width: 0 !important;
        max-width: 0 !important;
        opacity: 0 !important;
        overflow: hidden !important;
        white-space: nowrap !important;
        transform: translateX(-6px);
    }

    html[data-sidebar="collapsed"] .sidebar-nav a {
        justify-content: center !important;
        gap: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    html[data-sidebar="collapsed"] .sidebar-nav a span,
    html[data-sidebar="collapsed"] .nav-icon-wrap {
        width: 22px !important;
        margin: 0 !important;
    }

    html[data-sidebar="collapsed"] .sidebar-user {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    html[data-sidebar="collapsed"] .sidebar-avatar {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 900px) {
    .sidebar-collapse-toggle {
        display: none !important;
    }
}


/* V175: order editor spacing with collapsed sidebar */
@media (min-width: 901px) {
    html[data-sidebar="collapsed"] body[class*="route-orders-"] .desktop-content {
        width: min(100% - 16px, 1680px) !important;
        max-width: none !important;
        margin: 8px 0 32px 8px !important;
    }
}


/* V178: on mobile order edit page, remove the extra layout top bar robustly.
   Theme switcher is inside the fixed order header in orders/edit.php. */
@media (max-width: 900px) {
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .sidebar,
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .desktop-topbar,
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .mobile-brand-row,
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .mobile-shell-actions,
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .mobile-page-tabs {
        display: none !important;
    }

    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .desktop-shell {
        display: block !important;
        grid-template-columns: minmax(0, 1fr) !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .desktop-main,
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .desktop-content,
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .page {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding-top: 0 !important;
    }
}


/* V180: on mobile order edit page, the order header inside the editor is the only top header */
@media (max-width: 900px) {
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .desktop-shell > .sidebar,
    body.so-app:has(.oev112-page):not(.so-master-shell):not(.so-auth-shell) .desktop-shell > .sidebar {
        display: none !important;
    }

    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .desktop-shell,
    body.so-app:has(.oev112-page):not(.so-master-shell):not(.so-auth-shell) .desktop-shell {
        padding-top: 0 !important;
    }
}

/* V184 — parts invoices, VAT proof and closing moderation */
.oev149-approval-panel,
.order-moderation-card {
    margin: 0 0 14px;
    padding: 14px;
    border: 1px solid rgba(245, 158, 11, .35);
    border-radius: 16px;
    background: rgba(254, 243, 199, .7);
    color: #92400e;
}
.oev149-approval-panel.is-muted { border-color: var(--border); background: color-mix(in srgb, var(--card) 94%, transparent); color: var(--text); }
.oev149-approval-panel h2 { margin: 0 0 8px; font-size: 18px; }
.oev149-approval-panel p { margin: 0 0 8px; font-weight: 700; }
.oev149-approval-panel ul { margin: 0 0 10px; padding-left: 20px; }
.oev149-approval-actions { display: grid; gap: 8px; }
.oev149-approval-actions form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.oev149-approval-actions input { min-height: 38px; flex: 1 1 240px; border: 1px solid var(--border); border-radius: 10px; padding: 0 10px; background: var(--input); color: var(--text); }
.oev149-invoice-check {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card) 94%, transparent);
    font-weight: 450;
}
.oev149-invoice-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.oev149-invoice-panel {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--input) 74%, transparent);
}
.oev149-invoice-panel[hidden] { display: none !important; }
.oev149-invoice-panel small { color: var(--muted); font-weight: 760; }
.oev149-parts-invoice-list { display: grid; gap: 7px; padding: 0 0 6px; }
.oev149-part-proof {
    display: grid;
    gap: 4px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: color-mix(in srgb, var(--card) 96%, transparent);
    font-size: 13px;
}
.oev149-part-proof.is-warning { border-color: rgba(245, 158, 11, .35); background: rgba(254, 243, 199, .5); }
.oev149-part-proof a { color: var(--primary); font-weight: 450; }
.order-moderation-page { display: grid; gap: 16px; }
.order-moderation-list { display: grid; gap: 10px; }
.order-moderation-row {
    display: grid;
    grid-template-columns: minmax(180px, .45fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
}
.order-moderation-row div { display: grid; gap: 4px; }
.order-moderation-row span, .order-moderation-row small { color: var(--muted); font-weight: 750; }
.order-moderation-row ul { margin: 0; padding-left: 18px; }
@media (max-width: 760px) {
    .order-moderation-row { grid-template-columns: 1fr; }
    .oev149-approval-actions form { display: grid; }
}

/* V185 live order sync */
.live-sync-toast {
    position: fixed;
    left: max(16px, env(safe-area-inset-left));
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    color: var(--text);
    box-shadow: 0 16px 45px rgba(15, 23, 42, .18);
    font-size: 13px;
    line-height: 1.35;
}

.live-sync-toast.is-visible {
    display: flex;
}

.live-sync-toast button {
    border: 0;
    border-radius: 9px;
    padding: 8px 10px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    white-space: nowrap;
}

@media (min-width: 900px) {
    .live-sync-toast {
        left: auto;
        right: 24px;
        bottom: 24px;
        width: min(520px, calc(100vw - 48px));
    }
}

@media (max-width: 720px) {
    .live-sync-toast {
        bottom: calc(84px + env(safe-area-inset-bottom));
        border-radius: 10px;
        font-size: 12px;
    }

    .live-sync-toast button {
        padding: 7px 9px;
        border-radius: 8px;
    }
}


/* V221 — moderation actions are external forms, keep the same inline layout without nested forms. */
.oev149-approval-actions .oev149-approval-inline-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.oev149-approval-actions .oev149-approval-inline-form input {
    min-height: 38px;
    flex: 1 1 240px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 10px;
    background: var(--input);
    color: var(--text);
}

@media (max-width: 640px) {
    .oev149-approval-actions .oev149-approval-inline-form {
        display: grid;
        grid-template-columns: 1fr;
    }
}

/* V224 — manager order parts invoice layout, thumbnails and gallery */
.oev224-parts-card .oev61-card-head.oev224-parts-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.oev224-parts-head h2 {
    min-width: 0;
}

.oev149-invoice-check.oev224-invoice-check-head {
    flex: 0 1 360px;
    min-width: 260px;
    justify-content: center;
    min-height: 44px;
    padding: 9px 14px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--primary-soft) 42%, var(--card));
}

.oev224-parts-block {
    display: grid;
    gap: 16px;
    padding: 16px;
}

.oev224-parts-editor-grid {
    display: grid;
    grid-template-columns: minmax(170px, 0.78fr) minmax(240px, 1.22fr);
    gap: 14px;
    align-items: stretch;
}

.oev224-parts-editor-grid .oev61-field {
    min-width: 0;
    height: 100%;
}

.oev224-parts-editor-grid input,
.oev224-parts-editor-grid textarea,
.oev224-invoice-panel input {
    width: 100%;
}

.oev224-parts-description-field textarea {
    min-height: 122px;
    resize: vertical;
}

.oev224-parts-proof-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 0;
}

.oev149-part-proof.oev224-part-proof {
    min-width: 0;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
}

.oev224-part-proof-main {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.oev224-part-proof-main span,
.oev224-part-proof-main strong,
.oev224-part-proof-main em {
    min-width: 0;
    overflow-wrap: anywhere;
}

.oev224-invoice-gallery-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 9px;
    align-items: stretch;
}

.oev224-invoice-thumb,
.oev224-invoice-file-card {
    appearance: none;
    display: grid;
    gap: 6px;
    width: 100%;
    min-width: 0;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--card-2);
    color: var(--text);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.oev224-invoice-thumb:hover,
.oev224-invoice-file-card:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--primary) 44%, var(--border));
    box-shadow: 0 10px 22px rgba(15, 23, 42, .09);
}

.oev224-invoice-thumb img,
.oev224-invoice-file-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 9px;
    background: var(--card);
}

.oev224-invoice-thumb span,
.oev224-invoice-file-card span,
.oev224-invoice-number-chip {
    display: block;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.oev224-invoice-panel {
    grid-template-columns: minmax(170px, .8fr) minmax(220px, 1.2fr);
    align-items: end;
}

.oev224-invoice-panel small {
    grid-column: 1 / -1;
}

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

.oev224-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 10080;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 6, 23, .76);
}

.oev224-gallery-dialog {
    width: min(1120px, 96vw);
    height: min(820px, 92vh);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 24px;
    background: #0f172a;
    color: #f8fafc;
    box-shadow: 0 34px 100px rgba(0, 0, 0, .45);
}

.oev224-gallery-head,
.oev224-gallery-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.oev224-gallery-foot {
    border-top: 1px solid rgba(255,255,255,.12);
    border-bottom: 0;
    flex-wrap: wrap;
}

.oev224-gallery-title {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 450;
}

.oev224-gallery-stage {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    display: grid;
    place-items: center;
    padding: 18px;
    overscroll-behavior: contain;
}

.oev224-gallery-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    transition: transform .12s ease;
    border-radius: 12px;
    background: #fff;
}

.oev224-gallery-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.oev224-gallery-actions button,
.oev224-gallery-actions a {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 12px;
    background: rgba(255,255,255,.10);
    color: #f8fafc;
    font-weight: 450;
    text-decoration: none;
    cursor: pointer;
}

.oev224-gallery-actions button:hover,
.oev224-gallery-actions a:hover {
    background: rgba(255,255,255,.18);
}

@media (max-width: 980px) {
    .oev224-parts-editor-grid,
    .oev224-parts-proof-list,
    .oev224-invoice-panel {
        grid-template-columns: 1fr;
    }

    .oev149-invoice-check.oev224-invoice-check-head {
        flex-basis: 100%;
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .oev224-parts-block {
        padding: 12px;
    }

    .oev224-invoice-gallery-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .oev224-gallery-modal {
        padding: 10px;
    }

    .oev224-gallery-dialog {
        width: 100%;
        height: 94vh;
        border-radius: 18px;
    }

    .oev224-gallery-head,
    .oev224-gallery-foot {
        align-items: stretch;
        flex-direction: column;
    }

    .oev224-gallery-actions {
        width: 100%;
    }

    .oev224-gallery-actions button,
    .oev224-gallery-actions a {
        flex: 1 1 auto;
    }
}

/* V225 — manager parts invoice delete buttons, gallery mobile close and proof layout */
.oev224-parts-block {
    grid-template-columns: minmax(170px, .78fr) minmax(240px, 1.22fr);
    align-items: start;
}

.oev224-parts-editor-grid {
    grid-column: 1 / -1;
}

.oev224-parts-proof-list {
    grid-column: 2;
    grid-template-columns: 1fr;
    justify-self: stretch;
    align-self: start;
}

.oev224-invoice-panel {
    grid-column: 1 / -1;
}

.oev224-invoice-tile {
    position: relative;
    min-width: 0;
    display: block;
}

.oev224-invoice-tile .oev224-invoice-thumb,
.oev224-invoice-tile .oev224-invoice-file-card,
.oev224-invoice-tile .oev224-invoice-number-chip {
    height: 100%;
}

.oev224-invoice-delete-button {
    appearance: none;
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 4;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.74);
    border-radius: 999px;
    background: rgba(220, 38, 38, .94);
    color: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .28);
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.oev224-invoice-delete-button:hover {
    transform: translateY(-1px) scale(1.04);
    background: rgba(185, 28, 28, .98);
    box-shadow: 0 10px 22px rgba(15, 23, 42, .34);
}

.oev224-invoice-delete-button:disabled {
    cursor: wait;
    opacity: .62;
    transform: none;
}

.oev224-invoice-delete-button svg {
    display: block;
}

.oev224-gallery-head,
.oev224-gallery-foot {
    position: sticky;
    z-index: 3;
    background: #0f172a;
}

.oev224-gallery-head {
    top: 0;
}

.oev224-gallery-foot {
    bottom: 0;
}

.oev224-gallery-close-button {
    min-width: 96px;
}

@media (max-width: 980px) {
    .oev224-parts-block {
        grid-template-columns: 1fr;
    }

    .oev224-parts-proof-list,
    .oev224-invoice-panel {
        grid-column: 1;
    }
}

@media (max-width: 640px) {
    .oev224-gallery-dialog {
        height: calc(100dvh - 20px);
        max-height: calc(100dvh - 20px);
        grid-template-rows: auto minmax(0, 1fr) auto;
    }

    .oev224-gallery-title {
        white-space: normal;
    }

    .oev224-gallery-stage {
        padding: 10px;
    }

    .oev224-gallery-close-actions {
        width: 100%;
    }

    .oev224-gallery-close-button {
        min-width: 0;
    }

    .oev224-invoice-delete-button {
        width: 32px;
        height: 32px;
        top: 6px;
        right: 6px;
    }
}

/* V226 — manager parts preview stays on the right under Description; AJAX delete updates proof card in place */
.oev224-parts-block {
    grid-template-columns: 1fr;
}

.oev224-parts-editor-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(170px, .78fr) minmax(240px, 1.22fr);
    gap: 14px 16px;
    align-items: start;
}

.oev224-parts-cost-field {
    grid-column: 1;
}

.oev224-parts-description-field {
    grid-column: 2;
}

.oev224-parts-proof-list {
    grid-column: 2;
    width: 100%;
    justify-self: stretch;
    align-self: start;
    grid-template-columns: 1fr;
}

.oev224-part-proof-status {
    display: block;
    min-width: 0;
}

.oev224-part-proof-status strong,
.oev224-part-proof-status em {
    min-width: 0;
    overflow-wrap: anywhere;
}

.oev224-invoice-panel {
    grid-column: 1 / -1;
}

@media (max-width: 980px) {
    .oev224-parts-editor-grid {
        grid-template-columns: 1fr;
    }

    .oev224-parts-cost-field,
    .oev224-parts-description-field,
    .oev224-parts-proof-list,
    .oev224-invoice-panel {
        grid-column: 1;
    }
}

/* V227 — invoice upload panel on the left under Cost; neutral delete icons; dark cost/upload backgrounds */
.oev224-parts-editor-grid {
    align-items: start;
}

.oev224-invoice-panel {
    grid-column: 1;
    width: 100%;
    justify-self: stretch;
    align-self: start;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0;
}

.oev224-invoice-panel .oev61-field {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 0;
}

.oev224-invoice-panel input[type="file"] {
    min-height: 44px;
    padding: 8px 10px;
}

.oev224-invoice-panel small {
    grid-column: 1;
    display: block;
    padding: 0 2px;
    color: var(--muted);
    font-weight: 450;
    line-height: 1.25;
}

.oev224-parts-proof-list {
    grid-column: 2;
}

.oev224-invoice-delete-button {
    border-color: rgba(255, 255, 255, .78);
    background: rgba(226, 232, 240, .94);
    color: #334155;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .22);
}

.oev224-invoice-delete-button:hover {
    background: rgba(203, 213, 225, .98);
    color: #0f172a;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .28);
}

html[data-theme="dark"] .oev224-parts-cost-field,
html[data-theme="dark"] .oev224-invoice-panel .oev61-field {
    background: #0b0b0b !important;
    border-color: #303030 !important;
}

html[data-theme="dark"] .oev224-parts-cost-field input,
html[data-theme="dark"] .oev224-invoice-panel input {
    background: #1B1B1B !important;
    color: var(--text) !important;
    border-color: #303030 !important;
}

html[data-theme="dark"] .oev224-parts-cost-field input:hover,
html[data-theme="dark"] .oev224-parts-cost-field input:focus,
html[data-theme="dark"] .oev224-invoice-panel input:hover,
html[data-theme="dark"] .oev224-invoice-panel input:focus {
    background: #111111 !important;
    border-color: rgba(96, 165, 250, .58) !important;
}

html[data-theme="dark"] .oev224-invoice-panel small {
    color: #b8b8b8;
}

html[data-theme="dark"] .oev224-invoice-delete-button {
    border-color: rgba(255, 255, 255, .55);
    background: rgba(209, 213, 219, .92);
    color: #1f2937;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .34);
}

html[data-theme="dark"] .oev224-invoice-delete-button:hover {
    background: rgba(243, 244, 246, .98);
    color: #111827;
}

@media (max-width: 980px) {
    .oev224-invoice-panel,
    .oev224-parts-proof-list {
        grid-column: 1;
    }
}

/* V228 — restore instant invoice AJAX upload UI and make the dark layer under Cost/Upload truly black */
.oev228-parts-left-column {
    grid-column: 1;
    display: grid;
    gap: 12px;
    min-width: 0;
    align-self: start;
}

.oev228-parts-left-column .oev224-parts-cost-field,
.oev228-parts-left-column .oev224-invoice-panel {
    grid-column: 1;
}

.oev228-invoice-upload-status {
    display: block;
    padding: 9px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 450;
    line-height: 1.25;
    background: color-mix(in srgb, var(--primary-soft) 32%, var(--card));
    color: var(--text);
    border: 1px solid var(--border);
}

.oev228-invoice-upload-status[hidden] {
    display: none !important;
}

.oev228-invoice-upload-status.is-ok {
    background: color-mix(in srgb, #22c55e 18%, var(--card));
    border-color: color-mix(in srgb, #22c55e 38%, var(--border));
}

.oev228-invoice-upload-status.is-error {
    background: color-mix(in srgb, #ef4444 16%, var(--card));
    border-color: color-mix(in srgb, #ef4444 42%, var(--border));
}

.oev228-invoice-upload-status.is-loading {
    background: color-mix(in srgb, var(--primary) 14%, var(--card));
    border-color: color-mix(in srgb, var(--primary) 34%, var(--border));
}

.oev224-invoice-panel.is-uploading {
    opacity: .78;
    pointer-events: none;
}

html[data-theme="dark"] .oev228-parts-left-column {
    background: #1B1B1B !important;
    border: 1px solid #303030 !important;
    border-radius: 18px;
    padding: 12px;
}

html[data-theme="dark"] .oev228-parts-left-column .oev224-parts-cost-field,
html[data-theme="dark"] .oev228-parts-left-column .oev224-invoice-panel .oev61-field {
    background: #1B1B1B !important;
    border-color: #303030 !important;
}

html[data-theme="dark"] .oev228-parts-left-column .oev224-parts-cost-field input,
html[data-theme="dark"] .oev228-parts-left-column .oev224-invoice-panel input {
    background: #000000 !important;
    border-color: #303030 !important;
}

html[data-theme="dark"] .oev228-invoice-upload-status {
    background: #090909 !important;
    border-color: #303030 !important;
    color: #e5e7eb;
}

html[data-theme="dark"] .oev228-invoice-upload-status.is-ok {
    border-color: rgba(34, 197, 94, .46) !important;
}

html[data-theme="dark"] .oev228-invoice-upload-status.is-error {
    border-color: rgba(239, 68, 68, .52) !important;
}

@media (max-width: 980px) {
    .oev228-parts-left-column {
        grid-column: 1;
    }
}

/* V230 — contractor finance summary dark theme #1B1B1B */
html[data-theme="dark"] .oev162-contractor-summary {
    background: #1B1B1B !important;
    border-color: #303030 !important;
    color: #e5e7eb !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .oev162-contractor-summary span {
    color: #b8b8b8 !important;
}

html[data-theme="dark"] .oev162-contractor-summary strong {
    color: #f8fafc !important;
}

html[data-theme="dark"] .oev162-contractor-summary span + span {
    border-left: 1px solid #242424;
    padding-left: 12px;
}

@media (max-width: 720px) {
    html[data-theme="dark"] .oev162-contractor-summary span + span {
        border-left: 0;
        padding-left: 0;
        border-top: 1px solid #242424;
        padding-top: 8px;
    }
}


/* V232 — фактура / документ оплаты услуг и запчастей */
.oev232-payment-document-card {
    border: 1px solid rgba(148, 163, 184, 0.22);
}
.oev232-document-alert {
    display: grid;
    gap: 4px;
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(239, 68, 68, 0.45);
    background: rgba(127, 29, 29, 0.18);
    color: #fecaca;
}
.oev232-document-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.oev232-document-summary > div {
    min-width: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.14);
}
.oev232-document-summary span {
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    color: var(--muted, #94a3b8);
}
.oev232-document-summary strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 13px;
}
.oev232-document-actions,
.oev232-document-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}
.oev232-document-form-grid .full,
.oev232-document-actions .oev232-document-comment,
.oev232-document-actions .oev232-document-sent {
    grid-column: 1 / -1;
}
.oev232-document-note {
    margin: 12px 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted, #94a3b8);
}
.oev232-document-comment,
.oev232-document-email {
    width: 100%;
    border-radius: 12px;
}
.oev232-document-sent {
    display: inline-flex;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: #bbf7d0;
    font-size: 12px;
}
body:not(.theme-dark) .oev232-document-alert {
    background: #fef2f2;
    color: #991b1b;
}
body:not(.theme-dark) .oev232-document-summary > div {
    background: #f8fafc;
    border-color: #e5e7eb;
}
body:not(.theme-dark) .oev232-document-sent {
    background: #dcfce7;
    color: #166534;
}
@media (max-width: 720px) {
    .oev232-document-summary,
    .oev232-document-actions,
    .oev232-document-form-grid {
        grid-template-columns: 1fr;
    }
}

/* V233 — согласованная цена netto/brutto + налоговый preview */
.oev233-price-field {
    display: grid;
    gap: 8px;
}
.oev233-price-controls {
    display: grid;
    gap: 7px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(148, 163, 184, 0.08);
}
.oev233-price-controls.is-compact {
    padding: 9px;
}
.oev233-price-controls-title {
    font-size: 11px;
    font-weight: 450;
    color: var(--muted, #94a3b8);
}
.oev233-price-radio,
.oev233-price-vat {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 12px;
    color: var(--text, #e5e7eb);
}
.oev233-price-radio input {
    width: auto;
    min-width: 16px;
    height: 16px;
    margin: 0;
}
.oev233-price-vat input {
    width: 96px;
    min-width: 80px;
}
.oev233-price-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.oev233-price-preview span {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.16);
    font-size: 11px;
    color: var(--muted, #94a3b8);
}
.oev233-price-preview strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--text, #e5e7eb);
    font-size: 12px;
    font-weight: 450;
}
body:not(.theme-dark) .oev233-price-controls,
body:not(.theme-dark) .oev233-price-preview span {
    background: #f8fafc;
    border-color: #e5e7eb;
}
body:not(.theme-dark) .oev233-price-radio,
body:not(.theme-dark) .oev233-price-preview strong {
    color: #111827;
}
@media (max-width: 720px) {
    .oev233-price-preview {
        grid-template-columns: 1fr;
    }
}


/* V234 — компактный выбор netto/brutto в одну строку */
.oev233-price-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: center;
    gap: 8px;
    padding: 8px;
}
.oev233-price-controls.is-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.oev233-price-controls-title {
    grid-column: 1 / -1;
    margin-bottom: -2px;
}
.oev233-price-radio {
    min-height: 36px;
    padding: 7px 9px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.04);
    line-height: 1.15;
}
.oev233-price-radio input[type="radio"] {
    appearance: auto !important;
    -webkit-appearance: radio !important;
    flex: 0 0 18px !important;
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    box-shadow: none !important;
    accent-color: #2563eb;
}
.oev233-price-radio span {
    min-width: 0;
    overflow-wrap: anywhere;
}
.oev233-price-vat {
    min-height: 36px;
    padding: 7px 9px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.04);
}
.oev233-price-vat input {
    width: 72px;
    min-width: 72px;
    height: 30px;
    padding: 5px 8px;
}
body:not(.theme-dark) .oev233-price-radio,
body:not(.theme-dark) .oev233-price-vat {
    background: #ffffff;
    border-color: #e5e7eb;
}
@media (max-width: 520px) {
    .oev233-price-controls,
    .oev233-price-controls.is-compact {
        grid-template-columns: 1fr 1fr;
    }
    .oev233-price-vat {
        grid-column: 1 / -1;
    }
}


/* V235 — исправление compact netto/brutto: без вертикального текста, кнопки в одну строку */
.oev61-field.oev233-price-field {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
    gap: 6px !important;
}
.oev61-field.oev233-price-field > .oev61-label,
.oev61-field.oev233-price-field > input,
.oev61-field.oev233-price-field > .oev233-price-controls,
.oev61-field.oev233-price-field > .oev233-price-preview {
    grid-column: 1 / -1 !important;
}
.oev233-price-controls,
.oev233-price-controls.is-compact {
    display: grid !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 7px !important;
}
.oev233-price-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 92px !important;
}
.oev233-price-controls.is-compact {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
}
.oev233-price-controls-title {
    grid-column: 1 / -1 !important;
    margin: 0 !important;
    font-size: 11px !important;
    line-height: 1.15 !important;
}
.oev233-price-radio {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 32px !important;
    height: 32px !important;
    padding: 5px 8px !important;
    gap: 6px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
}
.oev233-price-radio input[type="radio"] {
    appearance: auto !important;
    -webkit-appearance: radio !important;
    display: inline-block !important;
    flex: 0 0 15px !important;
    width: 15px !important;
    min-width: 15px !important;
    max-width: 15px !important;
    height: 15px !important;
    min-height: 15px !important;
    max-height: 15px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    box-shadow: none !important;
}
.oev233-price-radio span {
    display: inline-block !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    font-size: 12px !important;
    font-weight: 450 !important;
}
.oev233-price-vat {
    display: grid !important;
    grid-template-columns: 32px minmax(0, 1fr) !important;
    align-items: center !important;
    min-width: 0 !important;
    width: 100% !important;
    min-height: 32px !important;
    height: 32px !important;
    padding: 5px 7px !important;
    gap: 5px !important;
}
.oev233-price-vat span {
    font-size: 11px !important;
    font-weight: 450 !important;
    line-height: 1 !important;
}
.oev233-price-vat input {
    width: 100% !important;
    min-width: 0 !important;
    height: 24px !important;
    min-height: 24px !important;
    padding: 3px 6px !important;
    font-size: 12px !important;
}
.oev233-price-preview {
    gap: 6px !important;
}
.oev233-price-preview span {
    padding: 7px 8px !important;
    border-radius: 11px !important;
}
@media (max-width: 520px) {
    .oev233-price-controls {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    }
    .oev233-price-vat {
        grid-column: 1 / -1 !important;
    }
}

/* V236 — invoice appearance editor, report/settings overflow hardening */
.settings-invoice-editor {
    margin: 18px 20px 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: color-mix(in srgb, var(--card-2) 72%, transparent);
    overflow: hidden;
}

.settings-invoice-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.settings-invoice-editor-head h3,
.settings-system-subtitle h3 {
    margin: 0 0 6px;
    font-size: 20px;
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.settings-invoice-editor-head p,
.settings-system-subtitle p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.42;
}

.settings-invoice-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    gap: 18px;
    align-items: start;
    padding: 18px 20px 20px;
    min-width: 0;
}

.settings-invoice-editor-form,
.settings-invoice-editor-grid,
.settings-system-grid,
.settings-system-form,
.settings-system-field,
.settings-panel-card,
.settings-page,
.reports-v99-page,
.reports-v99-layout,
.reports-v99-detail,
.reports-v99-small-panel,
.reports-v99-cash-panel,
.oev61-layout,
.oev61-main,
.oev61-side,
.oev61-card {
    min-width: 0;
}

.settings-invoice-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

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

.settings-invoice-switches {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.settings-invoice-preview {
    position: sticky;
    top: 148px;
    display: grid;
    gap: 12px;
    min-width: 0;
    border: 1px solid color-mix(in srgb, var(--invoice-preview-accent, var(--primary)) 28%, var(--border));
    border-radius: 18px;
    background: var(--card);
    padding: 16px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.settings-invoice-preview-top {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--invoice-preview-accent, var(--primary));
}

.settings-invoice-preview-top img,
.settings-invoice-preview-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    object-fit: contain;
    background: color-mix(in srgb, var(--invoice-preview-accent, var(--primary)) 12%, var(--card));
    border: 1px solid var(--border);
}

.settings-invoice-preview-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--invoice-preview-accent, var(--primary));
    font-size: 14px;
    font-weight: 450;
}

.settings-invoice-preview-top strong,
.settings-invoice-preview-row strong,
.settings-invoice-preview-total {
    display: block;
    color: var(--invoice-preview-secondary, var(--text));
    overflow-wrap: anywhere;
}

.settings-invoice-preview-top small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.settings-invoice-preview-title {
    color: var(--invoice-preview-secondary, var(--text));
    font-size: 18px;
    font-weight: 450;
    letter-spacing: -0.035em;
}

.settings-invoice-preview-row {
    display: grid;
    grid-template-columns: minmax(0, .7fr) minmax(0, 1fr);
    gap: 8px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

.settings-invoice-preview-row span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
}

.settings-invoice-preview-table {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, .65fr));
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    font-size: 12px;
}

.settings-invoice-preview-table > * {
    padding: 8px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow-wrap: anywhere;
}

.settings-invoice-preview-table > *:nth-child(4n) {
    border-right: 0;
}

.settings-invoice-preview-table > *:nth-last-child(-n+4) {
    border-bottom: 0;
}

.settings-invoice-preview-table div {
    background: color-mix(in srgb, var(--invoice-preview-accent, var(--primary)) 10%, var(--card));
    color: var(--muted);
    font-weight: 450;
    text-transform: uppercase;
}

.settings-invoice-preview-total {
    border-radius: 14px;
    background: color-mix(in srgb, var(--invoice-preview-accent, var(--primary)) 10%, var(--card));
    padding: 13px;
    font-size: 16px;
    font-weight: 450;
    text-align: right;
}

.settings-invoice-preview p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.settings-system-subtitle {
    padding: 2px 0 14px;
    grid-column: 1 / -1;
}

.settings-system-groups {
    display: grid;
    gap: 14px;
}

.settings-system-group {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: color-mix(in srgb, var(--card-2) 76%, transparent);
    overflow: hidden;
}

.settings-system-group-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--primary) 5%, transparent);
}

.settings-system-group-head h4 {
    margin: 0 0 4px;
    font-size: 16px;
    line-height: 1.18;
    font-weight: 450;
    color: var(--text);
}

.settings-system-group-head p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.settings-system-group-head em {
    min-width: 34px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 14%, var(--card));
    color: var(--primary);
    padding: 5px 10px;
    font-style: normal;
    font-size: 12px;
    font-weight: 450;
    text-align: center;
}

.settings-system-group .settings-system-grid {
    padding: 14px;
}

.settings-data-table th,
.settings-data-table td,
.reports-v99-table th,
.reports-v99-table td,
.oev61-field,
.oev61-summary-line,
.oev61-summary-line strong,
.oev61-summary-line span {
    overflow-wrap: anywhere;
    word-break: normal;
}

.settings-table-wrap,
.reports-v99-table-wrap,
.table-responsive {
    max-width: 100%;
    min-width: 0;
}

.settings-system-field textarea,
.settings-invoice-editor textarea {
    min-height: 92px;
    resize: vertical;
}

html[data-theme="dark"] .settings-invoice-editor {
    background: #151515;
}

html[data-theme="dark"] .settings-invoice-preview {
    background: #1b1b1b;
}

@media (max-width: 1180px) {
    .settings-invoice-editor-layout {
        grid-template-columns: 1fr;
    }

    .settings-invoice-preview {
        position: relative;
        top: auto;
    }
}

@media (max-width: 760px) {
    .settings-invoice-editor {
        margin: 12px 10px 14px;
        border-radius: 17px;
    }

    .settings-invoice-editor-head,
    .settings-invoice-editor-layout {
        padding-left: 12px;
        padding-right: 12px;
    }

    .settings-invoice-editor-head {
        display: block;
    }

    .settings-invoice-editor-head .button {
        margin-top: 12px;
        width: 100%;
        justify-content: center;
    }

    .settings-invoice-editor-grid,
    .settings-invoice-switches,
    .settings-invoice-preview-row {
        grid-template-columns: 1fr;
    }

    .settings-system-group {
        border-radius: 16px;
    }

    .settings-system-group-head {
        padding: 12px;
    }

    .settings-system-group .settings-system-grid {
        padding: 12px;
    }

    .settings-invoice-preview-table {
        grid-template-columns: minmax(120px, 1.4fr) repeat(3, minmax(72px, .75fr));
        overflow-x: auto;
    }

    .reports-v99-table {
        min-width: 720px;
    }
}

/* V237 — style repair for settings tables and payments mobile overflow */
body.route-settings .settings-table-wrap,
body.route-payments .payments-page-v84,
body.route-payments .payments-topline-v84,
body.route-payments .payments-summary-v84,
body.route-payments .payments-table-card-v84,
body.route-payments .payments-table-wrap-v84 {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

body.route-settings .settings-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-gutter: stable both-edges;
}

body.route-settings .settings-data-table {
    table-layout: fixed;
}

body.route-settings .settings-data-table th,
body.route-settings .settings-data-table td {
    box-sizing: border-box;
}

body.route-settings .settings-status-table {
    min-width: 1120px;
}

body.route-settings .settings-status-table th:nth-child(1),
body.route-settings .settings-status-table td:nth-child(1) {
    width: 14%;
}

body.route-settings .settings-status-table th:nth-child(2),
body.route-settings .settings-status-table td:nth-child(2) {
    width: 17%;
}

body.route-settings .settings-status-table th:nth-child(3),
body.route-settings .settings-status-table td:nth-child(3) {
    width: 24%;
}

body.route-settings .settings-status-table th:nth-child(4),
body.route-settings .settings-status-table td:nth-child(4) {
    width: 18%;
}

body.route-settings .settings-status-table th:nth-child(5),
body.route-settings .settings-status-table td:nth-child(5) {
    width: 8%;
}

body.route-settings .settings-status-table th:nth-child(6),
body.route-settings .settings-status-table td:nth-child(6) {
    width: 8%;
}

body.route-settings .settings-status-table th:nth-child(7),
body.route-settings .settings-status-table td:nth-child(7) {
    width: 132px !important;
    min-width: 132px !important;
    text-align: center !important;
}

body.route-settings .settings-data-table .button,
body.route-settings .settings-data-table td[data-label="Действие"] .button,
body.route-settings .settings-data-table td:last-child .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 112px;
    max-width: 100%;
    min-height: 38px;
    padding: 0 14px;
    box-sizing: border-box;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    writing-mode: horizontal-tb;
}

body.route-settings .settings-data-table th:last-child {
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
}

body.route-settings .settings-color-fields,
body.route-settings .settings-inline-fields,
body.route-settings .settings-check-grid,
body.route-settings .settings-preview-pill,
body.route-settings .settings-code,
body.route-settings .settings-zone-code {
    min-width: 0;
    max-width: 100%;
}

body.route-settings .settings-preview-pill {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.route-payments .payments-page-v84 {
    width: 100%;
    overflow-x: clip;
}

body.route-payments .payments-tabs-v84,
body.route-payments .payments-summary-v84 dl,
body.route-payments .payments-table-v84,
body.route-payments .payments-table-v84 tr,
body.route-payments .payments-table-v84 td,
body.route-payments .payments-table-v84 a {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

body.route-payments .payments-table-v84 a {
    overflow-wrap: anywhere;
    word-break: normal;
}

@media (max-width: 900px) {
    body.route-payments .desktop-content,
    body.route-payments .page {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body.route-payments .payments-topline-v84 {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 12px;
        width: 100%;
        overflow: hidden;
    }

    body.route-payments .payments-tabs-v84 {
        width: 100%;
        max-width: 100% !important;
        gap: 18px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 7px;
        scrollbar-width: none;
    }

    body.route-payments .payments-tabs-v84::-webkit-scrollbar {
        display: none;
    }

    body.route-payments .payments-actions-v84 {
        justify-self: end;
        flex: 0 0 auto;
    }

    body.route-payments .payments-summary-v84,
    body.route-payments .payments-summary-v84 h2,
    body.route-payments .payments-summary-v84 dl,
    body.route-payments .payments-summary-v84 div,
    body.route-payments .payments-summary-v84 dt,
    body.route-payments .payments-summary-v84 dd {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    body.route-payments .payments-summary-v84 dl {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.route-payments .payments-table-wrap-v84 {
        overflow: visible;
    }

    body.route-payments .payments-table-v84,
    body.route-payments .payments-table-v84 thead,
    body.route-payments .payments-table-v84 tbody,
    body.route-payments .payments-table-v84 tr,
    body.route-payments .payments-table-v84 th,
    body.route-payments .payments-table-v84 td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    body.route-payments .payments-table-v84 {
        border-collapse: separate;
        border-spacing: 0;
        font-size: 15px;
    }

    body.route-payments .payments-table-v84 thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    body.route-payments .payments-table-v84 tbody {
        display: grid;
        gap: 10px;
    }

    body.route-payments .payments-table-v84 tr {
        border: 1px solid var(--border);
        border-radius: 18px;
        background: var(--card);
        box-shadow: var(--shadow-soft);
        overflow: hidden;
    }

    body.route-payments .payments-table-v84 td {
        display: grid;
        grid-template-columns: 116px minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        min-height: 42px;
        padding: 10px 12px;
        border-bottom: 1px solid var(--border);
        font-size: 15px;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    body.route-payments .payments-table-v84 td:last-child {
        border-bottom: 0;
    }

    body.route-payments .payments-table-v84 td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 700;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    body.route-payments .payments-table-v84 td span,
    body.route-payments .payments-table-v84 td small {
        min-width: 0;
    }

    body.route-payments .payments-floating-create-v84 {
        right: max(18px, env(safe-area-inset-right));
        max-width: calc(100vw - 36px);
        white-space: nowrap;
    }
}

@media (max-width: 520px) {
    body.route-payments .payments-summary-v84 dl {
        grid-template-columns: 1fr;
    }

    body.route-payments .payments-table-v84 td {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    body.route-payments .payments-floating-create-v84 {
        right: 16px;
        left: 16px;
        justify-content: center;
        width: auto;
    }
}

@media (max-width: 760px) {
    body.route-settings .settings-status-table,
    body.route-settings .settings-simple-table,
    body.route-settings .settings-parking-table,
    body.route-settings .settings-data-table {
        table-layout: auto;
        min-width: 0;
    }

    body.route-settings .settings-data-table .button,
    body.route-settings .settings-data-table td[data-label="Действие"] .button,
    body.route-settings .settings-data-table td:last-child .button {
        width: 100%;
        min-width: 0;
    }
}

/* V238: final hotfix for payments tabs scrollbar and narrow mobile overflow. */
body.route-payments .payments-topline-v84,
body.route-payments .payments-tabs-v84,
body.route-payments .payments-tabs-v84 a {
    min-width: 0 !important;
    box-sizing: border-box !important;
}

body.route-payments .payments-tabs-v84 {
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
    overscroll-behavior-x: contain !important;
    padding-bottom: 8px !important;
}

body.route-payments .payments-tabs-v84::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

body.route-payments .payments-tabs-v84 a {
    flex: 0 0 auto !important;
    overflow: visible !important;
}

body.route-payments .payments-tabs-v84 a.active::after {
    bottom: -6px !important;
}

body.route-payments .payments-table-wrap-v84 {
    min-width: 0 !important;
    max-width: 100% !important;
}

@media (max-width: 900px) {
    body.route-payments .payments-topline-v84 {
        grid-template-columns: minmax(0, 1fr) auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    body.route-payments .payments-tabs-v84 {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 43px !important;
        gap: 18px !important;
        padding: 0 0 8px 0 !important;
    }

    body.route-payments .payments-tabs-v84 a {
        font-size: 19px !important;
        line-height: 1.1 !important;
    }

    body.route-payments .payments-actions-v84 {
        min-width: 48px !important;
        max-width: 48px !important;
    }
}

@media (max-width: 520px) {
    body.route-payments .payments-topline-v84 {
        gap: 10px !important;
    }

    body.route-payments .payments-tabs-v84 {
        gap: 17px !important;
    }

    body.route-payments .payments-tabs-v84 a {
        font-size: 18px !important;
    }
}

/* V239 cash page polish: filters, totals and cash form spacing */
body.route-cash .page-header {
    align-items: flex-start;
}

body.route-cash .cash-filters-form {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
    align-items: end;
    gap: 16px 18px;
    padding: 22px 24px;
}

body.route-cash .cash-filters-form label,
body.route-cash .cash-collection-form label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.25;
}

body.route-cash .cash-filters-form input,
body.route-cash .cash-collection-form input,
body.route-cash .cash-collection-form select {
    min-height: 48px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 550;
    line-height: 1.2;
}

body.route-cash .cash-filters-form input::placeholder,
body.route-cash .cash-collection-form input::placeholder {
    color: var(--muted);
    font-weight: 500;
}

body.route-cash .cash-filters-form .filter-actions {
    align-self: end;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin: 0;
    padding: 0 0 1px;
    min-width: max-content;
}

body.route-cash .cash-filters-form .button {
    min-height: 48px;
    padding: 0 28px;
    font-size: 15px;
    white-space: nowrap;
}

body.route-cash .cash-table {
    width: 100%;
    table-layout: auto;
}

body.route-cash .cash-table th,
body.route-cash .cash-table td {
    vertical-align: middle;
    overflow-wrap: anywhere;
}

body.route-cash .cash-table tfoot th {
    padding-top: 18px;
    padding-bottom: 18px;
    font-size: 18px;
    font-weight: 450;
    line-height: 1.2;
}

body.route-cash .cash-table tfoot th:first-child {
    text-transform: uppercase;
    letter-spacing: .02em;
}

body.route-cash .cash-collection-form {
    padding: 22px 24px;
}

body.route-cash .cash-collection-form .grid-form {
    gap: 18px 20px;
}

body.route-cash .cash-collection-form .actions-row {
    justify-content: flex-start;
    margin: 18px 0 0;
    padding-top: 2px;
}

body.route-cash .cash-collection-form .button-primary {
    min-height: 48px;
    padding: 0 24px;
    font-size: 15px;
    white-space: nowrap;
}

body.route-cash .details-card h2 {
    margin-top: 0;
}

body.route-cash .details-card > .muted-text {
    margin-top: -2px;
    margin-bottom: 18px;
}

@media (max-width: 1180px) {
    body.route-cash .cash-filters-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.route-cash .cash-filters-form .filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    body.route-cash .cash-filters-form,
    body.route-cash .cash-collection-form {
        padding: 16px;
    }

    body.route-cash .cash-filters-form {
        grid-template-columns: 1fr;
    }

    body.route-cash .cash-filters-form .filter-actions,
    body.route-cash .cash-collection-form .actions-row {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    body.route-cash .cash-filters-form .button,
    body.route-cash .cash-collection-form .button-primary {
        width: 100%;
    }

    body.route-cash .cash-table tfoot th {
        font-size: 17px;
    }
}

/* V240 — manager mobile compact dashboard polish.
   Keep the desktop manager dashboard unchanged; only mobile layout is tightened. */
@media (max-width: 900px) {
    body.route-manager:not(.so-master-shell) .sidebar {
        position: absolute !important;
        top: 18px !important;
        right: 18px !important;
        z-index: 95 !important;
        width: auto !important;
        min-width: 0 !important;
        height: 42px !important;
        min-height: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }

    html[data-theme="dark"] body.route-manager:not(.so-master-shell) .sidebar {
        background: transparent !important;
        box-shadow: none !important;
    }

    body.route-manager:not(.so-master-shell) .mobile-brand-row {
        display: block !important;
        width: auto !important;
        min-width: 0 !important;
        min-height: 0 !important;
        height: 42px !important;
        padding: 0 !important;
    }

    body.route-manager:not(.so-master-shell) .mobile-page-tabs,
    body.route-manager:not(.so-master-shell) .mobile-brand-row .sidebar-brand,
    body.route-manager:not(.so-master-shell) .sidebar-brand-row,
    body.route-manager:not(.so-master-shell) .sidebar-nav,
    body.route-manager:not(.so-master-shell) .sidebar-user {
        display: none !important;
    }

    body.route-manager:not(.so-master-shell) .mobile-shell-actions {
        display: flex !important;
        margin: 0 !important;
        padding: 0 !important;
        width: auto !important;
        min-width: 0 !important;
        align-items: center !important;
        justify-content: flex-end !important;
        overflow: visible !important;
    }

    body.route-manager:not(.so-master-shell) .mobile-shell-actions .icon-button {
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        border-radius: 15px !important;
        box-shadow: 0 8px 18px rgba(15, 23, 42, .08) !important;
    }

    body.route-manager:not(.so-master-shell) .desktop-content {
        width: min(100% - 24px, 1480px) !important;
        margin-top: 0 !important;
        padding-top: 16px !important;
        padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important;
    }

    body.route-manager:not(.so-master-shell) .page-header {
        display: block !important;
        margin-bottom: 14px !important;
        padding-right: 58px !important;
    }

    body.route-manager:not(.so-master-shell) .page-header h1 {
        margin: 0 0 8px !important;
        font-size: 29px !important;
        line-height: 1.04 !important;
        letter-spacing: -0.055em !important;
    }

    body.route-manager:not(.so-master-shell) .page-header p {
        margin: 0 0 16px !important;
        font-size: 18px !important;
        line-height: 1.25 !important;
        letter-spacing: -0.025em !important;
    }

    body.route-manager:not(.so-master-shell) .page-header .actions-row {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 10px !important;
        margin: 0 !important;
    }

    body.route-manager:not(.so-master-shell) .page-header .actions-row .button {
        min-width: 0 !important;
        min-height: 46px !important;
        padding: 0 14px !important;
        border-radius: 999px !important;
        font-size: 17px !important;
        line-height: 1.05 !important;
        white-space: normal !important;
        text-align: center !important;
    }

    body.route-manager:not(.so-master-shell) .manager-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        margin-bottom: 12px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-stats-grid .stat-card {
        min-height: 96px !important;
        padding: 13px 14px !important;
        border-radius: 18px !important;
        display: grid !important;
        align-content: center !important;
    }

    body.route-manager:not(.so-master-shell) .manager-stats-grid .stat-label {
        margin-bottom: 7px !important;
        font-size: 14px !important;
        line-height: 1.15 !important;
    }

    body.route-manager:not(.so-master-shell) .manager-stats-grid .stat-card strong {
        font-size: 31px !important;
        line-height: .95 !important;
    }

    body.route-manager:not(.so-master-shell) .manager-grid {
        gap: 12px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-grid .details-card {
        padding: 14px !important;
        border-radius: 18px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-grid .section-title-row {
        margin-bottom: 10px !important;
        gap: 8px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-grid .section-title-row h2 {
        margin: 0 0 4px !important;
        font-size: 22px !important;
        line-height: 1.08 !important;
        letter-spacing: -0.045em !important;
    }

    body.route-manager:not(.so-master-shell) .manager-grid .section-title-row .muted-text {
        margin: 0 !important;
        font-size: 13px !important;
        line-height: 1.25 !important;
    }

    body.route-manager:not(.so-master-shell) .manager-order-list {
        gap: 9px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-order-card {
        border-radius: 16px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-order-card .order-card-link {
        padding: 11px 12px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-order-card .order-main {
        gap: 4px !important;
        margin-bottom: 8px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-order-card .order-main strong {
        font-size: 15px !important;
        line-height: 1.15 !important;
    }

    body.route-manager:not(.so-master-shell) .manager-order-card .order-main span,
    body.route-manager:not(.so-master-shell) .manager-order-card .order-meta {
        font-size: 12px !important;
        line-height: 1.25 !important;
    }

    body.route-manager:not(.so-master-shell) .manager-order-card .order-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px 8px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-order-card .status-pill {
        width: fit-content !important;
        max-width: 100% !important;
        padding: 4px 8px !important;
        font-size: 11px !important;
    }
}

@media (max-width: 520px) {
    body.route-manager:not(.so-master-shell) .sidebar {
        top: 16px !important;
        right: 16px !important;
    }

    body.route-manager:not(.so-master-shell) .desktop-content {
        width: min(100% - 24px, 1480px) !important;
        padding-top: 14px !important;
    }

    body.route-manager:not(.so-master-shell) .page-header {
        padding-right: 54px !important;
    }

    body.route-manager:not(.so-master-shell) .page-header h1 {
        font-size: 27px !important;
    }

    body.route-manager:not(.so-master-shell) .page-header p {
        font-size: 16px !important;
    }

    body.route-manager:not(.so-master-shell) .page-header .actions-row .button {
        min-height: 42px !important;
        padding: 0 11px !important;
        font-size: 15px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-stats-grid .stat-card {
        min-height: 84px !important;
        padding: 11px 12px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-stats-grid .stat-label {
        font-size: 13px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-stats-grid .stat-card strong {
        font-size: 28px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-grid .details-card {
        padding: 12px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-grid .section-title-row h2 {
        font-size: 20px !important;
    }
}


/* V241 — definitive mobile manager top cleanup.
   The blue mobile page-tab row is removed for /manager, and the theme toggle lives beside the main black title. */
body.route-manager:not(.so-master-shell) .manager-mobile-theme-toggle {
    display: none;
}

@media (max-width: 900px) {
    body.route-manager:not(.so-master-shell) .mobile-brand-row {
        display: none !important;
    }

    body.route-manager:not(.so-master-shell) .sidebar {
        display: none !important;
    }

    body.route-manager:not(.so-master-shell) .desktop-content {
        padding-top: 18px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-dashboard-header {
        padding-right: 0 !important;
    }

    body.route-manager:not(.so-master-shell) .manager-mobile-title-row {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 14px !important;
        margin: 0 0 8px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-mobile-title-row h1 {
        margin: 0 !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    body.route-manager:not(.so-master-shell) .manager-mobile-theme-toggle {
        display: inline-flex !important;
        flex: 0 0 42px !important;
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        border-radius: 15px !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 8px 18px rgba(15, 23, 42, .08) !important;
    }
}

@media (max-width: 520px) {
    body.route-manager:not(.so-master-shell) .desktop-content {
        padding-top: 16px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-mobile-title-row {
        gap: 12px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-mobile-theme-toggle {
        flex-basis: 40px !important;
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        border-radius: 14px !important;
    }
}


/* V242 — manager dashboard desktop topbar cleanup.
   On the manager dashboard the generic topbar title is removed, and its actions live in the dashboard action row. */
body.route-manager:not(.so-master-shell):not(.so-auth-shell) .desktop-topbar {
    display: none !important;
}

body.route-manager:not(.so-master-shell):not(.so-auth-shell) .desktop-content {
    padding-top: 24px;
}

body.route-manager:not(.so-master-shell) .manager-dashboard-header {
    align-items: flex-start;
    gap: 18px;
}

body.route-manager:not(.so-master-shell) .manager-dashboard-heading {
    min-width: 0;
    flex: 1 1 auto;
}

body.route-manager:not(.so-master-shell) .manager-dashboard-actions {
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 0;
}

body.route-manager:not(.so-master-shell) .manager-desktop-actions-spacer {
    display: inline-block;
    width: 10px;
    height: 1px;
}

body.route-manager:not(.so-master-shell) .manager-desktop-theme-toggle {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    border-radius: 16px;
    font-size: 18px;
}

@media (max-width: 1180px) {
    body.route-manager:not(.so-master-shell) .manager-dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    body.route-manager:not(.so-master-shell) .manager-dashboard-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    body.route-manager:not(.so-master-shell) .manager-desktop-actions-spacer {
        display: none;
    }
}

@media (max-width: 900px) {
    body.route-manager:not(.so-master-shell):not(.so-auth-shell) .desktop-content {
        padding-top: 16px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-desktop-extra-action,
    body.route-manager:not(.so-master-shell) .manager-desktop-actions-spacer {
        display: none !important;
    }
}

/* V243 — tasks dashboard header aligned with manager dashboard header.
   The generic desktop topbar is removed on /tickets; page title and global actions live in the page header. */
@media (min-width: 901px) {
    body.route-tickets:not(.so-master-shell):not(.so-auth-shell) .desktop-topbar {
        display: none !important;
    }

    body.route-tickets:not(.so-master-shell):not(.so-auth-shell) .desktop-content {
        width: min(100% - 32px, 1480px) !important;
        max-width: 1480px !important;
        margin: 0 auto 44px !important;
        padding: 24px 0 82px !important;
    }

    body.route-tickets:not(.so-master-shell) .hc-tasks-page {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(300px, 560px) auto !important;
        align-items: center !important;
        align-content: start !important;
        column-gap: 10px !important;
        row-gap: 16px !important;
        width: 100% !important;
        min-height: auto !important;
        padding: 0 0 82px !important;
        margin: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    body.route-tickets:not(.so-master-shell) .hc-tasks-page-header {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 18px !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    body.route-tickets:not(.so-master-shell) .hc-tasks-page-heading {
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    body.route-tickets:not(.so-master-shell) .hc-tasks-page-heading h1 {
        margin: 0 !important;
        color: var(--text) !important;
        font-size: 28px !important;
        font-weight: 450 !important;
        line-height: 1.08 !important;
        letter-spacing: -0.04em !important;
    }

    body.route-tickets:not(.so-master-shell) .hc-tasks-page-header-actions {
        display: flex !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 10px !important;
        margin: 0 !important;
        padding: 0 !important;
        min-width: 0 !important;
    }

    body.route-tickets:not(.so-master-shell) .hc-tasks-new-order-action {
        min-height: 46px !important;
        padding: 0 22px !important;
        border-radius: 999px !important;
        font-size: 16px !important;
        font-weight: 450 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
    }

    body.route-tickets:not(.so-master-shell) .hc-tasks-theme-toggle {
        width: 46px !important;
        min-width: 46px !important;
        height: 46px !important;
        min-height: 46px !important;
        border-radius: 16px !important;
        font-size: 18px !important;
    }

    body.route-tickets:not(.so-master-shell) .hc-tasks-topline {
        display: contents !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    body.route-tickets:not(.so-master-shell) .hc-tasks-tabs {
        grid-column: 1 !important;
        grid-row: 2 !important;
    }

    body.route-tickets:not(.so-master-shell) .hc-task-search-row {
        grid-column: 2 !important;
        grid-row: 2 !important;
    }

    body.route-tickets:not(.so-master-shell) .hc-tasks-top-actions {
        grid-column: 3 !important;
        grid-row: 2 !important;
    }
}

@media (max-width: 900px) {
    body.route-tickets:not(.so-master-shell) .hc-tasks-page-header {
        display: none !important;
    }
}

@media (min-width: 901px) and (max-width: 1180px) {
    body.route-tickets:not(.so-master-shell) .hc-tasks-page-header {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    body.route-tickets:not(.so-master-shell) .hc-tasks-page-header-actions {
        width: 100% !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }
}


/* V244 — unified sticky module headers across the desktop application.
   The shared layout header is the single source of page title, global new-order action,
   theme switcher, and route-specific contextual actions. */
@media (min-width: 901px) {
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .desktop-topbar.unified-module-topbar {
        position: sticky !important;
        top: 0 !important;
        z-index: 160 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 16px !important;
        min-height: 72px !important;
        padding: 12px 20px !important;
        background: color-mix(in srgb, var(--bg) 92%, transparent) !important;
        border-bottom: 1px solid var(--border) !important;
        box-shadow: 0 8px 22px rgba(15, 23, 42, .035) !important;
        backdrop-filter: blur(22px) !important;
        -webkit-backdrop-filter: blur(22px) !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .desktop-topbar-title-wrap {
        flex: 0 0 auto !important;
        min-width: 0 !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .desktop-topbar-title-wrap h1 {
        margin: 0 !important;
        color: var(--text) !important;
        font-size: 22px !important;
        font-weight: 450 !important;
        line-height: 1.08 !important;
        letter-spacing: -.04em !important;
        white-space: nowrap !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .unified-module-topbar-actions {
        display: flex !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 9px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        overscroll-behavior-inline: contain !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .unified-module-topbar-actions::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .unified-module-topbar-actions .button,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .unified-module-topbar-actions .icon-button {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .unified-module-topbar-actions .button {
        min-height: 40px !important;
        padding: 0 17px !important;
        border-radius: 999px !important;
        font-size: 14px !important;
        font-weight: 450 !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .unified-module-topbar-actions .unified-new-order-action {
        margin-left: 6px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .unified-module-topbar-actions .unified-theme-action {
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        border-radius: 14px !important;
    }

    /* V242/V243 hid the shared topbar on these routes. V244 deliberately restores it. */
    body.route-manager:not(.so-master-shell):not(.so-auth-shell) .desktop-topbar,
    body.route-tickets:not(.so-master-shell):not(.so-auth-shell) .desktop-topbar {
        display: flex !important;
    }

    body.route-manager:not(.so-master-shell):not(.so-auth-shell) .desktop-content {
        padding-top: 20px !important;
    }

    body.route-tickets:not(.so-master-shell):not(.so-auth-shell) .desktop-content {
        padding-top: 18px !important;
    }

    /* The tasks page no longer owns a second title/action header. */
    body.route-tickets:not(.so-master-shell) .hc-tasks-page-header {
        display: none !important;
    }

    body.route-tickets:not(.so-master-shell) .hc-tasks-page {
        grid-template-columns: minmax(320px, max-content) minmax(280px, 1fr) auto !important;
        align-items: center !important;
        align-content: start !important;
        column-gap: 14px !important;
        row-gap: 16px !important;
    }

    body.route-tickets:not(.so-master-shell) .hc-tasks-tabs {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    body.route-tickets:not(.so-master-shell) .hc-task-search-row {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    body.route-tickets:not(.so-master-shell) .hc-tasks-top-actions {
        grid-column: 3 !important;
        grid-row: 1 !important;
    }

    /* Manager desktop title and actions are now supplied only by the shared header. */
    body.route-manager:not(.so-master-shell) .manager-mobile-title-row {
        display: none !important;
    }

    body.route-manager:not(.so-master-shell) .manager-dashboard-intro {
        margin: 0 0 18px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-dashboard-intro > p {
        margin: 0 !important;
        color: var(--muted) !important;
        font-size: 15px !important;
        line-height: 1.42 !important;
    }
}

@media (min-width: 901px) and (max-width: 1240px) {
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .desktop-topbar.unified-module-topbar {
        gap: 12px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .desktop-topbar-title-wrap h1 {
        font-size: 20px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .unified-module-topbar-actions {
        gap: 7px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .unified-module-topbar-actions .button {
        min-height: 38px !important;
        padding-left: 13px !important;
        padding-right: 13px !important;
        font-size: 13px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .unified-module-topbar-actions .unified-theme-action {
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
    }
}

/* Shared compact introductions replace duplicate page names inside content. */
.module-page-intro,
.users-hc-header-without-duplicate-title,
.settings-hero-card-without-duplicate-title {
    min-width: 0;
}

.module-page-intro {
    margin: 0 0 18px;
}

.module-page-intro p,
.users-hc-header-without-duplicate-title .users-hc-subtitle,
.settings-hero-card-without-duplicate-title p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    font-weight: 450;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

body.route-contractors .contractor-page-intro {
    padding: 0 2px;
}

body.route-telephony .telephony-page-intro,
body.route-cash .cash-page-intro {
    padding: 0;
}

body.route-settings .settings-hero-card-without-duplicate-title {
    display: block;
}

body.route-settings .settings-hero-card-without-duplicate-title .settings-eyebrow {
    margin-bottom: 7px;
}

body.route-users .users-hc-header-without-duplicate-title {
    display: block !important;
    margin-bottom: 14px !important;
}

body.route-users .users-hc-content-actions {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 12px;
}

@media (max-width: 900px) {
    body.route-manager:not(.so-master-shell) .manager-dashboard-intro {
        margin: 0 0 14px !important;
    }

    body.route-manager:not(.so-master-shell) .manager-dashboard-intro > p {
        margin: 0 !important;
    }

    .module-page-intro,
    .users-hc-header-without-duplicate-title,
    .settings-hero-card-without-duplicate-title {
        margin-bottom: 14px !important;
    }

    body.route-users .users-hc-content-actions {
        justify-content: stretch;
    }

    body.route-users .users-hc-content-actions .button {
        width: 100%;
        justify-content: center;
    }
}


/* V245 — move order workflow controls into the shared sticky header and polish order form layout. */
@media (min-width: 901px) {
    body.is-order-edit-route .oev173-fixed-order-top .oev61-actions,
    body.is-order-edit-route .oev173-fixed-order-top .oev177-order-theme-toggle {
        display: none !important;
    }

    body.is-order-edit-route .unified-module-topbar-actions {
        gap: 8px !important;
    }

    body.is-order-edit-route .unified-order-status-select {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 132px !important;
        max-width: 210px !important;
        min-height: 40px !important;
        padding: 0 34px 0 16px !important;
        border: 1px solid color-mix(in srgb, var(--primary) 78%, var(--border)) !important;
        border-radius: 999px !important;
        background-color: var(--primary) !important;
        color: #fff !important;
        font-size: 14px !important;
        font-weight: 450 !important;
        line-height: 1 !important;
        cursor: pointer !important;
        box-shadow: 0 8px 20px rgba(37, 99, 235, .16) !important;
    }

    body.is-order-edit-route .unified-order-archive-action,
    body.is-order-edit-route .unified-order-save-action {
        min-height: 40px !important;
    }

    body.is-order-edit-route .unified-order-archive-action.is-archived {
        border-color: color-mix(in srgb, var(--primary) 35%, var(--border)) !important;
        color: var(--primary) !important;
    }

    body.is-order-edit-route .oev61-card-service > .oev61-fields.two {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-auto-flow: row !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-category-field {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-usage-field {
        grid-column: 1 !important;
        grid-row: 2 !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-brand-field {
        grid-column: 2 !important;
        grid-row: 1 !important;
        border-right: 0 !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-price-field {
        grid-column: 2 !important;
        grid-row: 2 !important;
        border-right: 0 !important;
    }
}

body.is-order-edit-route .order-edit-client-notice[hidden] {
    display: none !important;
}

body.is-order-edit-route .oev245-parts-description-field {
    display: grid !important;
    align-content: start !important;
    align-self: start !important;
    gap: 8px !important;
    min-width: 0 !important;
    height: auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

body.is-order-edit-route .oev245-parts-description-label {
    display: block !important;
    margin: 0 !important;
    color: var(--muted) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
}

body.is-order-edit-route .oev245-parts-description-field textarea {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 112px !important;
    height: 112px !important;
    max-height: 220px !important;
    padding: 12px 14px !important;
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
    background: var(--input) !important;
    color: var(--text) !important;
    font: inherit !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    line-height: 1.45 !important;
    text-align: left !important;
    resize: vertical !important;
    box-sizing: border-box !important;
}

body.is-order-edit-route .oev245-parts-description-field textarea:focus {
    border-color: rgba(37, 99, 235, .48) !important;
    outline: 0 !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10) !important;
}

@media (max-width: 900px) {
    body.is-order-edit-route .oev61-card-service .oev245-category-field,
    body.is-order-edit-route .oev61-card-service .oev245-usage-field,
    body.is-order-edit-route .oev61-card-service .oev245-brand-field,
    body.is-order-edit-route .oev61-card-service .oev245-price-field {
        grid-column: 1 !important;
        grid-row: auto !important;
        border-right: 0 !important;
    }

    body.is-order-edit-route .oev245-parts-description-field textarea {
        min-height: 96px !important;
        height: 96px !important;
    }
}


/* V246 — order editor column order, sticky tabs offset, and description-driven parts proof flow. */
@media (min-width: 901px) {
    body.is-order-edit-route .oev112-page .oev173-fixed-order-top,
    body.is-order-edit-route .oev173-fixed-order-top {
        top: 72px !important;
        z-index: 150 !important;
    }

    body.is-order-edit-route .oev112-page #general,
    body.is-order-edit-route .oev112-page #client,
    body.is-order-edit-route .oev112-page #parts,
    body.is-order-edit-route .oev112-page #parking,
    body.is-order-edit-route .oev112-page #payments,
    body.is-order-edit-route .oev112-page #media {
        scroll-margin-top: 190px !important;
    }

    body.is-order-edit-route .oev61-card-service > .oev61-fields.two {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: auto auto auto !important;
        align-items: stretch !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-category-field {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-brand-field {
        grid-column: 1 !important;
        grid-row: 2 !important;
        border-right: 1px solid var(--border) !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-usage-field {
        grid-column: 1 !important;
        grid-row: 3 !important;
        border-right: 1px solid var(--border) !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-price-field {
        grid-column: 2 !important;
        grid-row: 1 / span 3 !important;
        align-self: stretch !important;
        border-right: 0 !important;
    }
}

body.is-order-edit-route .oev224-parts-editor-grid {
    align-items: start !important;
}

body.is-order-edit-route .oev246-parts-right-column {
    grid-column: 2 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
    min-width: 0 !important;
    align-self: start !important;
}

body.is-order-edit-route .oev246-parts-right-column .oev245-parts-description-field,
body.is-order-edit-route .oev246-parts-right-column .oev224-parts-proof-list {
    grid-column: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    align-self: start !important;
}

body.is-order-edit-route .oev245-parts-description-field textarea {
    min-height: 96px !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: hidden !important;
    resize: vertical !important;
}

@media (max-width: 980px) {
    body.is-order-edit-route .oev246-parts-right-column {
        grid-column: 1 !important;
    }
}

@media (max-width: 900px) {
    body.is-order-edit-route .oev61-card-service .oev245-category-field,
    body.is-order-edit-route .oev61-card-service .oev245-brand-field,
    body.is-order-edit-route .oev61-card-service .oev245-usage-field,
    body.is-order-edit-route .oev61-card-service .oev245-price-field {
        grid-column: 1 !important;
        grid-row: auto !important;
        border-right: 0 !important;
    }

    body.is-order-edit-route .oev245-parts-description-field textarea {
        min-height: 90px !important;
        height: auto !important;
        max-height: none !important;
        overflow-y: hidden !important;
    }
}

/* V247 — order-only workflow controls, configured status colors, and desktop all-orders navigation. */
@media (min-width: 901px) {
    body.is-order-edit-route .desktop-topbar-title-wrap {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        max-width: min(46vw, 620px) !important;
    }

    body.is-order-edit-route .desktop-topbar-title-wrap h1 {
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    body.is-order-edit-route .unified-order-list-action {
        flex: 0 0 auto !important;
        min-height: 40px !important;
        padding: 0 16px !important;
        border-radius: 999px !important;
        border: 1px solid var(--border) !important;
        background: var(--surface) !important;
        color: var(--text) !important;
        font-size: 14px !important;
        font-weight: 450 !important;
        line-height: 1 !important;
        box-shadow: none !important;
    }

    body.is-order-edit-route .unified-order-list-action:hover {
        border-color: color-mix(in srgb, var(--primary) 45%, var(--border)) !important;
        color: var(--primary) !important;
        transform: translateY(-1px) !important;
    }

    body.is-order-edit-route .unified-order-status-select {
        border-color: var(--order-status-bg, var(--primary)) !important;
        background-color: var(--order-status-bg, var(--primary)) !important;
        color: var(--order-status-text, #ffffff) !important;
        box-shadow: 0 8px 20px color-mix(in srgb, var(--order-status-bg, var(--primary)) 22%, transparent) !important;
    }

    body.is-order-edit-route .unified-order-status-select:focus {
        outline: 0 !important;
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--order-status-bg, var(--primary)) 24%, transparent),
                    0 8px 20px color-mix(in srgb, var(--order-status-bg, var(--primary)) 22%, transparent) !important;
    }

    /* The desktop back navigation now lives in the shared sticky header. */
    body.is-order-edit-route .oev173-fixed-order-top .oev61-back,
    body.is-order-edit-route .oev173-fixed-order-top .oev181-top-back {
        display: none !important;
    }
}

@media (min-width: 901px) and (max-width: 1240px) {
    body.is-order-edit-route .desktop-topbar-title-wrap {
        gap: 7px !important;
        max-width: min(42vw, 500px) !important;
    }

    body.is-order-edit-route .unified-order-list-action {
        min-height: 38px !important;
        padding: 0 13px !important;
        font-size: 13px !important;
    }
}

/* V248 — mobile order status is scoped to the open order and uses configured status colors. */
@media (max-width: 900px) {
    body.is-order-edit-route .oev61-status[data-order-mobile-status-select] {
        border-color: var(--order-status-bg, var(--primary)) !important;
        background-color: var(--order-status-bg, var(--primary)) !important;
        color: var(--order-status-text, #ffffff) !important;
        box-shadow: 0 7px 18px color-mix(in srgb, var(--order-status-bg, var(--primary)) 22%, transparent) !important;
        font-weight: 450 !important;
    }

    body.is-order-edit-route .oev61-status[data-order-mobile-status-select]:focus {
        outline: 0 !important;
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--order-status-bg, var(--primary)) 24%, transparent),
                    0 7px 18px color-mix(in srgb, var(--order-status-bg, var(--primary)) 22%, transparent) !important;
    }

    body.is-order-edit-route .oev61-status[data-order-mobile-status-select] option {
        background: var(--card) !important;
        color: var(--text) !important;
    }
}

/* V249 — Safari/iOS must use the configured status text color, not the old forced white fill. */
@media (max-width: 900px) {
    body.so-app.is-order-edit-route .oev112-page .oev61-status[data-order-mobile-status-select] {
        color: var(--order-status-text, #ffffff) !important;
        -webkit-text-fill-color: var(--order-status-text, #ffffff) !important;
        text-shadow: none !important;
        opacity: 1 !important;
    }

    body.so-app.is-order-edit-route .oev112-page .oev61-status[data-order-mobile-status-select]:focus,
    body.so-app.is-order-edit-route .oev112-page .oev61-status[data-order-mobile-status-select]:active {
        color: var(--order-status-text, #ffffff) !important;
        -webkit-text-fill-color: var(--order-status-text, #ffffff) !important;
    }
}


/* V250 — keep the mobile service card in two functional columns: equipment left, price right. */
@media (max-width: 900px) {
    body.is-order-edit-route .oev61-card-service > .oev61-fields.two {
        display: grid !important;
        grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr) !important;
        grid-template-rows: auto auto auto !important;
        align-items: stretch !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-category-field {
        grid-column: 1 !important;
        grid-row: 1 !important;
        border-right: 1px solid var(--border) !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-brand-field {
        grid-column: 1 !important;
        grid-row: 2 !important;
        border-right: 1px solid var(--border) !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-usage-field {
        grid-column: 1 !important;
        grid-row: 3 !important;
        border-right: 1px solid var(--border) !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-price-field {
        grid-column: 2 !important;
        grid-row: 1 / span 3 !important;
        align-self: stretch !important;
        align-content: start !important;
        border-right: 0 !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-category-field,
    body.is-order-edit-route .oev61-card-service .oev245-brand-field,
    body.is-order-edit-route .oev61-card-service .oev245-usage-field,
    body.is-order-edit-route .oev61-card-service .oev245-price-field {
        min-width: 0 !important;
        grid-template-columns: minmax(0, 1fr) !important;
        align-items: start !important;
        gap: 4px !important;
        padding: 10px 11px !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-category-field select,
    body.is-order-edit-route .oev61-card-service .oev245-brand-field input,
    body.is-order-edit-route .oev61-card-service .oev245-usage-field select,
    body.is-order-edit-route .oev61-card-service .oev245-price-field > input {
        width: 100% !important;
        min-width: 0 !important;
        padding-left: 7px !important;
        padding-right: 7px !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-price-field .oev233-price-controls {
        width: 100% !important;
        min-width: 0 !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-price-field .oev233-price-preview {
        width: 100% !important;
        min-width: 0 !important;
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (max-width: 430px) {
    body.is-order-edit-route .oev61-card-service > .oev61-fields.two {
        grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr) !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-category-field,
    body.is-order-edit-route .oev61-card-service .oev245-brand-field,
    body.is-order-edit-route .oev61-card-service .oev245-usage-field,
    body.is-order-edit-route .oev61-card-service .oev245-price-field {
        padding: 9px 9px !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-price-field .oev233-price-controls {
        gap: 5px !important;
        padding: 6px !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-price-field .oev233-price-radio {
        padding-left: 5px !important;
        padding-right: 5px !important;
        gap: 4px !important;
    }
}

/* V251 — one shared mobile admin header with the theme toggle fixed at the top-right on every page. */
.mobile-admin-topline {
    display: none;
}

@media (max-width: 900px) {
    body.so-app:not(.so-master-shell):not(.so-auth-shell) {
        --admin-mobile-header-height: 57px;
    }

    /* Restore the shared mobile header even on routes that previously replaced or hid it. */
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .desktop-shell > .sidebar,
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .desktop-shell > .sidebar,
    body.so-app:has(.oev112-page):not(.so-master-shell):not(.so-auth-shell) .desktop-shell > .sidebar,
    body.route-manager:not(.so-master-shell):not(.so-auth-shell) .desktop-shell > .sidebar {
        display: block !important;
        position: sticky !important;
        top: 0 !important;
        right: auto !important;
        left: auto !important;
        z-index: 13050 !important;
        width: 100% !important;
        min-width: 0 !important;
        height: var(--admin-mobile-header-height) !important;
        min-height: var(--admin-mobile-header-height) !important;
        padding: 6px 12px !important;
        border: 0 !important;
        border-bottom: 1px solid var(--border) !important;
        background: color-mix(in srgb, var(--bg) 96%, transparent) !important;
        box-shadow: 0 6px 18px rgba(15, 23, 42, .06) !important;
        backdrop-filter: blur(18px) !important;
        -webkit-backdrop-filter: blur(18px) !important;
        box-sizing: border-box !important;
    }

    html[data-theme="dark"] body.so-app:not(.so-master-shell):not(.so-auth-shell) .desktop-shell > .sidebar {
        background: rgba(24, 24, 24, .97) !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .20) !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-brand-row,
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .mobile-brand-row,
    body.route-manager:not(.so-master-shell):not(.so-auth-shell) .mobile-brand-row {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 44px !important;
        height: 44px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-topline {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        width: 100% !important;
        min-width: 0 !important;
        height: 44px !important;
        min-height: 44px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-topline-main {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        height: 44px !important;
        overflow: hidden !important;
        display: flex !important;
        align-items: center !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-topline-title {
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        overflow: hidden !important;
        color: var(--text) !important;
        font-size: 22px !important;
        font-weight: 450 !important;
        line-height: 1.05 !important;
        letter-spacing: -.045em !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-topline .mobile-page-tabs {
        flex: 1 1 auto !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 44px !important;
        min-height: 44px !important;
        margin: 0 !important;
        padding: 0 2px 4px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        overscroll-behavior-inline: contain !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-topline .mobile-page-tabs::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-theme-toggle {
        display: inline-flex !important;
        flex: 0 0 42px !important;
        align-items: center !important;
        justify-content: center !important;
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        margin: 0 !important;
        border-radius: 14px !important;
        background: var(--surface) !important;
        color: var(--text) !important;
        box-shadow: 0 7px 18px rgba(15, 23, 42, .08) !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-theme-toggle .app-nav-icon {
        width: 20px !important;
        height: 20px !important;
    }

    body.route-orders:not(.so-master-shell):not(.so-auth-shell):not(.is-order-edit-route) .mobile-admin-import-link {
        display: inline-flex !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 0 !important;
        height: 42px !important;
        min-height: 42px !important;
        margin: 0 !important;
        padding: 0 12px !important;
        border-radius: 14px !important;
        white-space: nowrap !important;
        font-size: 13px !important;
        font-weight: 450 !important;
        line-height: 1 !important;
        box-shadow: 0 7px 18px rgba(15, 23, 42, .08) !important;
    }

    /* Old route-specific theme controls are hidden; the shared top-right control is the only mobile toggle. */
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-shell-actions,
    body.route-manager:not(.so-master-shell) .manager-mobile-theme-toggle,
    body.is-order-edit-route .oev177-order-theme-toggle {
        display: none !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .sidebar-brand-row,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .sidebar-nav,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .sidebar-user {
        display: none !important;
    }

    /* Manager uses the shared mobile title/header instead of its page-local title row. */
    body.route-manager:not(.so-master-shell) .manager-mobile-title-row {
        display: none !important;
    }

    body.route-manager:not(.so-master-shell) .desktop-content {
        padding-top: 14px !important;
    }

    /* Order editor keeps its action row and tabs directly under the shared mobile header. */
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .oev173-fixed-order-top,
    body.so-app:has(.oev112-page):not(.so-master-shell):not(.so-auth-shell) .oev173-fixed-order-top {
        top: var(--admin-mobile-header-height) !important;
    }

    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .oev173-fixed-order-top .oev61-title-row,
    body.so-app:has(.oev112-page):not(.so-master-shell):not(.so-auth-shell) .oev173-fixed-order-top .oev61-title-row {
        display: none !important;
    }

    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .desktop-main,
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .desktop-content,
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .page {
        padding-top: 0 !important;
    }
}

@media (max-width: 520px) {
    body.so-app:not(.so-master-shell):not(.so-auth-shell) {
        --admin-mobile-header-height: 55px;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .desktop-shell > .sidebar {
        height: var(--admin-mobile-header-height) !important;
        min-height: var(--admin-mobile-header-height) !important;
        padding: 5px 10px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-brand-row,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-topline,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-topline-main,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-topline .mobile-page-tabs {
        height: 44px !important;
        min-height: 44px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-topline-title {
        font-size: 20px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-theme-toggle {
        flex-basis: 40px !important;
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        border-radius: 13px !important;
    }
}

/* V252 — mobile order editor owns the top of the screen; payments actions sit beside balance. */
.oev252-mobile-new-order,
.oev252-mobile-general-action {
    display: none;
}

.payments-summary-head-v252 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-width: 0;
}

body.route-payments .payments-summary-v84 {
    display: grid;
    gap: 14px;
    width: 100%;
    min-width: 0;
}

body.route-payments .payments-summary-head-v252 h2 {
    min-width: 0;
}

body.route-payments .payments-summary-head-v252 .payments-actions-v84 {
    flex: 0 0 auto;
}

@media (max-width: 900px) {
    /* The order editor does not use the shared mobile module header. Its own fixed controls start at top: 0. */
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .desktop-shell > .sidebar,
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .mobile-brand-row,
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-topline {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .desktop-shell {
        display: block !important;
        min-height: 100vh !important;
    }

    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .desktop-main,
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .desktop-content,
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .page,
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .oev112-content,
    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .oev112-page {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    body.so-app.is-order-edit-route:not(.so-master-shell):not(.so-auth-shell) .oev173-fixed-order-top,
    body.so-app:has(.oev112-page):not(.so-master-shell):not(.so-auth-shell) .oev173-fixed-order-top {
        top: 0 !important;
        padding: 7px 8px 0 !important;
        overflow: hidden !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-title-row,
    body.so-app:has(.oev112-page) .oev173-fixed-order-top .oev61-title-row,
    body.so-app.is-order-edit-route .oev177-order-theme-toggle {
        display: none !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-header {
        padding: 0 0 6px !important;
    }

    /* First fixed row: status, archive, save, new order and the General tab. */
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions {
        display: flex !important;
        align-items: center !important;
        gap: 7px !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 0 0 2px !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        overscroll-behavior-inline: contain !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev181-top-back {
        display: none !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev61-status,
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev121-archive-button,
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev61-save,
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev252-mobile-new-order,
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev252-mobile-general-action {
        display: inline-flex !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        min-width: max-content !important;
        height: 38px !important;
        min-height: 38px !important;
        padding: 0 15px !important;
        border-radius: 12px !important;
        font-size: 14px !important;
        font-weight: 450 !important;
        line-height: 1 !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev61-status {
        min-width: 145px !important;
        padding-right: 24px !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev252-mobile-new-order {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev252-mobile-general-action {
        position: relative !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        color: var(--text) !important;
        box-shadow: none !important;
        text-decoration: none !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev252-mobile-general-action::after {
        position: absolute;
        right: 10px;
        bottom: 0;
        left: 10px;
        height: 3px;
        border-radius: 999px;
        background: var(--primary);
        content: "";
    }

    /* Second fixed row begins with Client; General lives in the first row on mobile. */
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-tabs .oev252-general-tab {
        display: none !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-tabs {
        gap: 22px !important;
        padding: 0 0 1px !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-tabs a {
        padding: 9px 0 10px !important;
        font-size: 15px !important;
        font-weight: 750 !important;
    }

    /* Payments use the shared top module tabs. The page-local row is hidden on mobile. */
    body.route-payments .payments-topline-v84 {
        display: none !important;
    }

    body.route-payments .payments-summary-v84 {
        display: grid !important;
        gap: 13px !important;
        padding-top: 14px !important;
    }

    body.route-payments .payments-summary-head-v252 {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        gap: 10px !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    body.route-payments .payments-summary-head-v252 h2 {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        font-size: clamp(25px, 7vw, 34px) !important;
        line-height: 1.05 !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
    }

    body.route-payments .payments-summary-head-v252 .payments-actions-v84 {
        display: flex !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 8px !important;
        min-width: auto !important;
        max-width: none !important;
    }

    body.route-payments .payments-summary-head-v252 .payments-icon-button-v84 {
        width: 46px !important;
        min-width: 46px !important;
        height: 46px !important;
        min-height: 46px !important;
        padding: 0 !important;
        border-radius: 14px !important;
    }

    body.route-payments .payments-summary-head-v252 .payments-icon-button-v84 span {
        display: none !important;
    }
}

@media (max-width: 520px) {
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions {
        gap: 6px !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev61-status,
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev121-archive-button,
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev61-save,
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev252-mobile-new-order,
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev252-mobile-general-action {
        height: 36px !important;
        min-height: 36px !important;
        padding-right: 13px !important;
        padding-left: 13px !important;
        font-size: 13px !important;
    }

    body.route-payments .payments-summary-head-v252 h2 {
        font-size: clamp(23px, 6.8vw, 30px) !important;
    }

    body.route-payments .payments-summary-head-v252 .payments-icon-button-v84 {
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        border-radius: 13px !important;
    }
}


/* V253 — mobile order header correction: four equal workflow controls and restored scrollable section tabs. */
@media (max-width: 900px) {
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        align-items: stretch !important;
        gap: clamp(4px, 1.15vw, 7px) !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow: visible !important;
        padding: 0 0 5px !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev181-top-back {
        display: inline-flex !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev61-status,
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev121-archive-button,
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev61-save,
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev181-top-back {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: clamp(36px, 9.5vw, 40px) !important;
        min-height: clamp(36px, 9.5vw, 40px) !important;
        margin: 0 !important;
        padding: 0 clamp(5px, 1.6vw, 11px) !important;
        border-radius: clamp(10px, 2.7vw, 13px) !important;
        font-family: inherit !important;
        font-size: clamp(11px, 3.05vw, 14px) !important;
        font-weight: 450 !important;
        font-style: normal !important;
        line-height: 1 !important;
        letter-spacing: 0 !important;
        text-align: center !important;
        white-space: nowrap !important;
        text-decoration: none !important;
        text-overflow: ellipsis !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev61-status {
        padding-right: clamp(19px, 5vw, 25px) !important;
        background-position: right 7px center !important;
        background-size: 12px auto !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev181-top-back,
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev121-archive-button {
        border: 1px solid var(--border) !important;
        background-color: var(--surface) !important;
        color: var(--text) !important;
        -webkit-text-fill-color: var(--text) !important;
        box-shadow: none !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev61-save {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev252-mobile-new-order,
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev252-mobile-general-action {
        display: none !important;
    }

    /* Restore the original order-section navigation: every section, including General, stays in one swipeable row. */
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: clamp(18px, 5vw, 26px) !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 2px 1px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        overscroll-behavior-inline: contain !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-x !important;
        scroll-behavior: smooth !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-tabs::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-tabs .oev252-general-tab,
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-tabs a {
        display: inline-flex !important;
        flex: 0 0 auto !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: max-content !important;
        padding: 9px 0 10px !important;
        font-family: inherit !important;
        font-size: clamp(14px, 3.8vw, 16px) !important;
        font-weight: 750 !important;
        line-height: 1.05 !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 390px) {
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions {
        gap: 4px !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev61-status,
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev121-archive-button,
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev61-save,
    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev181-top-back {
        padding-right: 4px !important;
        padding-left: 4px !important;
        font-size: clamp(10px, 2.95vw, 12px) !important;
    }

    body.so-app.is-order-edit-route .oev173-fixed-order-top .oev61-actions .oev61-status {
        padding-right: 18px !important;
    }
}

/* V255: keep the admin/manager mobile bottom navigation at one invariant vertical position on every route. */
@media (max-width: 900px) {
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav {
        position: fixed !important;
        inset: auto 10px calc(8px + env(safe-area-inset-bottom, 0px)) 10px !important;
        top: auto !important;
        width: auto !important;
        height: 68px !important;
        min-height: 68px !important;
        max-height: 68px !important;
        margin: 0 !important;
        padding: 6px 8px !important;
        align-items: center !important;
        align-content: center !important;
        box-sizing: border-box !important;
        transform: translate3d(0, 0, 0) !important;
        -webkit-transform: translate3d(0, 0, 0) !important;
        backface-visibility: hidden !important;
        -webkit-backface-visibility: hidden !important;
        contain: layout paint !important;
        isolation: isolate !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > a {
        flex: 0 0 78px !important;
        align-self: center !important;
        width: 78px !important;
        min-width: 78px !important;
        max-width: 78px !important;
        height: 54px !important;
        min-height: 54px !important;
        max-height: 54px !important;
        margin: 0 !important;
        padding: 6px !important;
        box-sizing: border-box !important;
        transform: none !important;
        -webkit-transform: none !important;
        vertical-align: top !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > a.active,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > a:hover,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > a:focus,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > a:focus-visible {
        margin: 0 !important;
        transform: none !important;
        -webkit-transform: none !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > a > span {
        display: grid !important;
        place-items: center !important;
        width: 24px !important;
        height: 24px !important;
        min-height: 24px !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 0 !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > a > strong {
        display: block !important;
        width: 100% !important;
        height: 15px !important;
        min-height: 15px !important;
        max-height: 15px !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 11px !important;
        line-height: 15px !important;
        vertical-align: top !important;
    }
}


/* V256: lock every admin/manager bottom-navigation item to identical internal coordinates.
   V255 fixed the navigation container; V256 fixes the icon/label geometry inside each route item. */
@media (max-width: 900px) {
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link {
        position: relative !important;
        display: block !important;
        flex: 0 0 78px !important;
        align-self: center !important;
        width: 78px !important;
        min-width: 78px !important;
        max-width: 78px !important;
        height: 54px !important;
        min-height: 54px !important;
        max-height: 54px !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
        line-height: normal !important;
        vertical-align: top !important;
        transform: none !important;
        -webkit-transform: none !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link.active,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link:hover,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link:focus,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link:focus-visible {
        height: 54px !important;
        min-height: 54px !important;
        max-height: 54px !important;
        margin: 0 !important;
        padding: 0 !important;
        transform: none !important;
        -webkit-transform: none !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link > .app-bottom-nav-icon-wrap {
        position: absolute !important;
        top: 6px !important;
        left: 50% !important;
        display: block !important;
        width: 24px !important;
        min-width: 24px !important;
        max-width: 24px !important;
        height: 24px !important;
        min-height: 24px !important;
        max-height: 24px !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        line-height: 0 !important;
        transform: translateX(-50%) !important;
        -webkit-transform: translateX(-50%) !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link > .app-bottom-nav-icon-wrap > svg,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link > .app-bottom-nav-icon-wrap > .app-nav-icon {
        position: static !important;
        display: block !important;
        width: 24px !important;
        min-width: 24px !important;
        max-width: 24px !important;
        height: 24px !important;
        min-height: 24px !important;
        max-height: 24px !important;
        margin: 0 !important;
        padding: 0 !important;
        vertical-align: top !important;
        transform: none !important;
        -webkit-transform: none !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link > .app-bottom-nav-label {
        position: absolute !important;
        right: 4px !important;
        bottom: 5px !important;
        left: 4px !important;
        display: block !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 15px !important;
        min-height: 15px !important;
        max-height: 15px !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        font-family: inherit !important;
        font-size: 11px !important;
        font-style: normal !important;
        font-weight: 500 !important;
        line-height: 15px !important;
        text-align: center !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        vertical-align: top !important;
        transform: none !important;
        -webkit-transform: none !important;
    }
}

/* V259: manager dashboard logout actions and confirmation dialog. */
.mobile-admin-topline-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.unified-manager-logout-action {
    border-color: color-mix(in srgb, var(--danger) 34%, var(--border)) !important;
    color: var(--danger) !important;
    background: color-mix(in srgb, var(--danger-soft) 38%, var(--card)) !important;
}

.unified-manager-logout-action:hover {
    border-color: color-mix(in srgb, var(--danger) 66%, var(--border)) !important;
    color: var(--danger) !important;
    background: color-mix(in srgb, var(--danger-soft) 70%, var(--card)) !important;
}

.mobile-admin-logout-trigger {
    display: none;
}

.manager-logout-dialog[hidden] {
    display: none !important;
}

.manager-logout-dialog {
    position: fixed;
    inset: 0;
    z-index: 30000;
    display: grid;
    place-items: center;
    padding: 20px;
}

.manager-logout-dialog-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(15, 23, 42, .56);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    cursor: default;
}

.manager-logout-dialog-card {
    position: relative;
    z-index: 1;
    width: min(100%, 430px);
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: var(--card);
    color: var(--text);
    box-shadow: 0 30px 80px rgba(15, 23, 42, .28);
    text-align: center;
}

.manager-logout-dialog-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}

.manager-logout-dialog-close .app-nav-icon {
    width: 19px;
    height: 19px;
}

.manager-logout-dialog-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 16px;
    border-radius: 19px;
    background: var(--danger-soft);
    color: var(--danger);
}

.manager-logout-dialog-icon .app-nav-icon {
    width: 28px;
    height: 28px;
}

.manager-logout-dialog-card h2 {
    margin: 0 40px 10px;
    color: var(--text);
    font-size: 25px;
    font-weight: 450;
    line-height: 1.15;
    letter-spacing: -.035em;
}

.manager-logout-dialog-card p {
    margin: 0 auto;
    max-width: 340px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
}

.manager-logout-dialog-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.manager-logout-dialog-actions .button,
.manager-logout-dialog-actions .inline-form {
    flex: 1 1 0;
}

.manager-logout-dialog-actions .button {
    width: 100%;
    min-height: 44px;
}

body.manager-logout-dialog-open {
    overflow: hidden !important;
}

html[data-theme="dark"] .manager-logout-dialog-backdrop {
    background: rgba(0, 0, 0, .68);
}

@media (max-width: 900px) {
    body.route-manager:not(.so-master-shell) .mobile-admin-topline-actions {
        display: flex !important;
        gap: 7px !important;
    }

    body.route-manager:not(.so-master-shell) .mobile-admin-logout-trigger {
        display: inline-flex !important;
        flex: 0 0 42px !important;
        align-items: center !important;
        justify-content: center !important;
        width: 42px !important;
        min-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        margin: 0 !important;
        border-radius: 14px !important;
        border-color: color-mix(in srgb, var(--danger) 28%, var(--border)) !important;
        background: color-mix(in srgb, var(--danger-soft) 42%, var(--surface)) !important;
        color: var(--danger) !important;
        box-shadow: 0 7px 18px rgba(15, 23, 42, .08) !important;
    }

    body.route-manager:not(.so-master-shell) .mobile-admin-logout-trigger .app-nav-icon {
        width: 20px !important;
        height: 20px !important;
    }
}

@media (max-width: 520px) {
    body.route-manager:not(.so-master-shell) .mobile-admin-topline {
        gap: 7px !important;
    }

    body.route-manager:not(.so-master-shell) .mobile-admin-topline-title {
        font-size: clamp(18px, 5.3vw, 20px) !important;
    }

    .manager-logout-dialog {
        align-items: end;
        padding: 12px;
    }

    .manager-logout-dialog-card {
        width: 100%;
        padding: 26px 18px 18px;
        border-radius: 24px;
    }

    .manager-logout-dialog-card h2 {
        margin-left: 38px;
        margin-right: 38px;
        font-size: 23px;
    }

    .manager-logout-dialog-actions {
        gap: 8px;
    }
}


/* V264 — simplify the order service card: category/brand left, approximate price/usage right. */
@media (min-width: 901px) {
    body.is-order-edit-route .oev61-card-service > .oev61-fields.two {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(2, auto) !important;
        align-items: stretch !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-category-field {
        grid-column: 1 !important;
        grid-row: 1 !important;
        border-right: 1px solid var(--border) !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-brand-field {
        grid-column: 1 !important;
        grid-row: 2 !important;
        border-right: 1px solid var(--border) !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-price-field {
        grid-column: 2 !important;
        grid-row: 1 !important;
        align-self: stretch !important;
        border-right: 0 !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-usage-field {
        grid-column: 2 !important;
        grid-row: 2 !important;
        border-right: 0 !important;
    }
}

@media (max-width: 900px) {
    body.is-order-edit-route .oev61-card-service > .oev61-fields.two {
        display: grid !important;
        grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr) !important;
        grid-template-rows: repeat(2, auto) !important;
        align-items: stretch !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-category-field {
        grid-column: 1 !important;
        grid-row: 1 !important;
        border-right: 1px solid var(--border) !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-brand-field {
        grid-column: 1 !important;
        grid-row: 2 !important;
        border-right: 1px solid var(--border) !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-price-field {
        grid-column: 2 !important;
        grid-row: 1 !important;
        align-self: stretch !important;
        border-right: 0 !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-usage-field {
        grid-column: 2 !important;
        grid-row: 2 !important;
        border-right: 0 !important;
    }

    body.is-order-edit-route .oev61-card-service .oev245-price-field,
    body.is-order-edit-route .oev61-card-service .oev245-usage-field {
        align-content: start !important;
    }
}

/* V265 — dark theme surfaces for payment document summary and parts invoice proof gallery. */
html[data-theme="dark"] .oev232-payment-document-card .oev232-document-summary > div {
    background: #1B1B1B !important;
    border-color: #303030 !important;
    color: #f8fafc !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .oev232-payment-document-card .oev232-document-summary span {
    color: #aeb7c5 !important;
}

html[data-theme="dark"] .oev232-payment-document-card .oev232-document-summary strong {
    color: #f8fafc !important;
}

html[data-theme="dark"] .oev224-parts-card .oev149-part-proof.oev224-part-proof {
    background: #1B1B1B !important;
    border-color: #303030 !important;
    color: #e5e7eb !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .oev224-parts-card .oev149-part-proof.oev224-part-proof.is-warning {
    background: #1B1B1B !important;
    border-color: rgba(245, 158, 11, .58) !important;
}

html[data-theme="dark"] .oev224-parts-card .oev224-part-proof-main span,
html[data-theme="dark"] .oev224-parts-card .oev224-part-proof-main strong,
html[data-theme="dark"] .oev224-parts-card .oev224-part-proof-main em {
    color: #e5e7eb !important;
}

html[data-theme="dark"] .oev224-parts-card .oev224-invoice-thumb,
html[data-theme="dark"] .oev224-parts-card .oev224-invoice-file-card,
html[data-theme="dark"] .oev224-parts-card .oev224-invoice-number-chip {
    background: #111111 !important;
    border-color: #303030 !important;
    color: #e5e7eb !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .oev224-parts-card .oev224-invoice-thumb:hover,
html[data-theme="dark"] .oev224-parts-card .oev224-invoice-file-card:hover {
    background: #161616 !important;
    border-color: rgba(96, 165, 250, .58) !important;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .28) !important;
}

html[data-theme="dark"] .oev224-parts-card .oev224-invoice-thumb span,
html[data-theme="dark"] .oev224-parts-card .oev224-invoice-file-card span,
html[data-theme="dark"] .oev224-parts-card .oev224-invoice-number-chip {
    color: #b8b8b8 !important;
}



/* V271: payment document is available only for orders with document type = invoice. */
.oev271-payment-document-head {
    gap: 12px;
}

.oev271-payment-document-head-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.oev271-payment-document-toggle {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
}

.oev271-payment-document-toggle span {
    display: block;
    font-size: 22px;
    line-height: 1;
    transition: transform .18s ease;
}

.oev271-payment-document-toggle[aria-expanded="true"] span {
    transform: rotate(180deg);
}

.oev271-payment-document-toggle:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.oev271-payment-document-card.is-inactive {
    border-style: dashed;
}

.oev271-payment-document-card.is-inactive .oev61-card-head {
    background: color-mix(in srgb, var(--card) 86%, var(--muted) 14%);
}

.oev271-payment-document-body[hidden] {
    display: none !important;
}

.oev271-paid-total-field input[readonly] {
    font-weight: 450;
    cursor: default;
}

.oev271-paid-total-field small {
    color: var(--muted);
}

html[data-theme="dark"] .oev271-payment-document-toggle,
html[data-theme="dark"] .oev271-payment-document-card.is-inactive .oev61-card-head {
    background: #1B1B1B;
}

@media (max-width: 700px) {
    .oev271-payment-document-head-actions {
        gap: 5px;
    }

    .oev271-payment-document-head-actions .oev61-card-smallnote {
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* V392: desktop order payment document card spacing matches the other compact side blocks. */
@media (min-width: 901px) {
    body.is-order-edit-route .oev112-page .oev61-side .oev232-payment-document-card .oev271-payment-document-body:not([hidden]) {
        display: grid;
        gap: 12px;
        padding: 12px 14px 14px;
    }

    body.is-order-edit-route .oev112-page .oev61-side .oev232-payment-document-card .oev232-document-form-grid,
    body.is-order-edit-route .oev112-page .oev61-side .oev232-payment-document-card .oev232-document-actions {
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: stretch;
    }

    body.is-order-edit-route .oev112-page .oev61-side .oev232-payment-document-card .oev61-field,
    body.is-order-edit-route .oev112-page .oev61-side .oev232-payment-document-card .oev233-price-preview {
        width: 100%;
        min-width: 0;
    }

    body.is-order-edit-route .oev112-page .oev61-side .oev232-payment-document-card .oev61-field {
        min-height: 58px;
        padding: 10px 12px;
        border: 1px solid var(--border);
        border-radius: 13px;
        background: var(--input);
    }

    body.is-order-edit-route .oev112-page .oev61-side .oev232-payment-document-card .oev61-field input,
    body.is-order-edit-route .oev112-page .oev61-side .oev232-payment-document-card .oev61-field select,
    body.is-order-edit-route .oev112-page .oev61-side .oev232-payment-document-card .oev61-field textarea,
    body.is-order-edit-route .oev112-page .oev61-side .oev232-payment-document-card .oev232-document-comment,
    body.is-order-edit-route .oev112-page .oev61-side .oev232-payment-document-card .oev232-document-email {
        width: 100%;
        min-height: 38px;
        padding: 8px 10px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        box-shadow: none;
    }

    body.is-order-edit-route .oev112-page .oev61-side .oev232-payment-document-card .oev61-field textarea,
    body.is-order-edit-route .oev112-page .oev61-side .oev232-payment-document-card .oev232-document-comment {
        min-height: 86px;
        resize: vertical;
    }

    body.is-order-edit-route .oev112-page .oev61-side .oev232-payment-document-card .oev232-document-note {
        margin: 0;
        padding: 0 2px;
    }

    body.is-order-edit-route .oev112-page .oev61-side .oev232-payment-document-card .button {
        width: 100%;
        min-height: 40px !important;
        height: auto !important;
        padding: 8px 12px !important;
        justify-content: center;
        border-radius: 12px;
        font-weight: 450;
    }
}

/* === QA restyle 2026-06-17: единое умеренное скругление кнопок (перекрывает покомпонентные pill-формы) === */
.button,
.link-button,
button.button,
a.button,
input[type="submit"],
input[type="button"] {
    border-radius: 12px !important;
}

/* === QA restyle 2026-06-17: умеренное скругление прямоугольных кнопок (тулбар/primary/действия), точные селекторы === */
body.so-app:not(.so-master-shell):not(.so-auth-shell) .unified-module-topbar-actions .button,
body.route-manager:not(.so-master-shell) .page-header .actions-row .button,
body.is-order-edit-route .unified-order-list-action,
body.is-order-edit-route .unified-order-status-select,
body.so-master-shell .button.button-primary.button-wide,
body.route-tickets:not(.so-master-shell) .hc-tasks-new-order-action,
body.so-master-shell .master-signature-save-top,
body.so-master-shell .master-old-payment-kind span {
    border-radius: 12px !important;
}

/* === QA restyle 2026-06-17: локальный шрифт Inter (latin / latin-ext / cyrillic) === */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/inter/inter-cyrillic-wght-normal.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/inter/inter-latin-ext-wght-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('../fonts/inter/inter-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* финальный override: использовать Inter везде (перекрывает системные :root --font из V81/V84) */
:root {
    --font: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
body, body.so-app {
    font-family: var(--font);
}

/* === QA restyle 2026-06-17: компактнее кнопки на десктопе (как на эталоне), мобильные не трогаем === */
@media (min-width: 901px) {
    body.so-app .button,
    body.so-app .link-button,
    body.so-app button.button,
    body.so-app a.button {
        min-height: 34px !important;
        padding: 0 13px !important;
        font-size: 13px !important;
    }
    body.so-app .button-primary {
        font-weight: 700 !important;
    }
    body.so-app .button-small {
        min-height: 30px !important;
        padding: 0 11px !important;
        font-size: 12.5px !important;
    }
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .unified-module-topbar-actions .button,
    body.route-manager:not(.so-master-shell) .page-header .actions-row .button,
    body.is-order-edit-route .unified-order-list-action,
    body.is-order-edit-route .unified-order-status-select,
    body.route-tickets:not(.so-master-shell) .hc-tasks-new-order-action {
        min-height: 34px !important;
        height: 34px !important;
        padding: 0 14px !important;
        font-size: 13px !important;
    }
    body.so-app .orders-top-button {
        min-height: 34px !important;
        height: 34px !important;
        padding: 0 13px !important;
        font-size: 13px !important;
    }
}

/* === QA restyle 2026-06-17: единый аккуратный шеврон на выпадающих списках (как на эталоне) === */
body.so-app .ai-parts-page select:not([multiple]):not([size]),
body.so-app .settings-page select:not([multiple]):not([size]),
body.route-settings select:not([multiple]):not([size]) {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 11px center !important;
    background-size: 15px 15px !important;
    padding-right: 32px !important;
}

/* шеврон для тёмной темы (светлый, чтобы был виден на тёмном фоне) */
html[data-theme="dark"] body.so-app .ai-parts-page select:not([multiple]):not([size]),
html[data-theme="dark"] body.so-app .settings-page select:not([multiple]):not([size]),
html[data-theme="dark"] body.route-settings select:not([multiple]):not([size]) {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>") !important;
}

/* Service Orders V2 — V293 OpenAI settings panel */
body.route-settings .settings-openai-panel {
    overflow: hidden;
}

body.route-settings .settings-openai-header {
    align-items: flex-start;
    gap: 16px;
}

body.route-settings .settings-openai-header h2 {
    margin-top: 4px;
}

body.route-settings .settings-openai-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 450;
    line-height: 1;
    white-space: nowrap;
}

body.route-settings .settings-openai-status.is-ready {
    border-color: color-mix(in srgb, #16a34a 42%, var(--border));
    background: color-mix(in srgb, #16a34a 12%, var(--card));
    color: #15803d;
}

body.route-settings .settings-openai-status.is-empty {
    border-color: color-mix(in srgb, #d97706 40%, var(--border));
    background: color-mix(in srgb, #d97706 11%, var(--card));
    color: #b45309;
}

body.route-settings .settings-openai-security-note {
    display: grid;
    gap: 5px;
    margin: 0 20px 18px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
    border-radius: 14px;
    background: color-mix(in srgb, var(--primary-soft) 48%, var(--card));
}

body.route-settings .settings-openai-security-note strong {
    color: var(--text);
    font-size: 13px;
}

body.route-settings .settings-openai-security-note p,
body.route-settings .settings-openai-security-note small {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

body.route-settings .settings-openai-security-note code {
    color: var(--text);
    overflow-wrap: anywhere;
}

body.route-settings .settings-openai-form {
    padding: 0 20px 20px;
}

body.route-settings .settings-openai-toggle-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

body.route-settings .settings-openai-toggle-card {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card-2);
    cursor: pointer;
}

body.route-settings .settings-openai-toggle-card input {
    width: 18px;
    height: 18px;
    min-height: 18px;
    margin-top: 1px;
    accent-color: var(--primary);
}

body.route-settings .settings-openai-toggle-card span {
    display: grid;
    gap: 4px;
    min-width: 0;
}

body.route-settings .settings-openai-toggle-card strong {
    color: var(--text);
    font-size: 13px;
    line-height: 1.25;
}

body.route-settings .settings-openai-toggle-card small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

body.route-settings .settings-openai-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px 16px;
}

body.route-settings .settings-openai-field-wide {
    grid-column: 1 / -1;
}

body.route-settings .settings-openai-actions {
    padding-top: 16px;
}

body.route-settings .settings-openai-secondary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 20px 20px;
    border-top: 1px solid var(--border);
    margin-top: 0;
    padding-top: 16px;
}

body.route-settings .settings-openai-secondary-actions form {
    margin: 0;
}

body.route-settings .settings-openai-secondary-actions .button:disabled {
    cursor: not-allowed;
    opacity: .5;
}

html[data-theme="dark"] body.route-settings .settings-openai-status.is-ready {
    color: #86efac;
}

html[data-theme="dark"] body.route-settings .settings-openai-status.is-empty {
    color: #fdba74;
}

html[data-theme="dark"] body.route-settings .settings-openai-security-note,
html[data-theme="dark"] body.route-settings .settings-openai-toggle-card {
    background: #242424;
    border-color: #333333;
}

@media (max-width: 760px) {
    body.route-settings .settings-openai-header {
        display: grid;
    }

    body.route-settings .settings-openai-status {
        justify-self: start;
    }

    body.route-settings .settings-openai-security-note {
        margin: 0 12px 14px;
    }

    body.route-settings .settings-openai-form {
        padding: 0 12px 14px;
    }

    body.route-settings .settings-openai-toggle-grid,
    body.route-settings .settings-openai-grid {
        grid-template-columns: 1fr;
    }

    body.route-settings .settings-openai-field-wide {
        grid-column: auto;
    }

    body.route-settings .settings-openai-secondary-actions {
        display: grid;
        padding: 14px 12px 16px;
    }

    body.route-settings .settings-openai-secondary-actions .button {
        width: 100%;
    }
}

/* V294 — informational AI parts search */
.ai-parts-page{display:flex;flex-direction:column;gap:18px;min-width:0}.ai-parts-page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.ai-parts-page-head h1{margin:4px 0 6px;font-size:30px;line-height:1.1;letter-spacing:-.04em}.ai-parts-page-head p{margin:0;max-width:850px;color:var(--muted);line-height:1.55}.ai-parts-kicker{display:inline-flex;padding:5px 10px;border:1px solid var(--border);border-radius:999px;font-size:11px;font-weight: 450;letter-spacing:.08em;color:var(--primary);background:var(--surface)}.ai-parts-back{display:inline-flex;margin-bottom:8px;color:var(--muted);font-weight:700;text-decoration:none}.ai-parts-title-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.ai-parts-banner{display:flex;align-items:center;gap:10px;padding:13px 16px;border-radius:14px;border:1px solid var(--border);background:var(--surface);line-height:1.45}.ai-parts-banner.is-warning{border-color:#f59e0b55;background:#f59e0b12;color:#b45309}.ai-parts-banner.is-info{border-color:#3b82f655;background:#3b82f612}.ai-parts-filters{display:grid;grid-template-columns:minmax(240px,1fr) minmax(180px,240px) auto;gap:12px;align-items:end;padding:16px;border:1px solid var(--border);border-radius:16px;background:var(--surface)}.ai-parts-filters label,.ai-parts-field{display:flex;flex-direction:column;gap:7px}.ai-parts-filters label>span,.ai-parts-field>span,.ai-parts-upload-more-form label>span{font-size:13px;font-weight:700;color:var(--muted)}.ai-parts-filters input,.ai-parts-filters select,.ai-parts-field input,.ai-parts-field select,.ai-parts-field textarea,.ai-parts-upload-more-form input,.ai-parts-upload-more-form select{width:100%;border:1px solid var(--border);border-radius:12px;background:var(--input-bg,var(--surface));color:var(--text);padding:11px 13px;font:inherit}.ai-parts-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.ai-parts-card{display:flex;flex-direction:column;gap:10px;min-width:0;padding:17px;border:1px solid var(--border);border-radius:18px;background:var(--surface);color:var(--text);text-decoration:none;box-shadow:var(--shadow-sm,0 8px 24px rgba(15,23,42,.05));transition:transform .16s ease,border-color .16s ease}.ai-parts-card:hover{transform:translateY(-2px);border-color:#3b82f688}.ai-parts-card-top,.ai-parts-card footer,.ai-parts-card-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.ai-parts-card h2{margin:0;font-size:18px;line-height:1.35}.ai-parts-card small,.ai-parts-card footer span,.ai-parts-device{color:var(--muted)}.ai-parts-device{margin:0}.ai-parts-card-meta{justify-content:flex-start}.ai-parts-card-meta span{padding:5px 8px;border-radius:999px;background:var(--surface-2,#f1f5f9);font-size:12px}.ai-parts-status{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;font-size:12px;font-weight: 450;background:#64748b20;color:#475569}.ai-parts-status.is-completed{background:#16a34a20;color:#15803d}.ai-parts-status.is-failed{background:#dc262620;color:#b91c1c}.ai-parts-status.is-queued,.ai-parts-status.is-analyzing,.ai-parts-status.is-searching{background:#2563eb20;color:#1d4ed8}.ai-parts-status.is-needs_clarification{background:#f59e0b22;color:#b45309}.ai-parts-empty,.ai-parts-empty-inline{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:28px;border:1px dashed var(--border);border-radius:18px;background:var(--surface)}.ai-parts-empty-inline{padding:18px}.ai-parts-empty p,.ai-parts-empty-inline span{margin:0;color:var(--muted)}.ai-parts-form{display:flex;flex-direction:column;gap:16px}.ai-parts-form-card{min-width:0;padding:18px;border:1px solid var(--border);border-radius:18px;background:var(--surface);box-shadow:var(--shadow-sm,0 8px 24px rgba(15,23,42,.04))}.ai-parts-form-card h2{margin:0 0 14px;font-size:19px}.ai-parts-card-heading-row{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:14px}.ai-parts-card-heading-row h2{margin:0 0 4px}.ai-parts-card-heading-row p{margin:0;color:var(--muted)}.ai-parts-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.ai-parts-field.full,.ai-parts-country-grid.full,.ai-parts-form-actions.full{grid-column:1/-1}.ai-parts-check-field{flex-direction:row;align-items:center;gap:10px;min-height:46px;padding:11px 13px;border:1px solid var(--border);border-radius:12px}.ai-parts-check-field input{width:auto}.ai-parts-country-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.ai-parts-country-grid label{display:flex;align-items:center;gap:8px;padding:10px;border:1px solid var(--border);border-radius:12px}.ai-parts-upload-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.ai-parts-upload-tile{display:flex;flex-direction:column;gap:7px;min-height:150px;padding:15px;border:1px dashed #3b82f680;border-radius:16px;background:#3b82f608;cursor:pointer}.ai-parts-upload-tile span{color:var(--muted);font-size:13px;line-height:1.4}.ai-parts-upload-tile input{margin-top:auto;max-width:100%}.ai-parts-form-actions{display:flex;justify-content:flex-end;gap:10px}.ai-parts-show-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:16px;align-items:start}.ai-parts-show-main,.ai-parts-show-side{display:flex;flex-direction:column;gap:16px;min-width:0}.ai-parts-summary-list{display:flex;flex-direction:column;margin:0}.ai-parts-summary-list>div{display:grid;grid-template-columns:minmax(120px,.55fr) minmax(0,1fr);gap:12px;padding:10px 0;border-bottom:1px solid var(--border)}.ai-parts-summary-list>div:last-child{border-bottom:0}.ai-parts-summary-list dt{color:var(--muted);font-weight:700}.ai-parts-summary-list dd{margin:0;overflow-wrap:anywhere}.ai-parts-image-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.ai-parts-image-card{position:relative;overflow:hidden;margin:0;border:1px solid var(--border);border-radius:14px;background:var(--surface-2,#f8fafc)}.ai-parts-image-card>a{display:flex;align-items:center;justify-content:center;aspect-ratio:4/3;background:#0f172a0a}.ai-parts-image-card img{width:100%;height:100%;object-fit:cover}.ai-parts-image-card figcaption{display:flex;flex-direction:column;gap:2px;padding:10px}.ai-parts-image-card figcaption small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted)}.ai-parts-image-delete{position:absolute;top:7px;right:7px;width:30px;height:30px;border:0;border-radius:999px;background:#111827dd;color:#fff;font-size:20px;line-height:1;cursor:pointer}.ai-parts-heic-placeholder{display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-weight: 450;color:#64748b}.ai-parts-upload-more-form{display:grid;grid-template-columns:minmax(180px,.5fr) minmax(240px,1fr) auto;gap:12px;align-items:end;margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}.ai-parts-upload-more-form label{display:flex;flex-direction:column;gap:7px}.ai-parts-events{display:flex;flex-direction:column}.ai-parts-events article{display:flex;flex-direction:column;gap:4px;padding:10px 0;border-bottom:1px solid var(--border)}.ai-parts-events article:last-child{border-bottom:0}.ai-parts-events small,.ai-parts-muted{color:var(--muted)}.ai-parts-order-link{margin-left:auto}.ai-parts-results-list{display:flex;flex-direction:column;gap:10px}.ai-parts-results-list article{padding:14px;border:1px solid var(--border);border-radius:14px}.ai-parts-results-list h3{margin:0 0 6px}.ai-parts-results-list a{overflow-wrap:anywhere}
html[data-theme="dark"] .ai-parts-card-meta span,html[data-theme="dark"] .ai-parts-image-card{background:#ffffff0a}.so-master-shell .ai-parts-page{padding:12px 12px 100px}.so-master-shell .ai-parts-page-head h1{font-size:24px}.so-master-shell .ai-parts-form-card{border-radius:18px}
@media(max-width:1180px){.ai-parts-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ai-parts-upload-grid,.ai-parts-image-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ai-parts-show-layout{grid-template-columns:1fr}.ai-parts-show-side{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){.ai-parts-page{gap:12px}.ai-parts-page-head{flex-direction:column}.ai-parts-page-head>.button{width:100%}.ai-parts-page-head h1{font-size:25px}.ai-parts-filters,.ai-parts-form-grid,.ai-parts-upload-more-form{grid-template-columns:1fr}.ai-parts-grid,.ai-parts-upload-grid,.ai-parts-image-grid,.ai-parts-show-side{grid-template-columns:1fr}.ai-parts-country-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ai-parts-form-card{padding:14px}.ai-parts-form-actions{position:sticky;bottom:78px;z-index:5;padding:10px;border:1px solid var(--border);border-radius:16px;background:color-mix(in srgb,var(--surface) 94%,transparent);backdrop-filter:blur(10px)}.ai-parts-form-actions .button{flex:1}.ai-parts-summary-list>div{grid-template-columns:110px minmax(0,1fr)}.ai-parts-order-link{margin-left:0}.oev224-parts-head{flex-wrap:wrap}.oev224-parts-head .oev149-invoice-check{width:100%}}

.ai-parts-order-actions{display:flex;align-items:center;gap:8px;margin-left:auto;flex-wrap:wrap}

/* V295 — OpenAI execution, verified links and background status */
.ai-parts-execution-card{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 18px;border:1px solid #3b82f655;border-radius:18px;background:linear-gradient(135deg,#3b82f612,#8b5cf60a)}
.ai-parts-execution-copy{display:flex;flex-direction:column;gap:5px;min-width:0}.ai-parts-execution-copy strong{font-size:17px}.ai-parts-execution-copy span{color:var(--muted);line-height:1.45}
.ai-parts-run-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;flex-shrink:0}
.ai-parts-recognition-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.ai-parts-recognition-grid>div{display:flex;flex-direction:column;gap:5px;padding:12px;border:1px solid var(--border);border-radius:13px;background:var(--surface-2,#f8fafc)}.ai-parts-recognition-grid span{font-size:12px;font-weight:700;color:var(--muted)}.ai-parts-recognition-grid strong{overflow-wrap:anywhere}.ai-parts-recognition-description{margin:12px 0 0;line-height:1.55;color:var(--muted)}
.ai-parts-results-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.ai-parts-results-list .ai-parts-result-card{display:flex;flex-direction:column;gap:11px;min-width:0;padding:15px;border:1px solid var(--border);border-radius:16px;background:var(--surface-2,#f8fafc)}.ai-parts-result-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.ai-parts-result-head h3{margin:6px 0 0;font-size:17px;line-height:1.35}.ai-parts-match{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:11px;font-weight: 450;background:#64748b20;color:#475569}.ai-parts-match.is-exact{background:#16a34a20;color:#15803d}.ai-parts-match.is-high_probability{background:#2563eb20;color:#1d4ed8}.ai-parts-match.is-possible_analog{background:#f59e0b22;color:#b45309}.ai-parts-match.is-manual_review{background:#64748b20;color:#475569}.ai-parts-confidence{white-space:nowrap;font-size:18px;color:var(--primary)}
.ai-parts-result-meta,.ai-parts-result-notes{display:flex;gap:7px;flex-wrap:wrap}.ai-parts-result-meta span,.ai-parts-result-notes span{display:inline-flex;padding:5px 8px;border-radius:999px;background:var(--surface);border:1px solid var(--border);font-size:12px;color:var(--muted)}.ai-parts-result-price{font-size:22px;font-weight: 450;letter-spacing:-.03em}.ai-parts-result-card p{margin:0;line-height:1.5}.ai-parts-result-warnings{margin:0;padding-left:20px;color:#b45309;line-height:1.45}.ai-parts-result-card>.button{align-self:flex-start;margin-top:auto}
html[data-theme="dark"] .ai-parts-recognition-grid>div,html[data-theme="dark"] .ai-parts-results-list .ai-parts-result-card{background:#ffffff08}
@media(max-width:900px){.ai-parts-results-list{grid-template-columns:1fr}}
@media(max-width:720px){.ai-parts-execution-card{align-items:stretch;flex-direction:column;padding:14px}.ai-parts-run-actions{display:grid;grid-template-columns:1fr}.ai-parts-run-actions .button{width:100%}.ai-parts-recognition-grid{grid-template-columns:1fr}.ai-parts-result-head{gap:8px}.ai-parts-result-card>.button{width:100%}}

/* V297: AI parts hybrid AJAX progress and result refresh */
.ai-parts-execution-copy{flex:1}.ai-parts-progress-wrap{display:flex;flex-direction:column;gap:7px;margin-top:7px;max-width:760px}.ai-parts-progress-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px}.ai-parts-progress-meta span{color:var(--muted);font-weight:700}.ai-parts-progress-meta strong{color:var(--text);font-size:13px}.ai-parts-progress-track{position:relative;overflow:hidden;height:10px;border-radius:999px;background:var(--surface-2,#e2e8f0);box-shadow:inset 0 0 0 1px rgba(100,116,139,.14)}.ai-parts-progress-track>span{display:block;position:relative;height:100%;min-width:0;border-radius:inherit;background:linear-gradient(90deg,#2563eb,#7c3aed);transition:width .35s ease}.ai-parts-progress-track>span::after{content:"";position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(90deg,transparent,rgba(255,255,255,.42),transparent);animation:ai-parts-progress-shimmer 1.8s linear infinite}.ai-parts-progress-time{font-size:12px;color:var(--muted)}.ai-parts-progress-time strong{color:var(--text)}.ai-parts-ajax-error{margin-top:6px;padding:9px 11px;border:1px solid #dc262655;border-radius:10px;background:#dc262612;color:#b91c1c;font-size:13px;line-height:1.4}.ai-parts-execution-card.is-failed{border-color:#dc262655;background:#dc26260b}.ai-parts-execution-card.is-completed{border-color:#16a34a55;background:#16a34a0b}.ai-parts-result-card.is-ajax-new{animation:ai-parts-result-highlight 3s ease}.ai-parts-run-actions button:disabled{cursor:not-allowed;opacity:.68}@keyframes ai-parts-progress-shimmer{to{transform:translateX(100%)}}@keyframes ai-parts-result-highlight{0%{box-shadow:0 0 0 0 rgba(37,99,235,.55);transform:translateY(0)}25%{box-shadow:0 0 0 6px rgba(37,99,235,.14);transform:translateY(-2px)}100%{box-shadow:0 0 0 0 rgba(37,99,235,0);transform:translateY(0)}}html[data-theme="dark"] .ai-parts-progress-track{background:#ffffff12}html[data-theme="dark"] .ai-parts-ajax-error{color:#fca5a5}@media(max-width:720px){.ai-parts-progress-wrap{width:100%}}

/* V306: detailed local AI parts-search progress. No additional AI/API calls. */
.ai-parts-progress-details{display:grid;grid-template-columns:minmax(220px,2fr) repeat(5,minmax(105px,1fr));gap:8px;margin-top:10px}
.ai-parts-progress-detail{display:flex;min-width:0;flex-direction:column;gap:3px;padding:8px 10px;border:1px solid color-mix(in srgb,var(--border) 78%,transparent);border-radius:10px;background:color-mix(in srgb,var(--surface) 88%,transparent)}
.ai-parts-progress-detail.is-operation{grid-column:auto}.ai-parts-progress-detail.is-fallback{grid-column:1/-1;border-color:#f59e0b55;background:#f59e0b0d}
.ai-parts-progress-detail>span{font-size:10px;line-height:1.2;text-transform:uppercase;letter-spacing:.055em;color:var(--muted);font-weight: 450}
.ai-parts-progress-detail>strong{min-width:0;overflow-wrap:anywhere;color:var(--text);font-size:12px;line-height:1.35}
.ai-parts-progress-events{display:flex;flex-direction:column;gap:0;margin-top:9px;max-height:184px;overflow:auto;border-top:1px solid color-mix(in srgb,var(--border) 70%,transparent)}
.ai-parts-progress-event{display:grid;grid-template-columns:10px minmax(0,1fr);gap:8px;padding:8px 2px;border-bottom:1px solid color-mix(in srgb,var(--border) 55%,transparent)}
.ai-parts-progress-event-dot{width:7px;height:7px;margin-top:5px;border-radius:50%;background:var(--primary,#2563eb);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary,#2563eb) 16%,transparent)}
.ai-parts-progress-event>div{display:flex;min-width:0;flex-direction:column;gap:2px}.ai-parts-progress-event strong{font-size:12px;line-height:1.35;color:var(--text)}.ai-parts-progress-event small{font-size:10px;line-height:1.35;color:var(--muted);overflow-wrap:anywhere}
.ai-parts-progress-events-empty{margin:0;padding:9px 2px;color:var(--muted);font-size:11px}
.ai-parts-progress-technical{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:8px;padding:8px 10px;border-radius:9px;background:color-mix(in srgb,var(--surface-2,#e2e8f0) 70%,transparent);font-size:10px;color:var(--muted)}
.ai-parts-progress-technical strong{color:var(--text);font-size:11px}
html[data-theme="dark"] .ai-parts-progress-detail{background:#ffffff08;border-color:#ffffff14}html[data-theme="dark"] .ai-parts-progress-detail.is-fallback{background:#f59e0b12;border-color:#f59e0b44}html[data-theme="dark"] .ai-parts-progress-events{border-color:#ffffff12}html[data-theme="dark"] .ai-parts-progress-event{border-color:#ffffff0d}html[data-theme="dark"] .ai-parts-progress-technical{background:#ffffff08}
@media(max-width:1100px){.ai-parts-progress-details{grid-template-columns:repeat(3,minmax(120px,1fr))}.ai-parts-progress-detail.is-operation{grid-column:1/-1}}
@media(max-width:720px){.ai-parts-progress-details{grid-template-columns:repeat(2,minmax(0,1fr))}.ai-parts-progress-detail.is-operation,.ai-parts-progress-detail.is-fallback{grid-column:1/-1}.ai-parts-progress-events{max-height:220px}.ai-parts-progress-technical{display:grid;grid-template-columns:1fr 1fr}}

/* === FIX 2026-06-22: единый чеврон у select без повторения (правка тайлинга в тёмной теме) === */
body.so-app .ai-parts-page select:not([multiple]):not([size]),
body.so-app .settings-page select:not([multiple]):not([size]),
body.route-settings select:not([multiple]):not([size]) {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 15px 15px !important;
    padding-right: 34px !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>") !important;
}
html[data-theme="dark"] body.so-app .ai-parts-page select:not([multiple]):not([size]),
html[data-theme="dark"] body.so-app .settings-page select:not([multiple]):not([size]),
html[data-theme="dark"] body.route-settings select:not([multiple]):not([size]) {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 15px 15px !important;
}

/* === FIX 2026-06-22: тёмный фон выпадающего списка <option> === */
html[data-theme="dark"] select option,
html[data-theme="dark"] select optgroup { background-color: #0e1b2a !important; color: #e5edf7 !important; }
html[data-theme="dark"] select { color: var(--text) !important; }

/* === FIX 2026-06-22: кнопка «свернуть» на карточке AI-поиска === */
.ai-parts-card-wrap{position:relative;display:flex;min-width:0}
.ai-parts-card-wrap>.ai-parts-card{flex:1 1 auto;width:100%}
.ai-parts-card-wrap .ai-parts-card-top{padding-right:32px}
.ai-parts-card-archive{position:absolute;top:11px;right:12px;z-index:2;margin:0;line-height:0}
.ai-parts-card-archive button{width:26px;height:26px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:1px solid var(--border);border-radius:8px;background:var(--card);color:var(--muted);font-size:14px;line-height:1;cursor:pointer;transition:color .15s ease,border-color .15s ease}
.ai-parts-card-archive button:hover{color:var(--text);border-color:var(--primary)}

/* === FIX 2026-06-22: таблица контрагентов — не сжимать колонки, горизонтальный скролл === */
.contractor-v171-page .reports-v99-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.contractor-v171-page .reports-v99-table{width:max-content;min-width:100%}
.contractor-v171-page .reports-v99-table th,
.contractor-v171-page .reports-v99-table td{white-space:nowrap}
.contractor-v171-page .reports-v99-table th:first-child,
.contractor-v171-page .reports-v99-table td:first-child{white-space:normal;max-width:240px}

/* V418 contractors table: readable compact headers and separated name/email. */
.contractor-v171-page .reports-v99-table th {
    white-space: normal !important;
    vertical-align: bottom;
    line-height: 1.12;
}

.contractor-v171-page .contractors-v418-th {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    line-height: 1.08;
}

.contractor-v171-page .contractors-v418-person {
    min-width: 150px;
    max-width: 230px;
}

.contractor-v171-page .contractors-v418-person strong,
.contractor-v171-page .contractors-v418-person small {
    display: block;
    min-width: 0;
}

.contractor-v171-page .contractors-v418-person strong {
    line-height: 1.2;
}

.contractor-v171-page .contractors-v418-person small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.15;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.contractor-v171-page .reports-v99-table th:nth-child(3),
.contractor-v171-page .reports-v99-table th:nth-child(4),
.contractor-v171-page .reports-v99-table th:nth-child(6),
.contractor-v171-page .reports-v99-table th:nth-child(7),
.contractor-v171-page .reports-v99-table th:nth-child(8),
.contractor-v171-page .reports-v99-table th:nth-child(9),
.contractor-v171-page .reports-v99-table th:nth-child(11) {
    min-width: 96px;
}

.contractor-v171-page .contractors-v420-click-row {
    cursor: pointer;
    transition: background-color .15s ease;
}

.contractor-v171-page .contractors-v420-click-row:hover,
.contractor-v171-page .contractors-v420-click-row:focus {
    background: color-mix(in srgb, var(--primary) 7%, transparent);
    outline: none;
}

@media (max-width: 720px) {
    .contractor-v171-page .reports-v99-table th,
    .contractor-v171-page .reports-v99-table td {
        padding-inline: 12px;
    }

    .contractor-v171-page .contractors-v418-person {
        min-width: 130px;
        max-width: 180px;
    }
}

/* V419 contractor card: styled balance cards and no duplicate desktop title. */
.contractor-v419-show-page {
    display: grid;
    gap: 16px;
}

.contractor-v419-show-page .reports-v99-hero.compact {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
}

.contractor-v419-show-page .reports-v99-hero.compact > div {
    min-width: 0;
}

.contractor-v419-show-page .reports-v99-hero.compact p {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    line-height: 1.45;
}

.contractor-v419-balance-panel > header,
.contractor-v419-history-panel > header {
    align-items: center;
}

.contractor-v419-balance-panel .reports-v99-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 18px 20px 20px;
}

.contractor-v419-balance-panel .reports-v99-kpi-grid > div {
    min-width: 0;
    min-height: 78px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--card-2) 78%, transparent);
    padding: 14px 16px;
}

.contractor-v419-balance-panel .reports-v99-kpi-grid span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 450;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.contractor-v419-balance-panel .reports-v99-kpi-grid strong {
    display: block;
    color: var(--text);
    font-size: 20px;
    font-weight: 450;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.contractor-v419-balance-panel .reports-v99-kpi-grid > div:first-child strong,
.contractor-v419-balance-panel .reports-v99-kpi-grid > div:nth-child(6) strong {
    color: var(--primary);
}

.contractor-v419-balance-panel .reports-v99-cash-form {
    border-top: 1px solid var(--border);
    border-bottom: 0;
}

.contractor-v419-history-panel .reports-v99-table-wrap {
    padding-top: 12px;
}

.contractor-v419-history-panel .reports-v99-table {
    min-width: 1180px;
}

@media (min-width: 901px) {
    .contractor-v419-show-page .contractor-v419-title {
        display: none;
    }
}

@media (max-width: 900px) {
    .contractor-v419-show-page {
        gap: 12px;
    }

    .contractor-v419-show-page .reports-v99-hero.compact {
        display: grid;
        gap: 14px;
    }

    .contractor-v419-show-page .contractor-v419-title {
        margin: 0;
        font-size: 30px;
        line-height: 1.08;
        font-weight: 450;
    }

    .contractor-v419-show-page .reports-v99-hero.compact p {
        font-size: 16px;
        line-height: 1.35;
    }

    .contractor-v419-balance-panel > header,
    .contractor-v419-history-panel > header {
        align-items: flex-start;
    }

    .contractor-v419-balance-panel .reports-v99-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 14px;
    }

    .contractor-v419-balance-panel .reports-v99-kpi-grid > div {
        min-height: 74px;
        padding: 12px;
    }

    .contractor-v419-balance-panel .reports-v99-kpi-grid strong {
        font-size: 18px;
    }
}

/* === V313.2 master DESKTOP fixes (mobile unchanged) === */
@media (min-width: 768px) {
  /* "faktura/NIP" checkbox must stay small, not stretch */
  body.so-master-shell .master-v149-invoice-check {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
  }
  body.so-master-shell .master-v149-invoice-check > input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    flex: 0 0 20px !important;
    margin: 0 !important;
    accent-color: var(--primary);
  }
  body.so-master-shell .master-v149-invoice-check > span { flex: 1 1 auto !important; }

  /* bottom nav: single centered row on desktop (mobile keeps its own rules) */
  body.so-master-shell .master-bottom-nav,
  body.so-master-shell .master-bottom-nav-v134 {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    grid-template-columns: none !important;
    max-width: 920px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow-x: auto !important;
  }
  body.so-master-shell .master-bottom-nav a,
  body.so-master-shell .master-bottom-nav-v134 a { flex: 0 0 auto !important; min-width: 64px !important; }
}

/* V327: enlarge the saved client signature preview window on master order pages. */
body.so-master-shell #signature .master-signature-preview-button {
    width: 100% !important;
    max-width: none !important;
    height: clamp(230px, 34dvh, 320px) !important;
    min-height: 230px !important;
    max-height: none !important;
}

body.so-master-shell #signature .master-signature-preview-button img,
body.so-master-shell #signature .master-mobile-signature-preview {
    max-height: none !important;
}

/* V340: mobile admin centered new-order button, visually tucked under the existing bottom menu. */
.mobile-admin-new-order-peek {
    display: none;
}

@media (max-width: 900px) {
    body.role-admin.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-new-order-peek {
        position: fixed;
        left: 50%;
        bottom: calc(56px + env(safe-area-inset-bottom, 0px));
        z-index: 89;
        display: grid;
        width: 68px;
        height: 68px;
        place-items: center;
        border: 1px solid color-mix(in srgb, var(--primary) 72%, #ffffff);
        border-radius: 999px;
        background: var(--primary);
        box-shadow: 0 18px 32px rgba(37, 99, 235, 0.34);
        color: #ffffff;
        font-size: 42px;
        font-weight: 650;
        line-height: 1;
        transform: translateX(-50%);
        -webkit-transform: translateX(-50%);
    }

    body.role-admin.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-new-order-peek span {
        display: block;
        height: 46px;
        line-height: 42px;
        transform: translateY(-1px);
        -webkit-transform: translateY(-1px);
    }

    html[data-theme="dark"] body.role-admin.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-new-order-peek {
        border-color: color-mix(in srgb, var(--primary) 78%, #111111);
        box-shadow: 0 18px 34px rgba(0, 0, 0, 0.44);
    }
}

/* V343: Android WebView/admin mobile safe-area and Push settings cleanup. */
@media (max-width: 900px) {
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .desktop-shell {
        padding-top: env(safe-area-inset-top, 0px) !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-brand-row {
        padding-top: max(14px, env(safe-area-inset-top, 0px)) !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-topline {
        min-height: 48px !important;
        align-items: center !important;
    }
}

body.route-settings #push-notifications .settings-push-device-card {
    display: grid;
    gap: 14px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--card) 92%, var(--bg));
}

body.route-settings #push-notifications .settings-push-device-card[hidden] {
    display: none !important;
}

body.route-settings #push-notifications .settings-push-device-head,
body.route-settings #push-notifications .settings-push-device-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

body.route-settings #push-notifications .settings-push-device-head h3 {
    margin: 0 0 6px;
    font-size: 20px;
    line-height: 1.2;
}

body.route-settings #push-notifications .settings-push-device-head p,
body.route-settings #push-notifications .settings-push-device-card [data-push-device-count] {
    margin: 0;
    color: var(--muted);
}

body.route-settings #push-notifications .settings-push-device-body > strong {
    min-width: 220px;
    font-size: 16px;
}

body.route-settings #push-notifications .settings-push-device-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

body.route-settings #push-notifications .settings-push-device-actions .button {
    width: auto !important;
    min-height: 42px;
    white-space: nowrap;
}

body.route-settings #push-notifications .settings-push-rules-form {
    padding-top: 18px;
}

body.route-settings #push-notifications .settings-push-rules-table td,
body.route-settings #push-notifications .settings-push-rules-table th {
    vertical-align: middle;
}

body.route-settings #push-notifications .settings-push-rules-table .settings-code {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 900px) {
    body.route-settings #push-notifications .settings-push-device-card {
        padding: 18px 20px;
    }

    body.route-settings #push-notifications .settings-push-device-head,
    body.route-settings #push-notifications .settings-push-device-body {
        display: grid;
        gap: 12px;
    }

    body.route-settings #push-notifications .settings-push-device-body > strong {
        min-width: 0;
        font-size: 15px;
    }

    body.route-settings #push-notifications .settings-push-device-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    body.route-settings #push-notifications .settings-push-device-actions .button {
        min-width: 0 !important;
        padding-inline: 8px;
        white-space: normal;
    }

    body.route-settings #push-notifications .settings-push-rules-table .settings-code {
        max-width: 140px;
    }
}

.android-update-banner {
    position: fixed;
    left: max(14px, env(safe-area-inset-left, 0px));
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    z-index: 1500;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
    border-radius: 18px;
    background: color-mix(in srgb, var(--card) 96%, #ffffff);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.18);
}

.android-update-banner strong,
.android-update-banner span {
    display: block;
}

.android-update-banner strong {
    color: var(--text);
    font-size: 15px;
    line-height: 1.2;
}

.android-update-banner span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.25;
}

.android-update-banner .button {
    min-height: 38px;
    padding-inline: 12px;
    white-space: nowrap;
}

html[data-theme="dark"] .android-update-banner {
    background: color-mix(in srgb, var(--card) 94%, #020617);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.42);
}

@media (max-width: 520px) {
    .android-update-banner {
        grid-template-columns: 1fr 1fr;
    }

    .android-update-banner > div {
        grid-column: 1 / -1;
    }
}

/* V345: revert the Android WebView top safe-area experiment to the older compact header. */
@media (max-width: 900px) {
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .desktop-shell {
        padding-top: 0 !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-brand-row {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-topline {
        min-height: 44px !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        align-items: center !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .desktop-content {
        padding-top: 0 !important;
    }
}

/* V350: Android/admin mobile bottom menu compactness + Push rules one-row role toggles. */
@media (max-width: 900px) {
    body.so-app:not(.so-master-shell):not(.so-auth-shell) {
        padding-bottom: 66px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .desktop-content,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .page {
        padding-bottom: 70px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav {
        inset: auto 8px 0 8px !important;
        height: 58px !important;
        min-height: 58px !important;
        max-height: 58px !important;
        gap: 2px !important;
        padding: 5px 7px !important;
        border-radius: 16px 16px 0 0 !important;
        align-items: center !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > a,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link.active,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link:hover,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link:focus,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link:focus-visible {
        flex-basis: 66px !important;
        width: 66px !important;
        min-width: 66px !important;
        max-width: 66px !important;
        height: 46px !important;
        min-height: 46px !important;
        max-height: 46px !important;
        border-radius: 13px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > a > span,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link > .app-bottom-nav-icon-wrap {
        top: 4px !important;
        width: 22px !important;
        min-width: 22px !important;
        max-width: 22px !important;
        height: 22px !important;
        min-height: 22px !important;
        max-height: 22px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link > .app-bottom-nav-icon-wrap > svg,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link > .app-bottom-nav-icon-wrap > .app-nav-icon {
        width: 22px !important;
        min-width: 22px !important;
        max-width: 22px !important;
        height: 22px !important;
        min-height: 22px !important;
        max-height: 22px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > a > strong,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav > .app-bottom-nav-link > .app-bottom-nav-label {
        right: 3px !important;
        bottom: 4px !important;
        left: 3px !important;
        height: 14px !important;
        min-height: 14px !important;
        max-height: 14px !important;
        font-size: 10px !important;
        line-height: 14px !important;
    }

    body.role-admin.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-new-order-peek {
        bottom: 43px !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table tbody tr {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        overflow: hidden !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(1),
    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(2) {
        grid-column: 1 / -1 !important;
        padding: 8px 12px !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(n+3) {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        min-height: 38px !important;
        padding: 7px 8px !important;
        gap: 4px !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(n+3)::before {
        position: static !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        color: var(--muted) !important;
        content: attr(data-label) !important;
        font-size: 12px !important;
        font-weight: 450 !important;
        line-height: 1.1 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(n+3) .settings-switch-line {
        flex: 0 0 auto !important;
        min-height: 0 !important;
        padding: 0 !important;
        gap: 0 !important;
        justify-content: flex-end !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(n+3) .settings-switch-line span {
        display: none !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(n+3) .settings-switch-line input[type="checkbox"] {
        width: 22px !important;
        min-width: 22px !important;
        height: 22px !important;
        min-height: 22px !important;
    }
}

/* V351 - mobile menu small bottom offset and compact Push role grid */
@media (max-width: 900px) {
    body.so-app:not(.so-master-shell):not(.so-auth-shell) {
        padding-bottom: 72px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .desktop-content,
    body.so-app:not(.so-master-shell):not(.so-auth-shell) .page {
        padding-bottom: 76px !important;
    }

    body.so-app:not(.so-master-shell):not(.so-auth-shell) .app-bottom-nav {
        inset: auto 8px calc(5px + env(safe-area-inset-bottom, 0px)) 8px !important;
        border-radius: 16px !important;
    }

    body.role-admin.so-app:not(.so-master-shell):not(.so-auth-shell) .mobile-admin-new-order-peek {
        bottom: 48px !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table tbody tr {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        overflow: hidden !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(1),
    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(2) {
        grid-column: 1 / -1 !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(3) {
        grid-column: 1 !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(4) {
        grid-column: 2 !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(5) {
        grid-column: 3 !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(n+3) {
        display: grid !important;
        grid-template-rows: 18px 28px !important;
        align-items: center !important;
        justify-items: center !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 56px !important;
        padding: 7px 4px !important;
        gap: 3px !important;
        text-align: center !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(n+3)::before {
        width: 100% !important;
        flex: none !important;
        text-align: center !important;
        font-size: 12px !important;
        line-height: 18px !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(n+3) .settings-switch-line {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        min-height: 28px !important;
        padding: 0 !important;
        gap: 5px !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(n+3) .settings-switch-line span {
        display: inline !important;
        font-size: 13px !important;
        line-height: 1 !important;
    }
}

/* V352 - force all mobile Push role labels */
@media (max-width: 900px) {
    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(3)::before {
        content: "Мастер" !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(4)::before {
        content: "Менеджер" !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(5)::before {
        content: "Админ" !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(n+3)::before {
        display: block !important;
        grid-row: 1 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    body.route-settings #push-notifications .settings-push-rules-table td:nth-child(n+3) .settings-switch-line {
        grid-row: 2 !important;
    }
}

/* V353 - nicer Android update prompt */
.android-update-banner.android-update-banner-v353 {
    grid-template-columns: 42px minmax(0, 1fr) auto auto;
    gap: 12px;
    padding: 14px;
    border-radius: 22px;
    border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
}

.android-update-badge {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 14px;
    background: var(--primary);
    color: #ffffff;
    font-size: 13px;
    font-weight: 450;
    letter-spacing: 0;
}

.android-update-copy {
    min-width: 0;
}

.android-update-copy small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

@media (max-width: 520px) {
    .android-update-banner.android-update-banner-v353 {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    }

    .android-update-banner.android-update-banner-v353 .android-update-badge,
    .android-update-banner.android-update-banner-v353 .android-update-copy {
        grid-column: 1 / -1;
    }

    .android-update-banner.android-update-banner-v353 .button {
        width: 100%;
        min-height: 42px;
        justify-content: center;
        padding-inline: 10px;
        text-align: center;
    }

    .android-update-banner.android-update-banner-v353 [data-android-update-install] {
        grid-column: 1 / 2;
        min-width: 0;
    }

    .android-update-banner.android-update-banner-v353 [data-android-update-later] {
        grid-column: 2 / 3;
        min-width: 0;
    }
}
/* V413: admin cash report modal actions */
.reports-v99-balance-button {
    cursor: default;
    white-space: nowrap;
}

.cash-v413-master-link {
    color: inherit;
    text-decoration: none;
}

.cash-v413-master-link:hover {
    color: var(--primary, #2563eb);
    text-decoration: underline;
}

.cash-v413-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10020;
    padding: 24px;
}

.cash-v413-modal:target {
    display: block;
}

.cash-v413-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.cash-v413-modal-panel {
    position: relative;
    z-index: 1;
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    margin: 24px auto;
    overflow: auto;
    background: var(--surface, #fff);
    color: var(--text, #0f172a);
    border: 1px solid var(--border, #dbe4f0);
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    padding: 24px;
}

.cash-v413-modal-panel-wide {
    width: min(1100px, calc(100vw - 32px));
}

.cash-v413-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.cash-v413-modal-head h2 {
    margin: 0;
}

.cash-v413-modal-head a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border, #dbe4f0);
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    font-size: 28px;
    line-height: 1;
}

.cash-v413-form {
    margin-top: 18px;
}

html[data-theme="dark"] .cash-v413-modal-panel {
    background: #111827;
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.28);
}

@media (max-width: 720px) {
    .cash-v413-modal {
        padding: 12px;
    }

    .cash-v413-modal-panel,
    .cash-v413-modal-panel-wide {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        margin: 12px auto;
        padding: 18px;
        border-radius: 12px;
    }
}

/* V417: keep cash mobile filters in two rows: dates, then master/method. */
@media (max-width: 720px) {
    .cash-v416-autofilter {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 10px !important;
        align-items: end !important;
    }

    .cash-v416-autofilter > label {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .cash-v416-autofilter input,
    .cash-v416-autofilter select {
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        padding-inline: 10px !important;
    }

    .cash-v416-autofilter .cash-v416-date-from {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .cash-v416-autofilter .cash-v416-date-to {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    .cash-v416-autofilter .cash-v416-master {
        grid-column: 1 !important;
        grid-row: 2 !important;
    }

    .cash-v416-autofilter .cash-v416-method {
        grid-column: 2 !important;
        grid-row: 2 !important;
    }

    .cash-v416-autofilter .filter-actions {
        display: grid !important;
        grid-column: 1 / -1 !important;
        grid-row: 3 !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        min-width: 0 !important;
    }
}


/* V393 gallery viewport fit and compact mobile controls. */
.oev224-gallery-modal { overflow: hidden; box-sizing: border-box; }
.oev224-gallery-dialog { max-width: calc(100dvw - 20px); max-height: calc(100dvh - 20px); min-width: 0; }
.oev224-gallery-head, .oev224-gallery-foot, .oev224-gallery-actions { min-width: 0; max-width: 100%; box-sizing: border-box; }
.oev224-gallery-title { max-width: 100%; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: anywhere; }
.oev224-gallery-stage { width: 100%; height: 100%; overflow: hidden; box-sizing: border-box; }
.oev224-gallery-stage.is-zoomed { overflow: auto; place-items: start center; }
.oev224-gallery-image { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; box-sizing: border-box; }
@media (max-width: 640px) {
    .oev224-gallery-modal { padding: 8px; }
    .oev224-gallery-dialog { width: calc(100dvw - 16px); height: calc(100dvh - 16px); max-width: calc(100dvw - 16px); max-height: calc(100dvh - 16px); border-radius: 18px; }
    .oev224-gallery-head, .oev224-gallery-foot { padding: 8px 10px; }
    .oev224-gallery-title { white-space: nowrap; }
    .oev224-gallery-stage { padding: 8px; }
    .oev224-gallery-foot { display: grid; grid-template-columns: 1fr; gap: 8px; align-items: stretch; }
    .oev224-gallery-actions { display: grid; width: 100%; gap: 6px; }
    .oev224-gallery-foot .oev224-gallery-actions:first-child { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .oev224-gallery-foot .oev224-gallery-actions:last-child { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
    .oev224-gallery-actions button, .oev224-gallery-actions a { min-width: 0; min-height: 40px; padding: 6px 8px; font-size: 14px; line-height: 1.1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .oev224-gallery-actions [data-oev224-gallery-counter] { align-self: center; white-space: nowrap; }
}

/* V435: readable salary ledger with per-master visit expenses. */
.reports-v435-periods {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 20px 0;
}

.reports-v435-salary-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 18px 20px 6px;
}

.reports-v435-salary-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
}

.reports-v435-salary-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.reports-v435-salary-card > header h3,
.reports-v435-salary-card > header p {
    margin: 0;
}

.reports-v435-salary-card > header h3 {
    color: var(--text);
    font-size: 18px;
    line-height: 1.25;
}

.reports-v435-salary-card > header p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.reports-v435-salary-card > header > strong {
    color: var(--primary);
    font-size: 20px;
    line-height: 1.2;
    white-space: nowrap;
}

.reports-v435-ledger {
    padding: 8px 16px;
}

.reports-v435-ledger > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    padding: 8px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
}

.reports-v435-ledger > div:last-child {
    border-bottom: 0;
}

.reports-v435-ledger span {
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.3;
}

.reports-v435-ledger strong {
    color: var(--text);
    font-size: 14px;
    white-space: nowrap;
}

.reports-v435-ledger .is-total {
    margin-top: 3px;
    border-top: 1px solid var(--border);
}

.reports-v435-ledger .is-total span,
.reports-v435-ledger .is-total strong,
.reports-v435-ledger .is-payable span,
.reports-v435-ledger .is-payable strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

.reports-v435-ledger .is-payable {
    margin: 3px -16px -8px;
    padding: 12px 16px;
    border-top: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
    background: color-mix(in srgb, var(--primary) 8%, var(--card));
}

.reports-v435-documents {
    border-top: 1px solid var(--border);
}

.reports-v435-documents summary {
    padding: 12px 16px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.reports-v435-documents > div {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) auto auto auto;
    gap: 10px;
    align-items: center;
    padding: 8px 16px;
    border-top: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
    color: var(--muted);
    font-size: 12px;
}

.reports-v435-documents > div strong {
    color: var(--text);
}

.reports-v435-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 980px) {
    .reports-v435-salary-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .reports-v435-periods {
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 12px 12px 0;
    }

    .reports-v435-periods .reports-v99-btn:last-child {
        grid-column: 1 / -1;
    }

    .reports-v435-salary-cards {
        gap: 12px;
        padding: 14px 12px 4px;
    }

    .reports-v435-salary-card > header {
        padding: 14px;
    }

    .reports-v435-salary-card > header > strong {
        font-size: 18px;
    }

    .reports-v435-ledger {
        padding: 6px 14px;
    }

    .reports-v435-ledger > div {
        gap: 10px;
        padding: 7px 0;
    }

    .reports-v435-ledger .is-payable {
        margin: 3px -14px -6px;
        padding: 11px 14px;
    }

    .reports-v435-documents > div {
        grid-template-columns: minmax(86px, 1fr) auto;
    }

    .reports-v435-documents > div span:nth-child(3) {
        grid-column: 1;
    }
}

/* Постраничная навигация списка заявок (добавлено 2026-08-02).
   Раньше список отдавал только первые 100 строк без возможности пойти дальше. */
.orders-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 20px 0 8px;
    padding: 14px 16px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    background: var(--card-bg, #fff);
}

.orders-pagination-info {
    font-size: 14px;
    color: var(--muted-text, #64748b);
}

.orders-pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.orders-pagination-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color, #e2e8f0);
    text-decoration: none;
    font-size: 14px;
    font-weight: 450;
    color: var(--text-color, #0f172a);
    background: var(--card-bg, #fff);
}

.orders-pagination-link:hover {
    background: var(--hover-bg, #f1f5f9);
}

.orders-pagination-link.is-disabled {
    opacity: .45;
    pointer-events: none;
}

.orders-pagination-current {
    font-size: 14px;
    font-weight: 450;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .orders-pagination {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .orders-pagination-controls {
        justify-content: space-between;
    }
}

/* Рабочая форма фильтра на странице платежей (добавлено 2026-08-02).
   Раньше вкладки методов вели на один адрес, а кнопка «Фильтр» ничего не делала. */
.payments-filter-v436 {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.payments-filter-v436 label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--muted-text, #64748b);
}

.payments-filter-v436 input {
    padding: 8px 10px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    font-size: 14px;
    min-width: 150px;
}

.payments-filter-search-v436 {
    flex: 1 1 220px;
}

.payments-filter-search-v436 input {
    width: 100%;
}

.payments-filter-actions-v436 {
    display: flex;
    gap: 8px;
}

.payments-truncated-v436 {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--muted-text, #64748b);
}

@media (max-width: 640px) {
    .payments-filter-v436 label,
    .payments-filter-actions-v436 { width: 100%; }
    .payments-filter-v436 input { min-width: 0; width: 100%; }
    .payments-filter-actions-v436 .button { flex: 1; text-align: center; }
}

/* Полный набор фильтров в отчётах (добавлено 2026-08-02).
   Раньше в интерфейсе было только 4 из 10 поддерживаемых фильтров,
   а у отчётов «Прибыль» и «Платежи» формы не было вовсе. */
.reports-v436-filters {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.reports-v436-search {
    flex: 1 1 200px;
    min-width: 180px;
}

.reports-v436-search input {
    width: 100%;
}

.reports-v436-checkbox {
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    align-self: flex-end;
    padding-bottom: 8px;
}

.reports-v436-checkbox input {
    width: 18px;
    height: 18px;
    margin: 0;
}

@media (max-width: 640px) {
    .reports-v436-filters > label { width: 100%; }
    .reports-v436-checkbox { width: auto !important; }
}

/* ============================================================
   Справка по разделу (добавлено 2026-08-02).
   Кнопки «Справка» на страницах заявок и платежей были пустыми:
   разметка без единого обработчика. Теперь это общая панель,
   доступная из шапки на всех разделах.
   На широком экране выезжает справа, на телефоне поднимается снизу.
   ============================================================ */
.app-help {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    justify-content: flex-end;
}

.app-help[hidden] {
    display: none;
}

.app-help-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    cursor: pointer;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    transition: opacity .2s ease;
}

.app-help.is-open .app-help-backdrop {
    opacity: 1;
}

.app-help-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(420px, 100%);
    max-width: 100%;
    height: 100%;
    background: var(--card, #fff);
    border-left: 1px solid var(--border, #e2e8f0);
    box-shadow: -18px 0 48px rgba(15, 23, 42, .18);
    transform: translateX(100%);
    transition: transform .22s ease;
}

.app-help.is-open .app-help-panel {
    transform: translateX(0);
}

.app-help-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border, #e2e8f0);
    flex-shrink: 0;
}

.app-help-head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 450;
    color: var(--text, #0f172a);
}

.app-help-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border, #e2e8f0);
    background: var(--card-2, #f8fafc);
    color: var(--muted, #64748b);
    cursor: pointer;
    flex-shrink: 0;
}

.app-help-close:hover {
    color: var(--text, #0f172a);
}

.app-help-close svg {
    width: 18px;
    height: 18px;
}

.app-help-body {
    padding: 18px 20px 28px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

.app-help-intro {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--muted, #64748b);
}

.app-help-section + .app-help-section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border, #e2e8f0);
}

.app-help-section h3 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 450;
    color: var(--text, #0f172a);
}

.app-help-section ul {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-help-section li {
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted, #64748b);
}

html.app-help-open,
html.app-help-open body {
    overflow: hidden;
}

/* Телефон: панель поднимается снизу как лист, не перекрывая нижнее меню
   и учитывая безопасную зону устройства. */
@media (max-width: 700px) {
    .app-help {
        align-items: flex-end;
        justify-content: center;
    }

    .app-help-panel {
        width: 100%;
        height: auto;
        max-height: min(82vh, 640px);
        border-left: 0;
        border-top-left-radius: 18px;
        border-top-right-radius: 18px;
        box-shadow: 0 -14px 42px rgba(15, 23, 42, .22);
        transform: translateY(100%);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .app-help.is-open .app-help-panel {
        transform: translateY(0);
    }

    /* Короткая полоска-«ручка», как принято у нижних листов */
    .app-help-head::before {
        content: '';
        position: absolute;
        top: 7px;
        left: 50%;
        width: 38px;
        height: 4px;
        margin-left: -19px;
        border-radius: 999px;
        background: var(--border, #e2e8f0);
    }

    .app-help-head {
        position: relative;
        padding-top: 22px;
    }

    .app-help-body {
        padding-bottom: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-help-panel,
    .app-help-backdrop {
        transition: none;
    }
}

/* V436 (2026-08-02): структурные правки мобильной версии мастера.
   «← Заявки | Задачи» на задачах попадал в первую колонку грида (146px)
   и переносился — теперь тянется на всю строку. Номер заявки с ценой в шапке
   карточки обрезаем многоточием, чтобы шапка не переполнялась на узких
   экранах. Размеры кнопок выравниваются в master_v2.css — там их задавали
   с !important. */
@media (max-width: 760px) {
    .master-tasks-page .master-mobile-backbar {
        grid-column: 1 / -1;
    }

    body.so-master-shell .master-topbar-brand {
        min-width: 0;
    }

    body.so-master-shell .master-topbar-order-mobile {
        min-width: 0;
        overflow: hidden;
    }

    body.so-master-shell .master-topbar-order-mobile strong,
    body.so-master-shell .master-topbar-order-mobile em {
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
