* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f6fb;
    color: #111827;
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, .15), transparent 35%),
        #f3f6fb;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: #111827;
    color: white;
    padding: 24px;
    overflow: auto;
    transition: transform .26s ease;
    z-index: 30;
}

.logo {
    margin-bottom: 22px;
}

.logo-link {
    display: inline-block;
    text-decoration: none;
    padding: 0 !important;
    margin: 0;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none;
}

.logo-image {
    display: block;
    width: 100%;
    max-width: 190px;
    height: auto;
    object-fit: contain;
}

.user-box {
    background: #1f2937;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 22px;
    display: grid;
    gap: 4px;
}

.user-box span {
    color: #9ca3af;
    font-size: 13px;
    word-break: break-word;
}

.sidebar nav {
    display: grid;
    gap: 10px;
}

.sidebar a {
    color: #d1d5db;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 12px;
}

.sidebar a:hover {
    background: #1f2937;
    color: white;
}

.main {
    margin-left: 280px;
    padding: 32px;
    transition: margin-left .26s ease, padding-left .26s ease;
}

.auth-main {
    width: min(520px, calc(100% - 32px));
}

.auth-card {
    background: white;
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

.auth-link {
    text-align: center;
    margin-bottom: 0;
}

.auth-link a {
    color: #2563eb;
    font-weight: 700;
}

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

h1 {
    margin: 0;
    font-size: 32px;
}

h2 {
    margin-top: 0;
}

h3 {
    margin-top: 0;
}

p {
    color: #6b7280;
}

.card,
.client-card {
    background: white;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.table-card {
    overflow-x: auto;
    max-width: 100%;
}

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

th {
    text-align: left;
    color: #6b7280;
    font-size: 14px;
    padding: 14px;
    background: #f9fafb;
}

td {
    padding: 14px;
    border-top: 1px solid #e5e7eb;
    vertical-align: middle;
}

.button {
    display: inline-block;
    border: 0;
    background: #2563eb;
    color: white;
    text-decoration: none;
    padding: 12px 18px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}

.button.secondary {
    background: #e5e7eb;
    color: #111827;
}

.button.full {
    width: 100%;
    margin-top: 12px;
}

.mini-button {
    border: 0;
    background: #e5e7eb;
    color: #111827;
    border-radius: 9px;
    padding: 7px 10px;
    cursor: pointer;
    font-weight: 700;
}

.mini-button.danger {
    background: #fee2e2;
    color: #991b1b;
}

.status {
    display: inline-block;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    background: #e5e7eb;
}

.status-new { background: #dbeafe; color: #1d4ed8; }
.status-in_progress { background: #fef3c7; color: #92400e; }
.status-done { background: #dcfce7; color: #166534; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-car_taken { background: #dcfce7; color: #166534; }

.form-card {
    display: grid;
    gap: 14px;
}

.form-card.wide {
    max-width: 1040px;
}

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

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
    margin-bottom: 14px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 12px;
    font: inherit;
    background: white;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

small {
    color: #dc2626;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.span-2 {
    grid-column: span 2;
}

.message {
    background: #dcfce7;
    color: #166534;
    padding: 14px 18px;
    border-radius: 14px;
    margin-bottom: 18px;
}

.message-error {
    background: #fee2e2;
    color: #991b1b;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.pill {
    display: inline-block;
    background: #f3f4f6;
    padding: 5px 9px;
    border-radius: 999px;
    margin: 3px;
}

.empty {
    text-align: center;
    color: #6b7280;
}

.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
}

.mt {
    margin-top: 18px;
}

.company-list {
    display: grid;
    gap: 12px;
}

.company-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    border: 1px solid #e5e7eb;
    padding: 14px;
    border-radius: 14px;
}

.company-row div {
    display: grid;
    gap: 4px;
}

.company-row span {
    color: #6b7280;
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 0;
}

.info-row span {
    color: #6b7280;
}

.password-box {
    background: #f3f4f6;
    padding: 6px 10px;
    border-radius: 10px;
}

.hint {
    font-size: 14px;
}

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

.chat-list {
    margin-top: 16px;
    display: grid;
    gap: 12px;
    max-height: 420px;
    overflow: auto;
}

.chat-message {
    background: #f9fafb;
    border-radius: 14px;
    padding: 12px;
}

.chat-message div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.chat-message span {
    color: #6b7280;
    font-size: 13px;
}

.chat-message p {
    margin-bottom: 0;
    color: #111827;
    white-space: pre-wrap;
}

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

@media (max-width: 1000px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
    }

    .main {
        margin-left: 0;
        padding: 18px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid,
    .cards,
    .two-columns {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    h1 {
        font-size: 26px;
    }
}


.logo-link:hover,
.logo-link:focus,
.logo-link:active {
    background: transparent !important;
    box-shadow: none !important;
    outline: none;
}


.status-form {
    margin: 0;
}

.status-select {
    border: 0;
    border-radius: 999px;
    padding: 7px 30px 7px 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    appearance: auto;
    min-width: 140px;
}

.status-select:hover {
    filter: brightness(0.97);
}


.status-select option {
    background: #ffffff;
    color: #111827;
}


.password-rules {
    color: #6b7280;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
    margin-top: -4px;
}

.password-strength {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 2px;
}

.password-strength-bar {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    transition: width .2s ease, background .2s ease;
}

.password-strength-bar.empty {
    width: 0%;
    background: transparent;
}

.password-strength-bar.weak {
    width: 33%;
    background: #ef4444;
}

.password-strength-bar.good {
    width: 66%;
    background: #f59e0b;
}

.password-strength-bar.strong {
    width: 100%;
    background: #22c55e;
}

.password-strength-text {
    font-size: 13px;
    font-weight: 700;
    margin-top: -4px;
}

.password-strength-text.empty {
    color: #6b7280;
}

.password-strength-text.weak {
    color: #dc2626;
}

.password-strength-text.good {
    color: #b45309;
}

.password-strength-text.strong {
    color: #15803d;
}

.logout-link {
    cursor: pointer;
}


.appointments-table {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}

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

.appointments-table th:nth-child(1),
.appointments-table td:nth-child(1) {
    width: 90px;
}

.appointments-table th:nth-child(2),
.appointments-table td:nth-child(2) {
    width: 95px;
}

.appointments-table th:nth-child(3),
.appointments-table td:nth-child(3) {
    width: 120px;
}

.appointments-table th:nth-child(4),
.appointments-table td:nth-child(4) {
    width: 23%;
}

.appointments-table th:nth-child(5),
.appointments-table td:nth-child(5) {
    width: 23%;
}

.appointments-table th:nth-child(6),
.appointments-table td:nth-child(6) {
    width: 90px;
}

.appointments-table th:nth-child(7),
.appointments-table td:nth-child(7) {
    width: 150px;
}

.appointments-table th:nth-child(8),
.appointments-table td:nth-child(8) {
    width: 105px;
}






body:not(.sidebar-collapsed) 

body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

body.sidebar-collapsed .main {
    margin-left: 0;
    padding-left: 32px;
}

.char-counter {
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    margin-top: -5px;
}

.char-counter.counter-warning {
    color: #b45309;
}

.char-counter.counter-danger {
    color: #dc2626;
}


.appointments-table th:nth-child(9),
.appointments-table td:nth-child(9) {
    width: 52px;
}

.actions-th,
.actions-cell {
    text-align: right;
}

.actions-cell {
    position: relative;
    overflow: visible !important;
}

.row-actions {
    position: relative;
    display: inline-block;
}

.row-actions summary {
    list-style: none;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    cursor: pointer;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    color: #374151;
    user-select: none;
}

.row-actions summary::-webkit-details-marker {
    display: none;
}

.row-actions summary:hover {
    background: #f3f4f6;
}

.row-actions-menu {
    position: fixed;
    right: auto;
    top: auto;
    z-index: 9999;
    min-width: 190px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
    padding: 8px;
    display: grid;
    gap: 4px;
    text-align: left;
}

.row-actions-menu a,
.row-actions-menu button {
    width: 100%;
    border: 0;
    background: transparent;
    color: #111827;
    text-decoration: none;
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    font: inherit;
    cursor: pointer;
    display: block;
}

.row-actions-menu a:hover,
.row-actions-menu button:hover {
    background: #f3f4f6;
}

.row-actions-menu form {
    margin: 0;
}

.row-actions-menu .danger-action {
    color: #dc2626;
    font-weight: 700;
}

.row-actions-menu .danger-action:hover {
    background: #fee2e2;
}




body.sidebar-collapsed 

body:not(.sidebar-collapsed) 


@media (max-width: 1000px) {
    body.sidebar-collapsed .main {
    margin-left: 0;
    padding-left: 32px;
}
}


body.sidebar-collapsed 


/* v17: кнопка сворачивания как боковой язычок, чтобы не перекрывать заголовки */
@media (max-width: 1000px) {
    body.sidebar-collapsed .main {
    margin-left: 0;
    padding-left: 32px;
}

    body.sidebar-collapsed 

    body:not(.sidebar-collapsed) 
}


/* v18 final sidebar toggle behavior */
.sidebar-toggle {
    position: fixed;
    left: 224px;
    top: 16px;
    z-index: 60;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: #1f2937;
    color: white;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    transition:
        left .26s ease,
        top .26s ease,
        width .26s ease,
        height .26s ease,
        border-radius .26s ease,
        background .26s ease,
        transform .26s ease,
        box-shadow .26s ease;
}

.sidebar-toggle:hover {
    background: #374151;
}

body.sidebar-collapsed .sidebar-toggle {
    left: 0;
    top: 50%;
    width: 34px;
    height: 64px;
    border-radius: 0 14px 14px 0;
    background: #2563eb;
    transform: translateY(-50%);
}

body.sidebar-collapsed .sidebar-toggle:hover {
    background: #1d4ed8;
}

body:not(.sidebar-collapsed) .sidebar-toggle:active {
    transform: scale(0.96);
}

body.sidebar-collapsed .sidebar-toggle:active {
    transform: translateY(-50%) scale(0.96);
}

@media (max-width: 1000px) {
    .main,
    body.sidebar-collapsed .main,
    body:not(.sidebar-collapsed) .main {
        margin-left: 0;
        padding: 18px;
    }

    .sidebar {
        position: fixed;
        width: 280px;
        height: 100vh;
        padding-top: 70px;
    }

    body:not(.sidebar-collapsed) .sidebar-toggle {
        left: 224px;
        top: 16px;
        width: 40px;
        height: 40px;
        border-radius: 12px;
        transform: none;
    }

    body.sidebar-collapsed .sidebar-toggle {
        left: 0;
        top: 50%;
        width: 34px;
        height: 64px;
        border-radius: 0 14px 14px 0;
        transform: translateY(-50%);
    }

    body:not(.sidebar-collapsed)::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.35);
        z-index: 20;
    }
}


/* v19 final fix: боковая панель полностью уезжает влево, кнопка остаётся сверху */
.sidebar {
    transform: translateX(0) !important;
    will-change: transform;
}

body.sidebar-collapsed .sidebar {
    transform: translateX(-280px) !important;
}

body.sidebar-collapsed .main {
    margin-left: 0 !important;
    padding-left: 32px !important;
}

.sidebar-toggle {
    top: 16px !important;
}

body:not(.sidebar-collapsed) .sidebar-toggle {
    left: 224px !important;
    top: 16px !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 12px !important;
    transform: none !important;
}

body.sidebar-collapsed .sidebar-toggle {
    left: 0 !important;
    top: 16px !important;
    width: 34px !important;
    height: 40px !important;
    border-radius: 0 12px 12px 0 !important;
    transform: none !important;
}

body.sidebar-collapsed .sidebar-toggle:active {
    transform: scale(0.96) !important;
}

@media (max-width: 1000px) {
    .sidebar {
        transform: translateX(0) !important;
    }

    body.sidebar-collapsed .sidebar {
        transform: translateX(-280px) !important;
    }

    body.sidebar-collapsed .main {
        margin-left: 0 !important;
        padding-left: 18px !important;
    }

    body.sidebar-collapsed .sidebar-toggle {
        left: 0 !important;
        top: 16px !important;
        width: 34px !important;
        height: 40px !important;
        border-radius: 0 12px 12px 0 !important;
        transform: none !important;
    }
}


/* v20: при свернутом меню оставляем слева место под язычок, чтобы он не залезал на текст */
body.sidebar-collapsed .main {
    margin-left: 0 !important;
    padding-left: 64px !important;
}

/* лёгкая левая зона под кнопку-язычок */
body.sidebar-collapsed::before {
    content: "";
    position: fixed;
    left: 0;
    top: 0;
    width: 48px;
    height: 100vh;
    background: #eef2f7;
    z-index: 10;
    pointer-events: none;
}

html.theme-dark body.sidebar-collapsed::before {
    background: #0b1120;
}


body.sidebar-collapsed .sidebar-toggle {
    z-index: 70 !important;
}

@media (max-width: 1000px) {
    body.sidebar-collapsed .main {
        padding-left: 58px !important;
    }

    body.sidebar-collapsed::before {
        width: 42px;
    }
}


.dashboard-filter-form,
.clients-search-form {
    margin-bottom: 18px;
}

.filter-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1.25fr 1.25fr 1fr auto;
    gap: 14px;
    align-items: end;
}

.filter-grid label,
.clients-search-form label {
    margin-bottom: 0;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-actions .button {
    white-space: nowrap;
    padding-left: 16px;
    padding-right: 16px;
}

.th-search-btn {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    margin-left: 5px;
    padding: 3px 5px;
    border-radius: 8px;
    vertical-align: middle;
}

.th-search-btn:hover {
    background: #e5e7eb;
}

.clients-search-form {
    display: grid;
    grid-template-columns: minmax(260px, 520px) auto;
    gap: 14px;
    align-items: end;
}

@media (max-width: 1200px) {
    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-actions {
        grid-column: span 2;
    }
}

@media (max-width: 700px) {
    .filter-grid,
    .clients-search-form {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        grid-column: span 1;
        flex-wrap: wrap;
    }
}


.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.active-filter-reset {
    padding-left: 14px;
    padding-right: 14px;
}

.searchable-th {
    position: relative;
    white-space: nowrap;
}

.th-search-btn {
    border: 0;
    background: transparent;
    cursor: pointer;
    margin-left: 6px;
    padding: 3px;
    border-radius: 8px;
    vertical-align: middle;
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
}

.th-search-btn:hover {
    background: #e5e7eb;
}

.magnifier-icon {
    position: relative;
    width: 13px;
    height: 13px;
    border: 2px solid #111827;
    border-radius: 50%;
    display: inline-block;
}

.magnifier-icon::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 2px;
    background: #111827;
    right: -6px;
    bottom: -3px;
    transform: rotate(45deg);
    border-radius: 999px;
}

.header-search-popover {
    display: none;
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 10000;
    width: 280px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
    padding: 12px;
}

.header-search-popover.open {
    display: block;
}

.header-search-popover form {
    display: grid;
    gap: 10px;
    margin: 0;
}

.header-search-popover input,
.header-search-popover select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font: inherit;
    background: #ffffff;
    color: #111827;
}

.header-search-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.header-search-actions button,
.header-search-actions a {
    border: 0;
    border-radius: 10px;
    padding: 9px 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    font-size: 13px;
}

.header-search-actions button {
    background: #2563eb;
    color: #ffffff;
}

.header-search-actions a {
    background: #e5e7eb;
    color: #111827;
}


/* v24 final fix: поисковое окно скрыто, пока не нажали лупу */
.searchable-th {
    position: relative !important;
    white-space: nowrap;
}

.th-search-btn {
    border: 0 !important;
    background: transparent !important;
    cursor: pointer !important;
    margin-left: 6px !important;
    padding: 3px !important;
    border-radius: 8px !important;
    vertical-align: middle !important;
    width: 24px !important;
    height: 24px !important;
    display: inline-grid !important;
    place-items: center !important;
    font-size: 0 !important;
}

.th-search-btn:hover {
    background: #e5e7eb !important;
}

.magnifier-icon {
    position: relative !important;
    width: 13px !important;
    height: 13px !important;
    border: 2px solid #111827 !important;
    border-radius: 50% !important;
    display: inline-block !important;
}

.magnifier-icon::after {
    content: "" !important;
    position: absolute !important;
    width: 7px !important;
    height: 2px !important;
    background: #111827 !important;
    right: -6px !important;
    bottom: -3px !important;
    transform: rotate(45deg) !important;
    border-radius: 999px !important;
}

.header-search-popover {
    display: none !important;
    position: absolute !important;
    left: 0 !important;
    top: calc(100% + 8px) !important;
    z-index: 10000 !important;
    width: 280px !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16) !important;
    padding: 12px !important;
    text-align: left !important;
}

.header-search-popover.open {
    display: block !important;
}

.header-search-popover form {
    display: grid !important;
    gap: 10px !important;
    margin: 0 !important;
}

.header-search-popover input,
.header-search-popover select {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 10px !important;
    font: inherit !important;
    background: #ffffff !important;
    color: #111827 !important;
}

.header-search-actions {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
}

.header-search-actions button,
.header-search-actions a {
    border: 0 !important;
    border-radius: 10px !important;
    padding: 9px 12px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    font-size: 13px !important;
}

.header-search-actions button {
    background: #2563eb !important;
    color: #ffffff !important;
}

.header-search-actions a {
    background: #e5e7eb !important;
    color: #111827 !important;
}

/* Чтобы всплывающий поиск не обрезался карточкой */
.table-card {
    overflow-x: auto;
    overflow-y: visible !important;
}


/* v25: окно поиска открывается поверх таблицы и не обрезается */
.header-search-popover {
    display: none !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 99999 !important;
    width: 280px !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16) !important;
    padding: 12px !important;
    text-align: left !important;
}

.header-search-popover.open {
    display: block !important;
}

.table-card,
.card.table-card {
    overflow-x: auto !important;
    overflow-y: visible !important;
}


/* v26: поиск снова открывается возле лупы, но карточка даёт место снизу */
.searchable-th {
    position: relative !important;
    overflow: visible !important;
}

.header-search-popover {
    display: none !important;
    position: absolute !important;
    left: 0 !important;
    top: calc(100% + 8px) !important;
    z-index: 99999 !important;
    width: 280px !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16) !important;
    padding: 12px !important;
    text-align: left !important;
}

.header-search-popover.open {
    display: block !important;
}

.table-card.search-popover-open {
    padding-bottom: 190px !important;
}

.table-card.search-popover-open .header-search-popover {
    display: block !important;
}

/* Для правых колонок меню поиска разворачивается влево, чтобы не вылезать за карточку */
.searchable-th.align-popover-right .header-search-popover {
    left: auto !important;
    right: 0 !important;
}


/* v27 final: исправление всплывающего поиска */
.table-card,
.card.table-card {
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding-bottom: 22px !important;
}

.table-card.search-popover-open {
    padding-bottom: 22px !important;
}

.table-card.search-popover-open .header-search-popover {
    display: none !important;
}

.searchable-th {
    position: relative !important;
    overflow: visible !important;
}

.header-search-popover {
    display: none !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 99999 !important;
    width: 280px !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16) !important;
    padding: 12px !important;
    text-align: left !important;
    visibility: hidden !important;
}

.header-search-popover.open {
    display: block !important;
}

.header-search-popover.open.positioned {
    visibility: visible !important;
}

.searchable-th.align-popover-right .header-search-popover {
    left: 0 !important;
    right: auto !important;
}

.header-search-popover input,
.header-search-popover select {
    outline: none !important;
    box-shadow: none !important;
}

.header-search-popover input:focus,
.header-search-popover select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15) !important;
}

/* Убираем чёрную системную обводку внутри окна поиска */
.header-search-popover *:focus {
    outline: none !important;
}


/* v28 final: рабочие всплывающие поиски */
.header-search-popover {
    display: none !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 99999 !important;
    width: 280px !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16) !important;
    padding: 12px !important;
    text-align: left !important;
    visibility: visible !important;
}

.header-search-popover.force-open {
    display: block !important;
    visibility: visible !important;
}

.header-search-popover.open:not(.force-open),
.header-search-popover.positioned:not(.force-open) {
    display: none !important;
}

.table-card,
.card.table-card,
.table-card.search-popover-open {
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding-bottom: 22px !important;
}

.table-card.search-popover-open .header-search-popover:not(.force-open) {
    display: none !important;
}

.searchable-th {
    position: relative !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

.th-search-btn {
    border: 0 !important;
    background: transparent !important;
    cursor: pointer !important;
    margin-left: 6px !important;
    padding: 3px !important;
    border-radius: 8px !important;
    vertical-align: middle !important;
    width: 24px !important;
    height: 24px !important;
    display: inline-grid !important;
    place-items: center !important;
    font-size: 0 !important;
}

.th-search-btn:hover {
    background: #e5e7eb !important;
}

.header-search-popover input,
.header-search-popover select {
    outline: none !important;
    box-shadow: none !important;
}

.header-search-popover input:focus,
.header-search-popover select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15) !important;
}


/* v29 final: оригинальные окна в таблице всегда скрыты */
.header-search-popover,
.header-search-popover.open,
.header-search-popover.force-open,
.header-search-popover.positioned,
.header-search-popover.open.positioned {
    display: none !important;
    visibility: hidden !important;
}

/* v29: настоящее окно поиска создаётся отдельно поверх страницы */
.floating-search-popup {
    position: fixed !important;
    z-index: 999999 !important;
    width: 280px !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16) !important;
    padding: 12px !important;
    text-align: left !important;
}

.floating-search-popup form {
    display: grid !important;
    gap: 10px !important;
    margin: 0 !important;
}

.floating-search-popup input,
.floating-search-popup select {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 10px !important;
    font: inherit !important;
    background: #ffffff !important;
    color: #111827 !important;
    outline: none !important;
    box-shadow: none !important;
}

.floating-search-popup input:focus,
.floating-search-popup select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15) !important;
}

.floating-search-popup .header-search-actions {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
}

.floating-search-popup .header-search-actions button,
.floating-search-popup .header-search-actions a {
    border: 0 !important;
    border-radius: 10px !important;
    padding: 9px 12px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    font-size: 13px !important;
}

.floating-search-popup .header-search-actions button {
    background: #2563eb !important;
    color: #ffffff !important;
}

.floating-search-popup .header-search-actions a {
    background: #e5e7eb !important;
    color: #111827 !important;
}

/* таблица больше не двигается и не растягивается из-за поиска */
.table-card,
.card.table-card,
.table-card.search-popover-open {
    padding-bottom: 22px !important;
    overflow-x: auto !important;
}

/* чёрно-белая лупа остаётся без emoji */
.th-search-btn {
    font-size: 0 !important;
}


/* v30: календарь */
.calendar-card {
    padding: 22px;
    overflow: hidden;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.calendar-month-title {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    text-align: center;
    flex: 1;
}

.calendar-nav-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
    text-decoration: none;
    font-size: 22px;
    font-weight: 800;
    transition: .2s ease;
}

.calendar-nav-btn:hover {
    background: #dbeafe;
    transform: translateY(-1px);
}

.calendar-grid-wrap {
    overflow-x: auto;
    padding-bottom: 6px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(170px, 1fr));
    gap: 12px;
    min-width: 1190px;
}

.calendar-weekdays {
    margin-bottom: 12px;
}

.calendar-weekday {
    background: #f3f4f6;
    color: #64748b;
    border-radius: 12px;
    padding: 12px;
    font-weight: 800;
    text-align: center;
}

.calendar-week-row {
    margin-bottom: 12px;
}

.calendar-cell {
    min-height: 215px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: .2s ease;
}

.calendar-cell:hover {
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
    border-color: #dbeafe;
}

.calendar-cell.other-month {
    opacity: .52;
    background: #f8fafc;
}

.calendar-cell.today {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, .12);
    background: #fbfdff;
}

.calendar-date-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.calendar-date-number {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
}

.calendar-badge {
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #2563eb;
    color: white;
    font-size: 12px;
    font-weight: 800;
}

.calendar-appointments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.calendar-empty-day {
    color: #94a3b8;
    font-size: 13px;
    padding: 12px 10px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px dashed #e5e7eb;
}

.calendar-appointment {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-left: 5px solid #93c5fd;
    border-radius: 14px;
    padding: 10px;
    transition: .18s ease;
}

.calendar-appointment:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.calendar-appointment-time {
    font-size: 12px;
    font-weight: 800;
    color: #2563eb;
    margin-bottom: 4px;
}

.calendar-appointment-client {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 3px;
    line-height: 1.2;
}

.calendar-appointment-service,
.calendar-appointment-car {
    font-size: 12px;
    color: #475569;
    line-height: 1.3;
}

.status-mini-new { border-left-color: #3b82f6; }
.status-mini-in_progress { border-left-color: #f59e0b; }
.status-mini-done { border-left-color: #16a34a; }
.status-mini-cancelled { border-left-color: #ef4444; }
.status-mini-car_taken { border-left-color: #22c55e; }

@media (max-width: 900px) {
    .calendar-month-title {
        font-size: 22px;
        order: -1;
        width: 100%;
    }
}


/* v31: today button and weekends */
.calendar-weekday.weekend {
    background: #fee2e2;
    color: #b91c1c;
}

.calendar-cell.weekend .calendar-date-number {
    color: #dc2626;
}

.calendar-cell.weekend {
    background: #fffafa;
}

.calendar-cell.weekend.other-month {
    background: #fff7f7;
}

.today-scroll-btn {
    border: 1px solid #bfdbfe;
}

.calendar-cell.calendar-focus-today {
    border-color: #2563eb;
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, .18),
        0 16px 40px rgba(37, 99, 235, .18);
    animation: todayPulse 1.25s ease-in-out 2;
}

@keyframes todayPulse {
    0% {
        box-shadow:
            0 0 0 4px rgba(37, 99, 235, .18),
            0 16px 40px rgba(37, 99, 235, .18);
    }

    50% {
        box-shadow:
            0 0 0 8px rgba(37, 99, 235, .28),
            0 18px 48px rgba(37, 99, 235, .26);
    }

    100% {
        box-shadow:
            0 0 0 4px rgba(37, 99, 235, .18),
            0 16px 40px rgba(37, 99, 235, .18);
    }
}


/* v33: исправленные сегодня + выходные в календаре */
.calendar-weekday.weekend {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

.calendar-cell.weekend .calendar-date-number {
    color: #dc2626 !important;
}

.calendar-cell.weekend {
    background: #fffafa !important;
}

.calendar-cell.weekend.other-month {
    background: #fff7f7 !important;
}

.today-scroll-btn {
    border: 1px solid #bfdbfe !important;
}

.calendar-cell.today {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, .12) !important;
}

.calendar-cell.calendar-focus-today {
    border-color: #2563eb !important;
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, .20),
        0 16px 40px rgba(37, 99, 235, .20) !important;
    animation: todayPulseV33 1.25s ease-in-out 2 !important;
}

@keyframes todayPulseV33 {
    0% {
        box-shadow:
            0 0 0 4px rgba(37, 99, 235, .20),
            0 16px 40px rgba(37, 99, 235, .20);
    }

    50% {
        box-shadow:
            0 0 0 9px rgba(37, 99, 235, .32),
            0 18px 50px rgba(37, 99, 235, .28);
    }

    100% {
        box-shadow:
            0 0 0 4px rgba(37, 99, 235, .20),
            0 16px 40px rgba(37, 99, 235, .20);
    }
}


/* v34: календарь влезает на обычные 16:9 мониторы */
.calendar-card {
    padding: 18px !important;
}

.calendar-grid-wrap {
    overflow-x: visible !important;
    width: 100% !important;
}

.calendar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 9px !important;
    min-width: 0 !important;
    width: 100% !important;
}

.calendar-weekdays {
    margin-bottom: 9px !important;
}

.calendar-week-row {
    margin-bottom: 9px !important;
}

.calendar-weekday {
    padding: 10px 8px !important;
    border-radius: 12px !important;
    font-size: 15px !important;
}

.calendar-cell {
    min-height: 158px !important;
    padding: 10px !important;
    border-radius: 15px !important;
    gap: 8px !important;
    overflow: hidden !important;
}

.calendar-date-number {
    font-size: 19px !important;
}

.calendar-badge {
    min-width: 23px !important;
    height: 23px !important;
    padding: 0 7px !important;
    font-size: 11px !important;
}

.calendar-appointments {
    gap: 6px !important;
    overflow: hidden !important;
}

.calendar-empty-day {
    padding: 9px 8px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.calendar-appointment {
    padding: 8px !important;
    border-radius: 12px !important;
    border-left-width: 4px !important;
    overflow: hidden !important;
}

.calendar-appointment-time {
    font-size: 11px !important;
    margin-bottom: 3px !important;
}

.calendar-appointment-client {
    font-size: 13px !important;
    margin-bottom: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.calendar-appointment-service,
.calendar-appointment-car {
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

@media (max-width: 1450px) {
    .calendar-card {
        padding: 14px !important;
    }

    .calendar-grid {
        gap: 7px !important;
    }

    .calendar-weekday {
        padding: 8px 6px !important;
        font-size: 14px !important;
    }

    .calendar-cell {
        min-height: 138px !important;
        padding: 8px !important;
        border-radius: 13px !important;
    }

    .calendar-empty-day {
        padding: 7px 6px !important;
        font-size: 11px !important;
    }

    .calendar-appointment {
        padding: 7px !important;
    }

    .calendar-appointment-car {
        display: none !important;
    }
}

@media (max-width: 1200px) {
    .calendar-month-title {
        font-size: 23px !important;
    }

    .calendar-nav-btn {
        width: 38px !important;
        height: 38px !important;
    }

    .calendar-grid {
        gap: 6px !important;
    }

    .calendar-cell {
        min-height: 124px !important;
        padding: 7px !important;
    }

    .calendar-date-number {
        font-size: 17px !important;
    }

    .calendar-empty-day {
        font-size: 10px !important;
    }

    .calendar-appointment-service {
        display: none !important;
    }
}


/* v35: красивое модальное окно новой записи */
body.modal-open {
    overflow: hidden !important;
}

.appointment-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    background: rgba(2, 8, 23, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.appointment-modal-window {
    width: min(1100px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
    animation: appointmentModalIn .2s ease;
}

@keyframes appointmentModalIn {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.appointment-modal-body {
    padding: 26px;
}

.appointment-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.appointment-modal-head h2 {
    margin: 0 0 8px;
    font-size: 34px;
    line-height: 1.05;
    color: #0f172a;
}

.appointment-modal-head p {
    margin: 0;
    color: #64748b;
    font-size: 17px;
}

.appointment-modal-close {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}

.appointment-modal-close:hover {
    background: #cbd5e1;
}

.appointment-modal-form .errorlist,
.appointment-modal-body .errorlist {
    margin: 0 0 10px;
    padding: 10px 12px;
    list-style: none;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 12px;
}

.modal-form-grid {
    margin-top: 6px;
}

.appointment-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    margin-top: 18px;
    flex-wrap: wrap;
}

.appointment-modal-loading,
.appointment-modal-error {
    padding: 40px 14px;
    text-align: center;
    color: #475569;
    font-size: 18px;
}

.appointment-modal-error {
    color: #b91c1c;
}

@media (max-width: 900px) {
    .appointment-modal-overlay {
        padding: 10px;
    }

    .appointment-modal-window {
        width: min(100vw - 20px, 1000px);
        max-height: calc(100vh - 20px);
        border-radius: 20px;
    }

    .appointment-modal-body {
        padding: 18px;
    }

    .appointment-modal-head h2 {
        font-size: 28px;
    }

    .appointment-modal-head p {
        font-size: 15px;
    }
}


/* v37: модальное окно не должно открываться само при загрузке страницы */
.appointment-modal-overlay[hidden] {
    display: none !important;
}

.appointment-modal-overlay:not([hidden]) {
    display: flex !important;
}


/* v38: плавное появление размытия и убран лишний скролл модального окна */
.appointment-modal-overlay {
    opacity: 0;
    backdrop-filter: blur(0);
    transition:
        opacity .22s ease,
        backdrop-filter .22s ease,
        background .22s ease;
}

.appointment-modal-overlay:not([hidden]) {
    opacity: 1;
    backdrop-filter: blur(4px);
    animation: modalOverlayFadeIn .22s ease both;
}

@keyframes modalOverlayFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
        background: rgba(2, 8, 23, 0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(4px);
        background: rgba(2, 8, 23, 0.55);
    }
}

.appointment-modal-window {
    overflow: hidden !important;
}

.appointment-modal-body {
    max-height: calc(100vh - 48px);
    overflow: hidden !important;
}

/* Чуть уплотняем форму, чтобы она спокойно помещалась без микроскролла */
.appointment-modal-body .form-grid,
.appointment-modal-body .modal-form-grid {
    gap: 16px 20px !important;
}

.appointment-modal-body label {
    margin-bottom: 0 !important;
}

.appointment-modal-body textarea {
    min-height: 155px !important;
    max-height: 155px !important;
    resize: none !important;
}

.appointment-modal-actions {
    margin-top: 14px !important;
}

@media (max-height: 820px) {
    .appointment-modal-body {
        padding: 20px !important;
    }

    .appointment-modal-head {
        margin-bottom: 12px !important;
    }

    .appointment-modal-head h2 {
        font-size: 30px !important;
        margin-bottom: 6px !important;
    }

    .appointment-modal-body input,
    .appointment-modal-body select {
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }

    .appointment-modal-body textarea {
        min-height: 120px !important;
        max-height: 120px !important;
    }
}


/* v39: плавное закрытие модального окна и переходы между страницами */
.appointment-modal-overlay {
    opacity: 0 !important;
    background: rgba(2, 8, 23, 0) !important;
    backdrop-filter: blur(0) !important;
    transition:
        opacity .22s ease,
        backdrop-filter .22s ease,
        background .22s ease !important;
}

.appointment-modal-overlay.modal-visible {
    opacity: 1 !important;
    background: rgba(2, 8, 23, 0.55) !important;
    backdrop-filter: blur(4px) !important;
}

.appointment-modal-window {
    transform: translateY(12px) scale(.98);
    opacity: 0;
    transition:
        transform .22s ease,
        opacity .22s ease !important;
}

.appointment-modal-overlay.modal-visible .appointment-modal-window {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.appointment-modal-overlay.modal-closing .appointment-modal-window {
    transform: translateY(12px) scale(.98);
    opacity: 0;
}

.appointment-modal-overlay.modal-closing {
    opacity: 0 !important;
    background: rgba(2, 8, 23, 0) !important;
    backdrop-filter: blur(0) !important;
}

/* Плавный вход/выход основного контента */
.main,
.auth-main {
    animation: pageFadeInV39 .20s ease both;
}

body.page-leaving .main,
body.page-leaving .auth-main {
    opacity: 0;
    transform: translateY(8px);
    transition:
        opacity .16s ease,
        transform .16s ease;
}

@keyframes pageFadeInV39 {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .main,
    .auth-main,
    .appointment-modal-overlay,
    .appointment-modal-window {
        animation: none !important;
        transition: none !important;
    }
}


/* v40: настоящее плавное закрытие модального окна */
.appointment-modal-overlay[hidden] {
    display: none !important;
}

.appointment-modal-overlay:not([hidden]) {
    display: flex !important;
    animation: none !important;
}

.appointment-modal-overlay {
    opacity: 0 !important;
    background: rgba(2, 8, 23, 0) !important;
    backdrop-filter: blur(0) !important;
    transition:
        opacity .28s ease,
        background .28s ease,
        backdrop-filter .28s ease !important;
}

.appointment-modal-overlay.modal-visible {
    opacity: 1 !important;
    background: rgba(2, 8, 23, 0.55) !important;
    backdrop-filter: blur(4px) !important;
}

.appointment-modal-overlay.modal-closing {
    opacity: 0 !important;
    background: rgba(2, 8, 23, 0) !important;
    backdrop-filter: blur(0) !important;
    pointer-events: none !important;
}

.appointment-modal-window {
    opacity: 0 !important;
    transform: translateY(14px) scale(.97) !important;
    transition:
        opacity .28s ease,
        transform .28s ease !important;
}

.appointment-modal-overlay.modal-visible .appointment-modal-window {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

.appointment-modal-overlay.modal-closing .appointment-modal-window {
    opacity: 0 !important;
    transform: translateY(14px) scale(.97) !important;
}


/* v41 modal script fixed safety */
.appointment-modal-overlay[hidden] {
    display: none !important;
}

.appointment-modal-overlay:not([hidden]) {
    display: flex !important;
}


/* v42: profit analytics pie */
.profit-card {
    overflow: hidden;
}

.profit-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.profit-head h2 {
    margin-bottom: 8px;
}

.profit-head p {
    margin: 0;
    color: #64748b;
    font-size: 15px;
}

.profit-total {
    min-width: 230px;
    padding: 16px 18px;
    border-radius: 18px;
    background: #eff6ff;
    color: #0f172a;
    text-align: right;
}

.profit-total span,
.profit-total small {
    display: block;
    color: #64748b;
    font-weight: 700;
}

.profit-total strong {
    display: block;
    font-size: 28px;
    margin: 5px 0;
    color: #2563eb;
}

.profit-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: center;
}

.profit-pie-wrap {
    display: flex;
    justify-content: center;
}

.profit-pie {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    box-shadow:
        0 18px 40px rgba(15, 23, 42, .10),
        inset 0 0 0 1px rgba(15, 23, 42, .06);
}

.profit-pie.empty {
    background: conic-gradient(#e5e7eb 0deg 360deg) !important;
}

.profit-pie-center {
    width: 142px;
    height: 142px;
    border-radius: 50%;
    background: #ffffff;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 16px;
    box-shadow: inset 0 0 0 1px #e5e7eb;
}

.profit-pie-center span {
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}

.profit-pie-center strong {
    color: #0f172a;
    font-size: 18px;
    line-height: 1.2;
}

.profit-legend {
    display: grid;
    gap: 10px;
}

.profit-legend-row {
    display: grid;
    grid-template-columns: 16px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
}

.profit-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
}

.profit-legend-row strong {
    display: block;
    color: #0f172a;
}

.profit-legend-row small {
    color: #64748b;
}

.profit-legend-row b {
    color: #2563eb;
    white-space: nowrap;
}

.profit-empty {
    padding: 18px;
    border-radius: 16px;
    background: #f8fafc;
    color: #64748b;
    border: 1px dashed #cbd5e1;
}

@media (max-width: 900px) {
    .profit-head,
    .profit-content {
        grid-template-columns: 1fr;
        display: grid;
    }

    .profit-total {
        text-align: left;
        min-width: 0;
    }
}


/* v43: toast уведомления справа снизу */
.toast-stack {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 2000000;
    display: grid;
    gap: 12px;
    width: min(390px, calc(100vw - 48px));
    pointer-events: none;
}

.app-toast {
    position: relative;
    overflow: hidden;
    pointer-events: auto;
    display: grid;
    grid-template-columns: 1fr 34px;
    gap: 10px;
    align-items: start;
    padding: 15px 14px 17px 16px;
    border-radius: 18px;
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #dbeafe;
    box-shadow: 0 20px 45px rgba(15, 23, 42, .16);
    opacity: 0;
    transform: translateY(16px) scale(.98);
    transition: opacity .22s ease, transform .22s ease;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.app-toast.is-hiding {
    opacity: 0;
    transform: translateY(16px) scale(.98);
}

.app-toast-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.app-toast-error {
    border-color: #fecaca;
    background: #fef2f2;
}

.app-toast-content {
    display: grid;
    gap: 3px;
}

.app-toast-content strong {
    font-size: 14px;
    color: #166534;
}

.app-toast-error .app-toast-content strong {
    color: #991b1b;
}

.app-toast-content span {
    font-size: 14px;
    color: #334155;
}

.app-toast-close {
    border: 0;
    background: rgba(15, 23, 42, .08);
    color: #0f172a;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.app-toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 100%;
    background: #22c55e;
    animation: toastProgressV43 5s linear forwards;
}

.app-toast-error .app-toast-progress {
    background: #ef4444;
}

@keyframes toastProgressV43 {
    from { width: 100%; }
    to { width: 0%; }
}

/* Старые сообщения сверху больше не занимают место */
.message {
    display: none !important;
}

/* v43: длинный статус помещается аккуратнее */
.status-form {
    min-width: 300px;
}

.status-select {
    min-width: 290px !important;
    max-width: 100% !important;
    font-size: 13px !important;
    padding: 8px 34px 8px 14px !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

td:has(.status-form) {
    min-width: 315px;
}

@supports not selector(:has(*)) {
    .status-form {
        width: 315px;
    }
}

@media (max-width: 1500px) {
    .status-form {
        min-width: 260px;
    }

    .status-select {
        min-width: 250px !important;
        font-size: 12px !important;
    }

    td:has(.status-form) {
        min-width: 270px;
    }
}

/* v43: лишние строки аналитики сворачиваются */
.profit-more {
    margin-top: 2px;
}

.profit-more summary {
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    background: #e5e7eb;
    color: #111827;
    font-weight: 800;
    user-select: none;
}

.profit-more summary::-webkit-details-marker {
    display: none;
}

.profit-more summary:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.profit-more[open] summary {
    margin-bottom: 10px;
}

.profit-more-list {
    display: grid;
    gap: 10px;
}


/* v44: уведомления строго справа снизу, не наезжают на таблицу */
.toast-stack {
    right: 26px !important;
    bottom: 26px !important;
    top: auto !important;
    left: auto !important;
    width: min(360px, calc(100vw - 52px)) !important;
    z-index: 3000000 !important;
}

.app-toast {
    border-radius: 16px !important;
    padding: 14px 13px 16px 15px !important;
}

/* v44: компактная таблица записей без нижнего scroll-bar на 16:9 */
.table-card {
    overflow-x: visible !important;
}

.table-card table {
    width: 100% !important;
    table-layout: fixed !important;
}

.table-card th,
.table-card td {
    padding-left: 14px !important;
    padding-right: 14px !important;
    overflow-wrap: anywhere;
}

.table-card th:nth-child(1),
.table-card td:nth-child(1) { width: 9.5%; }

.table-card th:nth-child(2),
.table-card td:nth-child(2) { width: 9%; }

.table-card th:nth-child(3),
.table-card td:nth-child(3) { width: 12%; }

.table-card th:nth-child(4),
.table-card td:nth-child(4) { width: 15%; }

.table-card th:nth-child(5),
.table-card td:nth-child(5) { width: 17%; }

.table-card th:nth-child(6),
.table-card td:nth-child(6) { width: 8%; }

.table-card th:nth-child(7),
.table-card td:nth-child(7) { width: 19%; }

.table-card th:nth-child(8),
.table-card td:nth-child(8) { width: 7%; }

.table-card th:nth-child(9),
.table-card td:nth-child(9) { width: 3.5%; }

.status-form {
    min-width: 0 !important;
    width: 100% !important;
}

.status-select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: 12px !important;
    padding: 8px 30px 8px 12px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

td:has(.status-form) {
    min-width: 0 !important;
}

.actions-cell {
    text-align: right;
}

/* Делаем поиск клиентов плавным */
#clientsList {
    transition: opacity .16s ease, transform .16s ease;
}

/* v44: аналитика прибыли — плавное раскрытие */
.profit-more {
    margin-top: 2px;
}

.profit-more-toggle {
    cursor: pointer;
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    background: #e5e7eb;
    color: #111827;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.profit-more-toggle:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.profit-more-arrow {
    font-size: 18px;
    line-height: 1;
    transition: transform .22s ease;
    transform: translateY(-1px);
}

.profit-more.is-open .profit-more-arrow {
    transform: rotate(180deg) translateY(1px);
}

.profit-more-panel {
    overflow: hidden;
    max-height: 0;
    transition: max-height .28s ease;
}

.profit-more-list {
    display: grid;
    gap: 10px;
    padding-top: 10px;
}

@media (max-width: 1350px) {
    .table-card th,
    .table-card td {
        padding-left: 10px !important;
        padding-right: 10px !important;
        font-size: 14px;
    }

    .status-select {
        font-size: 11px !important;
        padding-left: 10px !important;
    }
}


/* v45: точное положение toast справа снизу веб-окна */
.toast-stack {
    position: fixed !important;
    right: 24px !important;
    bottom: 24px !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    align-items: end !important;
    justify-items: end !important;
    width: min(360px, calc(100vw - 48px)) !important;
    max-width: 360px !important;
    z-index: 9999999 !important;
}

.app-toast {
    width: 100% !important;
    transform-origin: right bottom !important;
}

/* v45: аккуратная стрелка в кнопке Показать ещё / Скрыть */
.profit-more-toggle {
    gap: 9px !important;
    line-height: 1 !important;
}

.profit-more-arrow {
    width: 9px !important;
    height: 9px !important;
    display: inline-block !important;
    border-right: 2px solid currentColor !important;
    border-bottom: 2px solid currentColor !important;
    transform: rotate(45deg) translateY(-2px) !important;
    transform-origin: 50% 50% !important;
    transition: transform .22s ease !important;
    margin-left: 2px !important;
}

.profit-more.is-open .profit-more-arrow {
    transform: rotate(-135deg) translateY(-1px) !important;
}

/* v45: нельзя искать клиента пустой строкой */
.button.is-disabled,
button:disabled {
    opacity: .62 !important;
    cursor: not-allowed !important;
}

/* v45: при клике по текущему пункту меню страница не должна визуально дёргаться */
.sidebar nav a {
    -webkit-tap-highlight-color: transparent;
}


/* v46: toast теперь находится вне main, поэтому fixed = реально справа снизу окна браузера */
.toast-stack {
    position: fixed !important;
    right: max(24px, env(safe-area-inset-right)) !important;
    bottom: max(24px, env(safe-area-inset-bottom)) !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    translate: none !important;
    width: 360px !important;
    max-width: calc(100vw - 48px) !important;
    z-index: 2147483000 !important;
    pointer-events: none !important;
}

.toast-stack .app-toast {
    pointer-events: auto !important;
}

/* v46: кнопка аналитики плавно меняет ширину при смене текста */
.profit-more-toggle {
    width: auto;
    overflow: hidden;
    white-space: nowrap;
    transition:
        width .24s ease,
        background .18s ease,
        color .18s ease,
        transform .18s ease !important;
    will-change: width;
}

.profit-more-toggle [data-more-text] {
    display: inline-block;
    white-space: nowrap;
}

.profit-more-arrow {
    flex: 0 0 auto;
}


/* v47: уведомления не прыгают при появлении второго и сохраняют анимацию */
.toast-stack {
    display: flex !important;
    flex-direction: column-reverse !important;
    gap: 12px !important;
    align-items: flex-end !important;
    justify-content: flex-start !important;
}

.app-toast {
    flex: 0 0 auto !important;
    transition:
        opacity .24s ease,
        transform .24s ease !important;
}

/* v47: если переход отменился, страница не должна оставаться бледной */
body:not(.page-leaving) .main,
body:not(.page-leaving) .auth-main {
    opacity: 1;
    transform: translateY(0);
}

/* v47: кнопка аналитики плавно меняет ширину и не держит старый размер */
.profit-more-toggle {
    min-width: 0 !important;
    width: auto;
    box-sizing: border-box;
    transition:
        width .24s ease,
        background .18s ease,
        color .18s ease,
        transform .18s ease !important;
}

.profit-more-toggle [data-more-text] {
    white-space: nowrap;
}


/* v48: toast — плавное появление, плавное движение, непрерывная полоска после перехода */
.toast-stack {
    display: flex !important;
    flex-direction: column-reverse !important;
    gap: 12px !important;
    align-items: flex-end !important;
    justify-content: flex-start !important;
}

.app-toast {
    flex: 0 0 auto !important;
    will-change: transform, opacity !important;
    transition:
        opacity .24s ease,
        transform .24s ease !important;
}

.app-toast.no-enter-animation {
    transition: transform .24s ease !important;
}

.app-toast.no-enter-animation.is-visible {
    opacity: 1 !important;
    transform: none !important;
}

.app-toast-progress {
    animation: none !important;
    width: 100%;
}

/* v48: главная страница */
.home-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.home-stat-card {
    display: grid;
    gap: 8px;
}

.home-stat-card span {
    color: #64748b;
    font-weight: 700;
}

.home-stat-card strong {
    font-size: 26px;
    color: #2563eb;
}

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

.home-tile {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 18px;
    align-items: start;
    padding: 22px;
    border-radius: 22px;
    background: #ffffff;
    color: #0f172a;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
    border: 1px solid transparent;
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease;
}

.home-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 44px rgba(15, 23, 42, .12);
    border-color: #dbeafe;
}

.home-tile-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: #eff6ff;
    font-size: 30px;
}

.home-tile h2 {
    margin: 0 0 8px;
}

.home-tile p {
    margin: 0;
    line-height: 1.45;
}

@media (max-width: 900px) {
    .home-stats,
    .home-grid {
        grid-template-columns: 1fr;
    }
}

/* v49: меню троеточия открывается влево и не создаёт горизонтальный скролл */
.table-card {
    overflow-x: visible !important;
    overflow-y: visible !important;
}

.actions-cell {
    position: relative !important;
    overflow: visible !important;
    text-align: right !important;
}

.row-actions {
    position: relative !important;
    display: inline-block !important;
}

.row-actions-menu {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    z-index: 999999 !important;
    min-width: 210px !important;
    max-width: 260px !important;
    transform: none !important;
    box-sizing: border-box !important;
}

.row-actions:not([open]) .row-actions-menu {
    display: none !important;
}

.row-actions[open] .row-actions-menu {
    display: grid !important;
}

/* На последней колонке меню всегда уходит внутрь таблицы, а не вправо за экран */
.actions-cell .row-actions-menu {
    margin-right: 0 !important;
}

/* Убираем нижний скролл, который появлялся из-за старого fixed-меню */
html,
body {
    overflow-x: hidden;
}


/* v50: меню действий поверх всего и разворачивается вверх, если снизу мало места */
.row-actions-menu {
    position: fixed !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 2147482500 !important;
    min-width: 210px !important;
    max-width: 260px !important;
    display: none !important;
    box-sizing: border-box !important;
}

.row-actions[open] .row-actions-menu {
    display: grid !important;
}

.table-card,
.card.table-card {
    overflow-x: visible !important;
    overflow-y: visible !important;
}

.actions-cell {
    overflow: visible !important;
}


/* v51: финальный фикс меню троеточия — не выходит за правый край */
.row-actions {
    position: static !important;
}

.row-actions summary {
    position: relative !important;
    z-index: 1 !important;
}

.row-actions-menu {
    position: fixed !important;
    display: none !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    z-index: 2147483640 !important;
    min-width: 210px !important;
    max-width: 240px !important;
    width: max-content !important;
    box-sizing: border-box !important;
}

.row-actions[open] .row-actions-menu {
    display: grid !important;
}

.row-actions[open] .row-actions-menu:not(.is-positioned) {
    visibility: hidden !important;
}

.actions-cell .row-actions-menu,
.row-actions-menu[style] {
    right: auto !important;
    bottom: auto !important;
}

html,
body {
    overflow-x: hidden !important;
}


/* v52: настоящее floating-меню троеточия в body */
.row-actions > .row-actions-menu {
    display: none !important;
}

.row-actions[open] > .row-actions-menu {
    display: none !important;
}

.floating-row-actions-menu {
    position: fixed !important;
    display: grid !important;
    z-index: 2147483640 !important;
    min-width: 210px !important;
    max-width: 260px !important;
    width: max-content !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    box-sizing: border-box !important;
}

html,
body {
    overflow-x: hidden !important;
}


/* v53: source menu скрыт, floating-копия видна и кликабельна */
.row-actions > .row-actions-menu {
    display: none !important;
}

.row-actions[open] > .row-actions-menu {
    display: none !important;
}

.floating-row-actions-menu {
    position: fixed !important;
    display: grid !important;
    visibility: visible;
    z-index: 2147483640 !important;
    min-width: 210px !important;
    max-width: 260px !important;
    width: max-content !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    box-sizing: border-box !important;
    pointer-events: auto !important;
}

.floating-row-actions-menu * {
    pointer-events: auto !important;
}

/* v54: полностью новая система меню действий */
.row-actions,
.row-actions-menu,
.floating-row-actions-menu {
    display: none !important;
}

.actions-cell {
    position: relative !important;
    text-align: right !important;
    overflow: visible !important;
}

.action-dots-btn {
    border: 0 !important;
    background: transparent !important;
    color: #111827 !important;
    cursor: pointer !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    display: inline-grid !important;
    place-items: center !important;
}

.action-dots-btn:hover,
.action-dots-btn.is-open {
    background: #eef2ff !important;
    color: #2563eb !important;
}

.action-menu-template {
    display: none !important;
}

.new-action-menu {
    position: fixed !important;
    z-index: 2147483640 !important;
    min-width: 220px !important;
    max-width: 270px !important;
    display: grid !important;
    gap: 4px !important;
    padding: 10px !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 22px 55px rgba(15, 23, 42, .18) !important;
    box-sizing: border-box !important;
    visibility: hidden;
}

.new-action-menu a,
.new-action-menu button {
    width: 100% !important;
    display: block !important;
    text-align: left !important;
    border: 0 !important;
    background: transparent !important;
    color: #111827 !important;
    text-decoration: none !important;
    border-radius: 10px !important;
    padding: 11px 12px !important;
    font: inherit !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

.new-action-menu a:hover,
.new-action-menu button:hover {
    background: #f3f4f6 !important;
}

.new-action-menu .danger-action {
    color: #dc2626 !important;
}

.new-action-menu .danger-action:hover {
    background: #fef2f2 !important;
}

html,
body {
    overflow-x: hidden !important;
}


/* v57: страница настроек и тёмная/светлая тема */
.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 720px);
    gap: 18px;
}

.settings-card {
    display: grid;
    gap: 22px;
}

.settings-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.settings-card-head h2 {
    margin-bottom: 8px;
}

.settings-card-head p {
    margin: 0;
}

.theme-switch {
    position: relative;
    width: 72px;
    height: 40px;
    flex: 0 0 auto;
}

.theme-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #dbeafe;
    box-shadow: inset 0 0 0 1px #bfdbfe;
    cursor: pointer;
    transition: background .22s ease, box-shadow .22s ease;
}

.theme-slider::before {
    content: "";
    position: absolute;
    width: 32px;
    height: 32px;
    left: 4px;
    top: 4px;
    border-radius: 50%;
    background-color: #ffffff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
    background-image: none;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .18);
    transition: transform .24s ease, background-color .22s ease, background-image .22s ease;
}

.theme-switch input:checked + .theme-slider {
    background: #1e293b;
    box-shadow: inset 0 0 0 1px #334155;
}

.theme-switch input:checked + .theme-slider::before {
    transform: translateX(32px);
    background-color: #0f172a;
    background-image: none;
}

.theme-preview {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.theme-preview-window {
    width: 180px;
    height: 112px;
    border-radius: 16px;
    display: grid;
    grid-template-columns: 52px 1fr;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .10);
}

.theme-preview-sidebar {
    background: #111827;
}

.theme-preview-content {
    display: grid;
    gap: 10px;
    align-content: center;
    padding: 16px;
    background: #f3f6fb;
}

.theme-preview-content span {
    height: 12px;
    border-radius: 999px;
    background: #cbd5e1;
}

.theme-preview-content span:first-child {
    width: 70%;
    background: #2563eb;
}

.theme-preview strong {
    color: #0f172a;
}

/* Dark theme base */
html.theme-dark body {
    background: #0b1120;
    color: #e5e7eb;
}

html.theme-dark .main,
html.theme-dark .auth-main {
    color: #e5e7eb;
}

html.theme-dark .card,
html.theme-dark .client-card,
html.theme-dark .auth-card,
html.theme-dark .table-card,
html.theme-dark .home-tile,
html.theme-dark .settings-card,
html.theme-dark .calendar-card {
    background: #111827;
    color: #e5e7eb;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
    border-color: #1f2937;
}

html.theme-dark h1,
html.theme-dark h2,
html.theme-dark h3,
html.theme-dark strong,
html.theme-dark .home-tile,
html.theme-dark .calendar-date-number,
html.theme-dark .calendar-appointment-client,
html.theme-dark .profit-pie-center strong,
html.theme-dark .theme-preview strong {
    color: #f9fafb;
}

html.theme-dark p,
html.theme-dark .topbar p,
html.theme-dark .home-tile p,
html.theme-dark .info-row span,
html.theme-dark .company-row span,
html.theme-dark .profit-head p,
html.theme-dark .profit-legend-row small,
html.theme-dark .calendar-appointment-service,
html.theme-dark .calendar-appointment-car,
html.theme-dark .calendar-empty-day,
html.theme-dark .settings-card-head p {
    color: #9ca3af;
}

html.theme-dark table th {
    background: #1f2937;
    color: #cbd5e1;
}

html.theme-dark td {
    border-top-color: #263244;
}

html.theme-dark input,
html.theme-dark select,
html.theme-dark textarea {
    background: #0f172a;
    color: #e5e7eb;
    border-color: #334155;
}

html.theme-dark input::placeholder,
html.theme-dark textarea::placeholder {
    color: #64748b;
}


html.theme-dark .status-select.status-new {
    background: #2563eb !important;
    color: #eff6ff !important;
    border-color: transparent !important;
}

html.theme-dark .status-select.status-in_progress {
    background: #d97706 !important;
    color: #fffbeb !important;
    border-color: transparent !important;
}

html.theme-dark .status-select.status-done,
html.theme-dark .status-select.status-car_taken {
    background: #15803d !important;
    color: #f0fdf4 !important;
    border-color: transparent !important;
}

html.theme-dark .status-select.status-cancelled {
    background: #dc2626 !important;
    color: #fef2f2 !important;
    border-color: transparent !important;
}

html.theme-dark .row-actions summary {
    color: #f8fafc !important;
}

html.theme-dark .row-actions summary:hover {
    background: rgba(148, 163, 184, 0.14) !important;
}

html.theme-dark .action-dots-btn {
    color: #f8fafc !important;
}

html.theme-dark .action-dots-btn:hover,
html.theme-dark .action-dots-btn.is-open {
    background: rgba(148, 163, 184, 0.14) !important;
    color: #f8fafc !important;
}

html.theme-dark .button.secondary,
html.theme-dark .calendar-weekday,
html.theme-dark .profit-more-toggle {
    background: #1f2937;
    color: #e5e7eb;
}

html.theme-dark .button.secondary:hover,
html.theme-dark .profit-more-toggle:hover {
    background: #334155;
    color: #ffffff;
}

html.theme-dark .home-tile:hover {
    border-color: #334155;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .35);
}

html.theme-dark .home-tile-icon,
html.theme-dark .profit-total,
html.theme-dark .calendar-nav-btn {
    background: #1e293b;
    color: #93c5fd;
}

html.theme-dark .calendar-cell {
    background: #0f172a;
    border-color: #263244;
}

html.theme-dark .calendar-cell.today {
    background: #111827;
}

html.theme-dark .calendar-cell.other-month {
    background: #0b1220;
}

html.theme-dark .calendar-cell.weekend {
    background: #1a1115 !important;
}

html.theme-dark .calendar-weekday.weekend {
    background: #3b1515 !important;
    color: #fca5a5 !important;
}

html.theme-dark .calendar-empty-day {
    background: #111827;
    border-color: #334155;
}

html.theme-dark .calendar-appointment,
html.theme-dark .profit-legend-row,
html.theme-dark .profit-pie-center,
html.theme-dark .new-action-menu,
html.theme-dark .floating-search-popup {
    background: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html.theme-dark .new-action-menu a,
html.theme-dark .new-action-menu button {
    color: #e5e7eb !important;
}

html.theme-dark .new-action-menu a:hover,
html.theme-dark .new-action-menu button:hover {
    background: #1f2937 !important;
}

html.theme-dark .profit-empty,
html.theme-dark .theme-preview {
    background: #0f172a;
    border-color: #334155;
    color: #9ca3af;
}

html.theme-dark .theme-preview-window {
    background: #111827;
}

html.theme-dark .theme-preview-content {
    background: #0b1120;
}

html.theme-dark .theme-preview-content span {
    background: #334155;
}

html.theme-dark .message {
    background: #052e16;
    color: #bbf7d0;
}

html.theme-dark .app-toast {
    background: #111827;
    color: #e5e7eb;
    border-color: #334155;
}

html.theme-dark .app-toast-success {
    background: #052e16;
    border-color: #166534;
}

html.theme-dark .app-toast-error {
    background: #450a0a;
    border-color: #991b1b;
}

html.theme-dark .app-toast-content span {
    color: #d1d5db;
}

@media (max-width: 700px) {
    .settings-card-head,
    .theme-preview {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* v58: правки тёмной темы для модального окна записи и попапов поиска */
html.theme-dark .appointment-modal-window {
    background: #111827 !important;
    color: #e5e7eb !important;
    border: 1px solid #243041 !important;
    box-shadow: 0 36px 90px rgba(0, 0, 0, .52) !important;
}

html.theme-dark .appointment-modal-head h2,
html.theme-dark .appointment-modal-body h1,
html.theme-dark .appointment-modal-body h2,
html.theme-dark .appointment-modal-body h3,
html.theme-dark .appointment-modal-body label,
html.theme-dark .appointment-modal-body strong {
    color: #f8fafc !important;
}

html.theme-dark .appointment-modal-head p,
html.theme-dark .appointment-modal-body .helptext,
html.theme-dark .appointment-modal-body .char-counter,
html.theme-dark .appointment-modal-loading {
    color: #94a3b8 !important;
}

html.theme-dark .appointment-modal-close {
    background: #1f2937 !important;
    color: #e5e7eb !important;
    box-shadow: inset 0 0 0 1px #334155 !important;
}

html.theme-dark .appointment-modal-close:hover {
    background: #334155 !important;
    color: #ffffff !important;
}

html.theme-dark .appointment-modal-body input,
html.theme-dark .appointment-modal-body select,
html.theme-dark .appointment-modal-body textarea {
    background: #0b1730 !important;
    color: #f8fafc !important;
    border: 1px solid #314158 !important;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .12) !important;
}

html.theme-dark .appointment-modal-body input::placeholder,
html.theme-dark .appointment-modal-body textarea::placeholder {
    color: #8ea0bb !important;
}

html.theme-dark .appointment-modal-body input:focus,
html.theme-dark .appointment-modal-body select:focus,
html.theme-dark .appointment-modal-body textarea:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .18) !important;
    outline: none !important;
}

html.theme-dark .appointment-modal-body .char-counter.counter-warning {
    color: #fbbf24 !important;
}

html.theme-dark .appointment-modal-body .char-counter.counter-danger {
    color: #f87171 !important;
}

html.theme-dark .appointment-modal-body .errorlist,
html.theme-dark .appointment-modal-form .errorlist {
    background: rgba(127, 29, 29, .18) !important;
    color: #fecaca !important;
    border: 1px solid rgba(248, 113, 113, .22) !important;
}

html.theme-dark .appointment-modal-actions .button.secondary,
html.theme-dark .appointment-modal-actions button.secondary,
html.theme-dark .appointment-modal-actions a.secondary {
    background: #1f2937 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html.theme-dark .appointment-modal-actions .button.secondary:hover,
html.theme-dark .appointment-modal-actions button.secondary:hover,
html.theme-dark .appointment-modal-actions a.secondary:hover {
    background: #334155 !important;
    color: #ffffff !important;
}

html.theme-dark .floating-search-popup {
    background: #111827 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
    box-shadow: 0 24px 50px rgba(0, 0, 0, .42) !important;
}

html.theme-dark .floating-search-popup input,
html.theme-dark .floating-search-popup select,
html.theme-dark .header-search-popover input,
html.theme-dark .header-search-popover select {
    background: #0b1730 !important;
    color: #f8fafc !important;
    border: 1px solid #314158 !important;
}

html.theme-dark .floating-search-popup input::placeholder,
html.theme-dark .header-search-popover input::placeholder,
html.theme-dark .floating-search-popup select,
html.theme-dark .header-search-popover select {
    color: #8ea0bb !important;
}

html.theme-dark .floating-search-popup input:focus,
html.theme-dark .floating-search-popup select:focus,
html.theme-dark .header-search-popover input:focus,
html.theme-dark .header-search-popover select:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .18) !important;
}

html.theme-dark .floating-search-popup .button.secondary,
html.theme-dark .header-search-actions .button.secondary {
    background: #1f2937 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

html.theme-dark .floating-search-popup .button.secondary:hover,
html.theme-dark .header-search-actions .button.secondary:hover {
    background: #334155 !important;
    color: #ffffff !important;
}


/* v60: карточка клиента */
.client-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease;
}

.client-card-link:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .12);
}

.client-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.client-card-open {
    font-size: 13px;
    font-weight: 800;
    color: #2563eb;
    background: #eff6ff;
    padding: 7px 10px;
    border-radius: 999px;
}

.table-client-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 800;
}

.table-client-link:hover {
    text-decoration: underline;
}

.client-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(230px, .7fr) minmax(230px, .7fr);
    gap: 18px;
    margin-bottom: 18px;
}

.client-profile-card {
    display: grid;
    grid-template-columns: 78px 1fr;
    align-items: center;
    gap: 18px;
}

.client-avatar {
    width: 78px;
    height: 78px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    color: white;
    font-size: 34px;
    font-weight: 900;
}

.client-profile-card h2 {
    margin-bottom: 8px;
}

.client-profile-card p {
    margin: 0;
}

.client-detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.client-money-card {
    display: grid;
    align-content: center;
    gap: 8px;
}

.client-money-card span,
.client-money-card small {
    color: #64748b;
    font-weight: 800;
}

.client-money-card strong {
    font-size: 30px;
    color: #2563eb;
}

.client-detail-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.client-cars-list,
.client-services-list {
    display: grid;
    gap: 10px;
}

.client-car-item,
.client-service-item {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px;
    background: #f8fafc;
}

.client-car-item {
    display: grid;
    gap: 5px;
}

.client-car-item span,
.client-service-item span {
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
}

.client-service-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.client-service-item b {
    color: #2563eb;
    white-space: nowrap;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.section-head h2 {
    margin-bottom: 6px;
}

.section-head p {
    margin: 0;
}

.client-status-pill {
    display: inline-flex;
    align-items: center;
    max-width: 260px;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-status-pill.status-new {
    background: #dbeafe;
    color: #1d4ed8;
}

.client-status-pill.status-in_progress {
    background: #fef3c7;
    color: #92400e;
}

.client-status-pill.status-done,
.client-status-pill.status-car_taken {
    background: #dcfce7;
    color: #166534;
}

.client-status-pill.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.small-empty {
    padding: 16px;
    border-radius: 14px;
}

@media (max-width: 1100px) {
    .client-detail-grid,
    .client-detail-columns {
        grid-template-columns: 1fr;
    }
}

html.theme-dark .client-card-open {
    background: #1e293b;
    color: #93c5fd;
}

html.theme-dark .table-client-link {
    color: #93c5fd;
}

html.theme-dark .client-car-item,
html.theme-dark .client-service-item {
    background: #0f172a;
    border-color: #334155;
}

html.theme-dark .client-car-item span,
html.theme-dark .client-service-item span,
html.theme-dark .client-money-card span,
html.theme-dark .client-money-card small {
    color: #94a3b8;
}

html.theme-dark .client-money-card strong,
html.theme-dark .client-service-item b {
    color: #60a5fa;
}


/* v61: фикс кликабельности карточек клиентов и pill в тёмной теме */
.client-card-link {
    display: block !important;
    color: inherit !important;
    text-decoration: none !important;
    cursor: pointer !important;
    border: 1px solid transparent;
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        border-color .18s ease,
        background .18s ease;
}

.client-card-link:hover {
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .12);
}

.client-card-link h3,
.client-card-link p {
    color: inherit;
}

.client-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.client-card-open {
    font-size: 13px;
    font-weight: 800;
    color: #2563eb;
    background: #eff6ff;
    padding: 7px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

html.theme-dark .client-card-link:hover {
    border-color: #334155;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .32);
}

html.theme-dark .client-card-open {
    background: #1e293b;
    color: #93c5fd;
}

html.theme-dark .pill {
    background: #1f2937 !important;
    color: #e5e7eb !important;
    border: 1px solid #334155 !important;
}


/* v62: монохромные иконки на главной и в боковой панели */
.home-tile-icon {
    color: #111827;
    font-size: 0 !important;
}

.home-tile-icon svg {
    width: 31px;
    height: 31px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-icon {
    width: 21px;
    height: 21px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 21px;
    color: currentColor;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

html.theme-dark .home-tile-icon {
    color: #e5e7eb;
    background: #1f2937;
}

html.theme-dark .home-tile-icon svg,
html.theme-dark .nav-icon svg {
    stroke: currentColor;
}


/* v67: настройки звуков и даты */
.settings-list {
    display: grid;
    gap: 12px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.settings-row div {
    display: grid;
    gap: 5px;
}

.settings-row strong,
.settings-field > span {
    font-weight: 900;
    color: #0f172a;
}

.settings-row span {
    color: #64748b;
    font-weight: 700;
}

.small-switch {
    width: 64px;
    height: 36px;
}

.small-switch .theme-slider::before {
    width: 28px;
    height: 28px;
    background-size: 14px 14px;
}

.small-switch input:checked + .theme-slider::before {
    transform: translateX(28px);
}

.settings-field {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.settings-field select {
    max-width: 420px;
}

html.theme-dark .settings-row,
html.theme-dark .settings-field {
    background: #0f172a;
    border-color: #334155;
}

html.theme-dark .settings-row strong,
html.theme-dark .settings-field > span {
    color: #f8fafc;
}

html.theme-dark .settings-row span {
    color: #94a3b8;
}

@media (max-width: 700px) {
    .settings-row {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* v68: сайт-confirm вместо browser confirm */
.site-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity .18s ease;
}

.site-confirm-overlay.is-visible {
    opacity: 1;
}

.site-confirm-overlay.is-hiding {
    opacity: 0;
}

.site-confirm-window {
    width: min(460px, 100%);
    padding: 24px;
    border-radius: 24px;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
    border: 1px solid #e5e7eb;
    transform: translateY(10px) scale(.98);
    transition: transform .18s ease;
}

.site-confirm-overlay.is-visible .site-confirm-window {
    transform: translateY(0) scale(1);
}

.site-confirm-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    margin-bottom: 14px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 24px;
    font-weight: 900;
}

.site-confirm-window h2 {
    margin: 0 0 8px;
    font-size: 24px;
}

.site-confirm-window p {
    margin: 0;
    color: #64748b;
    font-weight: 700;
    line-height: 1.45;
}

.site-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.danger-button {
    background: #dc2626 !important;
    color: #ffffff !important;
}

.danger-button:hover {
    background: #b91c1c !important;
}

html.theme-dark .site-confirm-overlay {
    background: rgba(2, 6, 23, .56);
}

html.theme-dark .site-confirm-window {
    background: #111827;
    color: #f8fafc;
    border-color: #334155;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .46);
}

html.theme-dark .site-confirm-window p {
    color: #94a3b8;
}

html.theme-dark .site-confirm-icon {
    background: rgba(220, 38, 38, .18);
    color: #fca5a5;
}

@media (max-width: 520px) {
    .site-confirm-actions {
        flex-direction: column;
    }

    .site-confirm-actions .button {
        width: 100%;
    }
}


/* v69 confirm overlay safety */
.site-confirm-overlay[hidden] {
    display: none !important;
}

.site-confirm-overlay:not([hidden]) {
    display: grid !important;
}

.site-confirm-overlay {
    z-index: 2147483646 !important;
}


/* v71: управление клиентами и авто */
.add-client-card,
.edit-client-card {
    margin-bottom: 18px;
}

.client-manage-form {
    display: grid;
    gap: 14px;
}

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

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

.client-manage-form label {
    display: grid;
    gap: 7px;
    font-weight: 800;
}

.client-manage-form label span {
    color: #334155;
}

.form-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.topbar-actions .inline-delete-form {
    margin: 0;
}

.manageable-car-item {
    display: flex !important;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.manageable-car-item > div {
    display: grid;
    gap: 5px;
}

.inline-delete-form {
    margin: 0;
    flex: 0 0 auto;
}

html.theme-dark .client-manage-form label span {
    color: #cbd5e1;
}

@media (max-width: 900px) {
    .compact-form-grid,
    .car-form-grid {
        grid-template-columns: 1fr;
    }

    .manageable-car-item {
        flex-direction: column;
    }
}


/* v72: плюс-кнопки и модалки добавления клиента/авто */
.icon-plus-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    border-radius: 999px;
    padding: 8px 14px 8px 8px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.icon-plus-button:hover {
    transform: translateY(-1px);
    border-color: #93c5fd;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.10);
}

.icon-plus-circle {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    flex: 0 0 34px;
}

.icon-plus-circle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.small-plus-button {
    padding-right: 12px;
}

.add-section-head {
    align-items: center;
}

.simple-action-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 8, 23, 0.55);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity .18s ease;
}

.simple-action-modal-overlay[hidden] {
    display: none !important;
}

.simple-action-modal-overlay.is-visible {
    opacity: 1;
}

.simple-action-modal-window {
    width: min(780px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
    transform: translateY(12px) scale(.98);
    transition: transform .18s ease;
}

.simple-action-modal-overlay.is-visible .simple-action-modal-window {
    transform: translateY(0) scale(1);
}

.simple-action-modal-overlay.is-hiding {
    opacity: 0;
}

.simple-action-modal-overlay.is-hiding .simple-action-modal-window {
    transform: translateY(12px) scale(.98);
}

.simple-action-modal-body {
    padding: 26px;
}

.simple-action-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.simple-action-modal-head h2 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.05;
    color: #0f172a;
}

.simple-action-modal-head p {
    margin: 0;
    color: #64748b;
    font-size: 16px;
}

.simple-action-modal-close {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}

.simple-action-modal-close:hover {
    background: #cbd5e1;
}

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

html.theme-dark .icon-plus-button {
    background: #111827;
    color: #f8fafc;
    border-color: #334155;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

html.theme-dark .icon-plus-button:hover {
    border-color: #475569;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.32);
}

html.theme-dark .icon-plus-circle {
    background: #0f172a;
    border-color: #334155;
}

html.theme-dark .simple-action-modal-window {
    background: #111827;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.50);
}

html.theme-dark .simple-action-modal-head h2 {
    color: #f8fafc;
}

html.theme-dark .simple-action-modal-head p {
    color: #94a3b8;
}

html.theme-dark .simple-action-modal-close {
    background: #1f2937;
    color: #f8fafc;
}

html.theme-dark .simple-action-modal-close:hover {
    background: #334155;
}

@media (max-width: 760px) {
    .icon-plus-button span:last-child {
        display: none;
    }

    .icon-plus-button {
        padding-right: 8px;
    }

    .simple-action-modal-body {
        padding: 20px;
    }

    .simple-action-modal-head h2 {
        font-size: 24px;
    }
}


/* v73: исправление белой полосы у модалок и пометка «необязательно» */
.simple-action-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
}

.optional-label {
    display: inline;
    margin-left: 6px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    vertical-align: baseline;
}

html.theme-dark .optional-label {
    color: #64748b;
}


/* v74: видимая пометка «необязательно» для госномера */
.optional-label {
    display: inline-block !important;
    margin-left: 6px !important;
    color: #94a3b8 !important;
    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    vertical-align: baseline !important;
    white-space: nowrap !important;
}

html.theme-dark .optional-label {
    color: #64748b !important;
}


/* v75: автоподстановка клиента и выбор авто в новой записи */
.appointment-autocomplete {
    position: relative;
    z-index: 20;
    margin: 0 0 16px;
    border: 1px solid #dbe3ef;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 18px 46px rgba(15, 23, 42, .12);
    overflow: hidden;
}

.appointment-autocomplete[hidden] {
    display: none !important;
}

.appointment-autocomplete-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.appointment-autocomplete-head strong {
    color: #0f172a;
    font-size: 14px;
}

.appointment-autocomplete-head button {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 9px;
    background: #e5e7eb;
    color: #0f172a;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.appointment-suggestions-list {
    display: grid;
    gap: 0;
    max-height: 320px;
    overflow: auto;
}

.appointment-suggestion-item {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #eef2f7;
    background: #ffffff;
    padding: 13px 14px;
    display: grid;
    gap: 4px;
    text-align: left;
    cursor: pointer;
    color: #0f172a;
    transition: background .15s ease;
}

.appointment-suggestion-item:hover {
    background: #eff6ff;
}

.appointment-suggestion-item:last-child {
    border-bottom: 0;
}

.suggestion-title {
    font-weight: 900;
}

.suggestion-subtitle,
.suggestion-cars,
.appointment-suggestion-empty,
.appointment-car-choice-title {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.appointment-suggestion-empty,
.appointment-car-choice-title {
    padding: 13px 14px;
}

.car-choice .suggestion-title,
.new-car-choice .suggestion-title {
    color: #2563eb;
}

html.theme-dark .appointment-autocomplete {
    background: #111827;
    border-color: #334155;
    box-shadow: 0 18px 46px rgba(0, 0, 0, .32);
}

html.theme-dark .appointment-autocomplete-head {
    background: #1f2937;
    border-color: #334155;
}

html.theme-dark .appointment-autocomplete-head strong,
html.theme-dark .appointment-suggestion-item {
    color: #f8fafc;
}

html.theme-dark .appointment-autocomplete-head button {
    background: #334155;
    color: #f8fafc;
}

html.theme-dark .appointment-suggestion-item {
    background: #111827;
    border-color: #263244;
}

html.theme-dark .appointment-suggestion-item:hover {
    background: #1e293b;
}

html.theme-dark .suggestion-subtitle,
html.theme-dark .suggestion-cars,
html.theme-dark .appointment-suggestion-empty,
html.theme-dark .appointment-car-choice-title {
    color: #94a3b8;
}

html.theme-dark .car-choice .suggestion-title,
html.theme-dark .new-car-choice .suggestion-title {
    color: #93c5fd;
}


/* v76/v78: компактная кнопка найденных клиентов и выбор плитками */
.found-clients-button {
    margin-top: 2px;
    width: fit-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 8px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    padding: 7px 12px;
    background: #f8fbff;
    color: #2563eb;
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .18s ease, transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .08);
}

.found-clients-button[hidden] {
    display: none !important;
}

.found-clients-button.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.found-clients-button:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .12);
}

.found-clients-button-icon {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(37, 99, 235, .10);
    color: #2563eb;
    flex: 0 0 20px;
}

.found-clients-button-icon svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}


.appointment-autocomplete {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483300 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: rgba(2, 8, 23, .52) !important;
    backdrop-filter: blur(7px);
    box-shadow: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity .18s ease;
    overflow: auto;
}

.appointment-autocomplete[hidden] {
    display: none !important;
}

.appointment-autocomplete.is-visible {
    opacity: 1;
}

.appointment-autocomplete-head,
.appointment-suggestions-list {
    width: min(980px, calc(100vw - 48px));
}

.appointment-autocomplete-head {
    border-radius: 24px 24px 0 0;
    padding: 18px 20px;
}

.appointment-autocomplete-head strong {
    font-size: 20px;
}

.appointment-suggestions-list {
    background: #ffffff;
    border-radius: 0 0 24px 24px;
    padding: 18px;
    max-height: min(70vh, 680px);
    overflow: auto;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .30);
}

.appointment-client-tiles,
.appointment-car-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.client-tile-choice {
    width: 100%;
    min-height: 148px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #f8fafc;
    color: #0f172a;
    padding: 16px;
    display: grid;
    gap: 7px;
    text-align: left;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.client-tile-choice:hover {
    transform: translateY(-2px);
    border-color: #93c5fd;
    background: #eff6ff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .12);
}

.client-tile-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #2563eb;
    color: #ffffff;
    font-size: 20px;
    font-weight: 900;
}

.client-tile-name {
    font-size: 17px;
    font-weight: 900;
    color: inherit;
}

.client-tile-phone,
.client-tile-cars {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.appointment-car-choice-title {
    grid-column: 1 / -1;
    padding: 0 0 4px;
    font-size: 14px;
}

.car-tile-choice {
    min-height: 104px;
}

.new-car-choice .client-tile-name {
    color: #2563eb;
}

html.theme-dark .found-clients-button {
    background: #0f1b33;
    border-color: #2d4267;
    color: #c7d7f4;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
}

html.theme-dark .found-clients-button:hover {
    background: #122240;
    border-color: #4d6da1;
    color: #e2ecff;
}

html.theme-dark .found-clients-button-icon {
    background: rgba(147, 197, 253, .14);
    color: #93c5fd;
}

html.theme-dark .appointment-suggestions-list {
    background: #111827;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .50);
}

html.theme-dark .client-tile-choice {
    background: #0f172a;
    border-color: #334155;
    color: #f8fafc;
}

html.theme-dark .client-tile-choice:hover {
    background: #1e293b;
    border-color: #475569;
}

html.theme-dark .client-tile-phone,
html.theme-dark .client-tile-cars {
    color: #94a3b8;
}

html.theme-dark .new-car-choice .client-tile-name {
    color: #93c5fd;
}

@media (max-width: 900px) {
    .appointment-client-tiles,
    .appointment-car-tiles {
        grid-template-columns: 1fr;
    }
}


/* v77: нормальное окно выбора клиента и правильный Escape */
.appointment-autocomplete {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
}

.appointment-autocomplete-head,
.appointment-suggestions-list {
    width: min(920px, calc(100vw - 48px)) !important;
    box-sizing: border-box !important;
}

.appointment-autocomplete-head {
    flex: 0 0 auto !important;
    border-radius: 24px 24px 0 0 !important;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .20) !important;
}

.appointment-suggestions-list {
    flex: 0 1 auto !important;
    border-radius: 0 0 24px 24px !important;
    min-height: 0 !important;
}

.appointment-client-tiles,
.appointment-car-tiles {
    width: 100% !important;
}

html.theme-dark .appointment-autocomplete-head {
    box-shadow: 0 18px 50px rgba(0, 0, 0, .38) !important;
}



/* v79: кнопка найденных клиентов встроена справа в поле телефона */
.phone-found-inline {
    position: relative;
}

.phone-found-inline .phone-found-inline-input {
    padding-right: 235px !important;
}

.phone-found-inline .found-clients-button {
    position: absolute;
    right: 12px;
    top: 24px;
    margin: 0;
    z-index: 4;
    max-width: calc(100% - 22px);
    justify-self: auto;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .12);
}

.phone-found-inline .found-clients-button-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
}

.phone-found-inline .found-clients-button-icon svg {
    width: 12px;
    height: 12px;
}

@media (max-width: 900px) {
    .phone-found-inline .phone-found-inline-input {
        padding-right: 205px !important;
    }
    .phone-found-inline .found-clients-button {
        top: 25px;
        right: 10px;
        padding: 7px 10px;
        font-size: 11px;
    }
}

@media (max-width: 640px) {
    .phone-found-inline .phone-found-inline-input {
        padding-right: 190px !important;
    }
    .phone-found-inline .found-clients-button {
        max-width: calc(100% - 16px);
    }
}


/* v80: точное положение кнопки найденных клиентов внутри поля телефона */
.phone-found-inline .found-clients-button {
    top: 24px !important;
    right: 12px !important;
}

.phone-found-inline .phone-found-inline-input {
    padding-right: 238px !important;
}

@media (max-width: 900px) {
    .phone-found-inline .found-clients-button {
        top: 25px !important;
        right: 10px !important;
    }
}


/* v82: кнопка найденных клиентов внутри поля телефона без ручных top-подгонок */
.phone-input-action-wrap {
    position: relative;
    width: 100%;
    display: block;
}

.phone-input-action-wrap .phone-found-inline-input {
    padding-right: 240px !important;
}

.phone-input-action-wrap .found-clients-button {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    margin: 0 !important;
    z-index: 5 !important;
    max-width: calc(100% - 20px) !important;
    transform: translateY(-50%) translateX(8px) !important;
}

.phone-input-action-wrap .found-clients-button.is-visible {
    transform: translateY(-50%) translateX(0) !important;
}

.phone-found-inline > .found-clients-button {
    position: static !important;
}

.phone-input-action-wrap + .char-counter {
    margin-top: 4px !important;
}

@media (max-width: 900px) {
    .phone-input-action-wrap .phone-found-inline-input {
        padding-right: 210px !important;
    }
}

@media (max-width: 640px) {
    .phone-input-action-wrap .phone-found-inline-input {
        padding-right: 170px !important;
    }

    .phone-input-action-wrap .found-clients-button {
        padding: 7px 9px !important;
        font-size: 11px !important;
    }

    .phone-input-action-wrap .found-clients-button-icon {
        display: none !important;
    }
}


/* v83: новая запись прокручивается внутри модалки без видимого скроллбара */
.appointment-modal-overlay {
    overflow: hidden;
}

.appointment-modal-window {
    display: flex;
    flex-direction: column;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.appointment-modal-window::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.appointment-modal-body {
    flex: 1 1 auto;
    min-height: 0;
}

@media (max-width: 900px) {
    .appointment-modal-window {
        max-height: calc(100vh - 20px) !important;
    }
}


 /* v84: цветные метки услуг */
.service-color-tag.is-service-colored {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--service-color);
    color: var(--service-text);
    font-weight: 900;
    line-height: 1.15;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.calendar-appointment-service.service-color-tag.is-service-colored {
    padding: 3px 7px;
    font-size: 11px;
    white-space: normal;
}

.service-color-settings {
    display: grid;
    gap: 10px;
}

.service-color-setting-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(220px, 2fr) 64px;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #f8fafc;
}

.service-color-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    color: #0f172a;
}

.service-color-toggle input {
    width: 18px;
    height: 18px;
}

.service-color-pattern {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.service-color-setting-row input[type="color"] {
    width: 54px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
}

html.theme-dark .service-color-setting-row {
    background: #0f172a;
    border-color: #334155;
}

html.theme-dark .service-color-toggle {
    color: #f8fafc;
}

html.theme-dark .service-color-pattern {
    color: #94a3b8;
}

@media (max-width: 760px) {
    .service-color-setting-row {
        grid-template-columns: 1fr auto;
    }

    .service-color-pattern {
        grid-column: 1 / -1;
    }
}


/* v86: отдельные иконки для звуковых тумблеров */
.sound-switch .theme-slider {
    background: #e5e7eb;
    box-shadow: inset 0 0 0 1px #cbd5e1;
}

.sound-switch .theme-slider::before {
    background-color: #ffffff;
    background-image: none;
}

.sound-switch input:checked + .theme-slider {
    background: #1e293b;
    box-shadow: inset 0 0 0 1px #334155;
}

.sound-switch input:checked + .theme-slider::before {
    transform: translateX(28px);
    background-color: #0f172a;
    background-image: none;
}

html.theme-dark .sound-switch .theme-slider {
    background: #111827;
    box-shadow: inset 0 0 0 1px #334155;
}

html.theme-dark .sound-switch .theme-slider::before {
    background-color: #0f172a;
    background-image: none;
}

html.theme-dark .sound-switch input:checked + .theme-slider {
    background: #2563eb;
    box-shadow: inset 0 0 0 1px #3b82f6;
}

html.theme-dark .sound-switch input:checked + .theme-slider::before {
    background-color: #0f172a;
    background-image: none;
}


/* v87: модалка новой записи прокручивается на 16:9 без видимого скроллбара */
.appointment-modal-overlay {
    align-items: flex-start !important;
    justify-content: center;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 14px !important;
}

.appointment-modal-window {
    width: min(1100px, calc(100vw - 28px));
    max-height: calc(100vh - 28px) !important;
    margin: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
}

.appointment-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.appointment-modal-body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

@media (max-width: 900px) {
    .appointment-modal-overlay {
        padding: 10px !important;
    }

    .appointment-modal-window {
        width: min(1100px, calc(100vw - 20px));
        max-height: calc(100vh - 20px) !important;
    }
}


/* v88: красивый видимый скроллбар в модалке новой записи */
.appointment-modal-body {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #9aa8bc #edf2f7;
}

.appointment-modal-body::-webkit-scrollbar {
    width: 10px;
    height: 10px;
    display: block;
}

.appointment-modal-body::-webkit-scrollbar-track {
    background: #edf2f7;
    border-radius: 999px;
    margin: 10px 6px 10px 0;
}

.appointment-modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
    border-radius: 999px;
    border: 2px solid #edf2f7;
    min-height: 40px;
}

.appointment-modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #7f92ab 0%, #506175 100%);
}

.appointment-modal-body::-webkit-scrollbar-corner {
    background: transparent;
}

html.theme-dark .appointment-modal-body {
    scrollbar-color: #475569 #162033;
}

html.theme-dark .appointment-modal-body::-webkit-scrollbar-track {
    background: #162033;
}

html.theme-dark .appointment-modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #64748b 0%, #475569 100%);
    border-color: #162033;
}

html.theme-dark .appointment-modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #7b8ca3 0%, #5b6b81 100%);
}


/* v89: скроллбар модалки не выходит за рамки */
.appointment-modal-window {
    position: relative;
}

.appointment-modal-body {
    width: calc(100% - 8px);
    margin-right: 8px;
    box-sizing: border-box;
    padding-right: 14px;
}

@supports (scrollbar-gutter: stable) {
    .appointment-modal-body {
        scrollbar-gutter: stable;
    }
}

@media (max-width: 900px) {
    .appointment-modal-body {
        width: calc(100% - 6px);
        margin-right: 6px;
        padding-right: 10px;
    }
}


/* v90: VIN и обязательные поля авто */
.add-car-form .car-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 760px) {
    .add-car-form .car-form-grid {
        grid-template-columns: 1fr;
    }
}


/* v91: редактирование авто клиента */
.car-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.car-actions .inline-delete-form {
    margin: 0;
}

.car-actions .mini-button {
    min-height: 34px;
    border-radius: 12px;
    padding: 8px 12px;
    border: 0;
    background: #e8eef8;
    color: #0f172a;
    font-weight: 900;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}

.car-actions .mini-button:hover {
    transform: translateY(-1px);
    background: #dbeafe;
}

html.theme-dark .car-actions .mini-button {
    background: #1f2937;
    color: #f8fafc;
}

html.theme-dark .car-actions .mini-button:hover {
    background: #334155;
}

@media (max-width: 760px) {
    .car-actions {
        justify-content: flex-start;
    }
}


/* v92: заметная кнопка редактирования авто клиента */
.manageable-car-item {
    align-items: center !important;
}

.car-actions {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

.car-actions .inline-delete-form {
    margin: 0;
}

.car-actions .mini-button {
    min-height: 38px;
    border-radius: 14px;
    padding: 9px 14px;
    border: 0;
    font-weight: 900;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.car-actions .mini-button.edit {
    background: #dbeafe;
    color: #1d4ed8;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .10);
}

.car-actions .mini-button.edit:hover {
    transform: translateY(-1px);
    background: #bfdbfe;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .16);
}

html.theme-dark .car-actions .mini-button.edit {
    background: #1d3b66;
    color: #dbeafe;
}

html.theme-dark .car-actions .mini-button.edit:hover {
    background: #24518e;
}

@media (max-width: 760px) {
    .car-actions {
        justify-content: flex-start;
        margin-left: 0;
    }
}


/* v93: вкладка «Сегодняшний день» */
.today-home-tile {
    border-color: rgba(37, 99, 235, .22);
    background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
}

.today-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    overflow: hidden;
    position: relative;
}

.today-hero::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -70px;
    top: -90px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .09);
    pointer-events: none;
}

.today-hero-kicker {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 900;
    font-size: 13px;
}

.today-hero h2 {
    margin: 0 0 8px;
    font-size: 30px;
    color: #0f172a;
}

.today-hero p {
    margin: 0;
    color: #64748b;
    font-weight: 700;
}

.today-date-badge {
    width: 116px;
    height: 116px;
    border-radius: 30px;
    background: #2563eb;
    color: #ffffff;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    box-shadow: 0 18px 36px rgba(37, 99, 235, .22);
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
}

.today-date-badge span {
    font-size: 42px;
    font-weight: 950;
    line-height: 1;
}

.today-date-badge small {
    font-weight: 900;
    opacity: .9;
}

.today-list {
    display: grid;
    gap: 14px;
}

.today-appointment-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .07);
    border: 1px solid rgba(226, 232, 240, .95);
    transition: transform .18s ease, box-shadow .18s ease;
}

.today-appointment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .10);
}

.today-appointment-number {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: #eff6ff;
    color: #2563eb;
    font-size: 22px;
    font-weight: 950;
    border: 1px solid #bfdbfe;
}

.today-appointment-time {
    width: fit-content;
    margin-bottom: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1d4ed8;
    font-weight: 950;
    font-size: 14px;
}

.today-appointment-main h2 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 22px;
}

.today-appointment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.today-appointment-meta > span:not(.service-color-tag) {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}

.today-appointment-side {
    display: grid;
    justify-items: end;
    gap: 8px;
    min-width: 210px;
}

.today-appointment-side strong {
    color: #0f172a;
    font-size: 18px;
}

.today-status {
    display: inline-flex;
    align-items: center;
    max-width: 260px;
    min-height: 32px;
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 900;
    font-size: 13px;
}

.today-empty {
    display: grid;
    gap: 8px;
    justify-items: start;
    padding: 28px;
}

.today-empty h2 {
    margin: 0;
}

.today-empty p {
    margin: 0 0 10px;
    color: #64748b;
    font-weight: 700;
}

html.theme-dark .today-home-tile {
    background: linear-gradient(135deg, #111827 0%, #0f1b33 100%);
    border-color: #334155;
}

html.theme-dark .today-hero,
html.theme-dark .today-appointment-card,
html.theme-dark .today-empty {
    background: #111827;
    border-color: #263244;
}

html.theme-dark .today-hero h2,
html.theme-dark .today-appointment-main h2,
html.theme-dark .today-appointment-side strong {
    color: #f8fafc;
}

html.theme-dark .today-hero p,
html.theme-dark .today-empty p {
    color: #94a3b8;
}

html.theme-dark .today-appointment-number {
    background: #0f1b33;
    border-color: #334155;
    color: #93c5fd;
}

html.theme-dark .today-appointment-time {
    background: #1e293b;
    color: #bfdbfe;
}

html.theme-dark .today-appointment-meta > span:not(.service-color-tag) {
    background: #1f2937;
    color: #cbd5e1;
}

@media (max-width: 900px) {
    .today-hero {
        align-items: flex-start;
    }

    .today-date-badge {
        width: 92px;
        height: 92px;
        border-radius: 24px;
    }

    .today-date-badge span {
        font-size: 34px;
    }

    .today-appointment-card {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .today-appointment-side {
        grid-column: 1 / -1;
        justify-items: start;
        min-width: 0;
    }
}

@media (max-width: 620px) {
    .today-hero {
        flex-direction: column;
    }

    .today-appointment-card {
        grid-template-columns: 1fr;
    }

    .today-appointment-number {
        width: 42px;
        height: 42px;
        border-radius: 15px;
    }
}


/* v95: сегодняшний день — столбики клиент/машина/услуга/статус */
.today-columns-card {
    grid-template-columns: 58px minmax(180px, 1.15fr) minmax(190px, 1fr) minmax(170px, .9fr) minmax(210px, .85fr);
    align-items: stretch;
}

.today-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    padding: 2px 0;
}

.today-column-label {
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.today-client-column h2 {
    margin: 0;
    color: #0f172a;
    font-size: 22px;
    line-height: 1.1;
}

.today-client-column p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    font-weight: 800;
}

.today-car-column strong {
    color: #0f172a;
    font-size: 17px;
    line-height: 1.15;
}

.today-car-column span:not(.today-column-label),
.today-service-column small {
    color: #64748b;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.25;
}

.today-service-column .service-color-tag {
    max-width: 100%;
}

.today-status-column {
    align-items: stretch;
}

.today-status-form {
    margin: 0;
}

.today-status-form .status-select {
    width: 100%;
    max-width: 100%;
}

.today-open-link {
    width: fit-content;
    justify-self: end;
    align-self: flex-end;
    text-decoration: none;
}

html.theme-dark .today-column-label {
    background: #1f2937;
    color: #94a3b8;
}

html.theme-dark .today-client-column h2,
html.theme-dark .today-car-column strong {
    color: #f8fafc;
}

html.theme-dark .today-client-column p,
html.theme-dark .today-car-column span:not(.today-column-label),
html.theme-dark .today-service-column small {
    color: #94a3b8;
}

@media (max-width: 1180px) {
    .today-columns-card {
        grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr);
    }

    .today-status-column,
    .today-service-column {
        grid-column: span 1;
    }
}

@media (max-width: 820px) {
    .today-columns-card {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .today-car-column,
    .today-service-column,
    .today-status-column {
        grid-column: 2 / -1;
    }

    .today-status-column {
        align-items: flex-start;
    }

    .today-status-form .status-select {
        min-width: 240px;
    }

    .today-open-link {
        align-self: flex-start;
    }
}

@media (max-width: 560px) {
    .today-columns-card {
        grid-template-columns: 1fr;
    }

    .today-car-column,
    .today-service-column,
    .today-status-column {
        grid-column: auto;
    }
}


/* v96: доработка страницы «Сегодняшний день» */
.today-earned-line {
    margin-top: 10px !important;
    padding-top: 10px;
    border-top: 1px solid rgba(148, 163, 184, .22);
}

.today-earned-line strong {
    color: #16a34a;
    font-weight: 950;
}

.today-date-badge small {
    color: #ffffff !important;
    opacity: .95;
}

.today-date-badge.weekend-date span {
    color: #ef4444 !important;
}

.today-order-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    align-self: center;
}

.today-edit-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}

.today-edit-icon:hover {
    transform: translateY(-1px);
    background: #e2e8f0;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .10);
}

.today-edit-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.today-columns-card {
    grid-template-columns: 58px minmax(190px, 1fr) minmax(210px, 1.05fr) minmax(210px, 1fr) minmax(250px, 1.15fr);
    column-gap: 28px;
}

.today-column {
    align-items: flex-start;
    text-align: left;
    padding-left: 0;
}

.today-column-label {
    margin-left: 0;
}

.today-service-column small {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.today-service-column small span {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 850;
}

.today-status-column {
    justify-content: center;
}

.today-status-form {
    width: 100%;
}

.today-status-form .status-select {
    min-width: 0;
    width: 100%;
}

html.theme-dark .today-earned-line {
    border-top-color: rgba(148, 163, 184, .18);
}

html.theme-dark .today-earned-line strong {
    color: #86efac;
}

html.theme-dark .today-edit-icon {
    background: #1f2937;
    color: #f8fafc;
    border-color: #334155;
}

html.theme-dark .today-edit-icon:hover {
    background: #334155;
}

html.theme-dark .today-service-column small span {
    background: #1f2937;
    color: #94a3b8;
}

@media (max-width: 1180px) {
    .today-columns-card {
        grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 18px;
    }
}

@media (max-width: 820px) {
    .today-order-cell {
        align-self: flex-start;
    }

    .today-car-column,
    .today-service-column,
    .today-status-column {
        grid-column: 2 / -1;
    }

    .today-status-form .status-select {
        width: min(100%, 320px);
    }
}

@media (max-width: 560px) {
    .today-columns-card {
        grid-template-columns: 1fr;
    }

    .today-order-cell {
        flex-direction: row;
        justify-content: flex-start;
    }

    .today-car-column,
    .today-service-column,
    .today-status-column {
        grid-column: auto;
    }
}


/* v97 edit appointment page modal style */
.appointment-page-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    padding: 28px;
    overflow-y: auto;
}

.appointment-page-window {
    width: min(1000px, calc(100vw - 56px));
    max-height: none;
    margin: auto;
}

.appointment-page-body {
    max-height: min(88vh, 980px);
}

@media (max-width: 720px) {
    .appointment-page-overlay {
        padding: 16px;
    }

    .appointment-page-window {
        width: min(100%, calc(100vw - 32px));
    }

    .appointment-page-body {
        max-height: 90vh;
    }
}


/* v98: редактирование записи выглядит как нормальная модалка, без белого полотна на полэкрана */
.appointment-page-overlay {
    position: static !important;
    inset: auto !important;
    z-index: auto !important;
    width: 100%;
    min-height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    backdrop-filter: none !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    opacity: 1 !important;
    transform: none !important;
}

.appointment-page-window {
    width: min(980px, 100%) !important;
    max-width: 980px !important;
    max-height: none !important;
    margin: 24px 0 0 0 !important;
    transform: none !important;
    animation: none !important;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .10) !important;
}

.appointment-page-body {
    max-height: none !important;
    overflow: visible !important;
}

.appointment-page-overlay::before,
.appointment-page-overlay::after {
    display: none !important;
}

@media (max-width: 1100px) {
    .appointment-page-window {
        width: 100% !important;
        max-width: 100% !important;
    }
}


/* v99: редактирование открывается через настоящую систему модалки новой записи */
.appointment-page-overlay,
.appointment-page-window,
.appointment-page-body {
    all: revert-layer;
}


/* v103: быстрый фильтр записей по датам */
.quick-date-filter-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: -4px 0 18px;
    padding: 16px 18px;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .06);
    border: 1px solid rgba(226, 232, 240, .9);
}

.quick-date-filter-card > div:first-child {
    display: grid;
    gap: 3px;
}

.quick-date-filter-card strong {
    color: #0f172a;
    font-size: 17px;
    font-weight: 950;
}

.quick-date-filter-card span {
    color: #64748b;
    font-size: 13px;
    font-weight: 750;
}

.quick-date-filter-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-date-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    font-weight: 900;
    font-size: 14px;
    transition: transform .16s ease, background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.quick-date-filter-btn:hover {
    transform: translateY(-1px);
    background: #e8eef8;
    border-color: #cbd5e1;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
}

.quick-date-filter-btn.is-active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 12px 26px rgba(37, 99, 235, .22);
}

html.theme-dark .quick-date-filter-card {
    background: #111827;
    border-color: #263244;
    box-shadow: 0 14px 32px rgba(0, 0, 0, .18);
}

html.theme-dark .quick-date-filter-card strong {
    color: #f8fafc;
}

html.theme-dark .quick-date-filter-card span {
    color: #94a3b8;
}

html.theme-dark .quick-date-filter-btn {
    background: #1f2937;
    color: #cbd5e1;
    border-color: #334155;
}

html.theme-dark .quick-date-filter-btn:hover {
    background: #334155;
    color: #f8fafc;
}

html.theme-dark .quick-date-filter-btn.is-active {
    background: #2563eb;
    color: #ffffff;
    border-color: #3b82f6;
}

@media (max-width: 760px) {
    .quick-date-filter-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .quick-date-filter-buttons {
        width: 100%;
    }

    .quick-date-filter-btn {
        flex: 1 1 auto;
    }
}


/* v105: календарик сегодняшнего дня — день недели + только число */
.today-date-badge {
    gap: 5px;
}

.today-date-badge small {
    order: -1;
    color: #ffffff !important;
    opacity: .95;
    font-size: 15px;
    font-weight: 950;
    line-height: 1;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.today-date-badge span {
    color: #ffffff;
}

.today-date-badge.weekend-date span {
    color: #ef4444 !important;
}

.today-date-badge.weekend-date small {
    color: #ffffff !important;
}


/* v106: месяц в большом календарике и число в маленькой иконке сегодняшнего дня */
.today-date-badge {
    gap: 4px;
}

.today-date-badge em {
    color: #ffffff;
    font-style: normal;
    font-size: 14px;
    font-weight: 950;
    line-height: 1;
    text-transform: lowercase;
    opacity: .95;
}

.today-date-badge.weekend-date em {
    color: #ffffff !important;
}

.today-mini-calendar-icon {
    position: relative;
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    color: currentColor;
}

.today-mini-calendar-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.today-mini-calendar-icon [data-current-day-number] {
    position: absolute;
    left: 50%;
    top: 56%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    line-height: 1;
    font-weight: 950;
    color: currentColor;
    letter-spacing: -0.04em;
    pointer-events: none;
}

.home-tile-icon .today-mini-calendar-icon {
    width: 34px;
    height: 34px;
}

.home-tile-icon .today-mini-calendar-icon svg {
    width: 34px;
    height: 34px;
}

.home-tile-icon .today-mini-calendar-icon [data-current-day-number] {
    font-size: 11px;
    top: 57%;
}

html.theme-dark .today-date-badge em {
    color: #ffffff;
}


/* v107: вернуть маленькую иконку сегодняшнего дня и усилить фон большого календарика */
.today-mini-calendar-icon [data-current-day-number] {
    display: none !important;
}

.today-hero::after {
    background: radial-gradient(circle at center, rgba(37, 99, 235, .22) 0%, rgba(37, 99, 235, .16) 42%, rgba(37, 99, 235, .07) 72%, transparent 100%) !important;
    box-shadow: 0 24px 80px rgba(37, 99, 235, .22);
}

html.theme-dark .today-hero::after {
    background: radial-gradient(circle at center, rgba(59, 130, 246, .28) 0%, rgba(59, 130, 246, .18) 45%, rgba(59, 130, 246, .08) 74%, transparent 100%) !important;
    box-shadow: 0 24px 80px rgba(37, 99, 235, .24);
}


/* v112: добавить свою услугу в настройках цветов */
.service-color-settings-list {
    display: grid;
    gap: 10px;
}

.add-service-rule-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    margin-top: 12px;
    min-height: 46px;
    padding: 8px 18px 8px 10px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #0f172a;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.add-service-rule-button:hover {
    transform: translateY(-1px);
    border-color: #2563eb;
    box-shadow: 0 14px 34px rgba(37, 99, 235, .14);
}

.add-service-rule-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #0f172a;
    font-size: 25px;
    line-height: 1;
}

.service-rule-form {
    margin-top: 12px;
    padding: 14px;
    border-radius: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.1fr) 76px;
    gap: 12px;
    align-items: end;
}

.service-rule-form[hidden] {
    display: none !important;
}

.service-rule-form label {
    display: grid;
    gap: 7px;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

.service-rule-form input[type="text"] {
    min-height: 42px;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    padding: 9px 12px;
    background: #ffffff;
    color: #0f172a;
    font-weight: 850;
    outline: none;
}

.service-rule-form input[type="text"]:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.service-rule-form input[type="color"] {
    width: 66px;
    height: 42px;
    border: 0;
    padding: 0;
    border-radius: 14px;
    background: transparent;
    cursor: pointer;
}

.service-rule-form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.service-rule-delete {
    min-height: 34px;
    border-radius: 12px;
    border: 0;
    padding: 7px 10px;
    font-weight: 900;
    cursor: pointer;
}

html.theme-dark .add-service-rule-button {
    background: #111827;
    border-color: #334155;
    color: #f8fafc;
}

html.theme-dark .add-service-rule-icon {
    background: #1f2937;
    border-color: #475569;
    color: #f8fafc;
}

html.theme-dark .service-rule-form {
    background: #0f172a;
    border-color: #334155;
}

html.theme-dark .service-rule-form label {
    color: #94a3b8;
}

html.theme-dark .service-rule-form input[type="text"] {
    background: #111827;
    border-color: #334155;
    color: #f8fafc;
}

@media (max-width: 820px) {
    .service-rule-form {
        grid-template-columns: 1fr;
    }

    .service-rule-form input[type="color"] {
        width: 100%;
    }

    .service-rule-form-actions {
        justify-content: stretch;
    }

    .service-rule-form-actions .button {
        flex: 1;
    }
}


/* V113/V115: workers and employee profit */
.workers-section-head {
    align-items: center;
}

.worker-modal-window {
    width: min(620px, calc(100vw - 48px));
}

.worker-modal-grid {
    grid-template-columns: 1fr;
}

.workers-table-card table {
    min-width: 560px;
}

.worker-role-note {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 800;
}

.worker-role-note.danger {
    background: #fee2e2;
    color: #991b1b;
}

.field-help {
    color: #6b7280;
    font-weight: 500;
}

label:has(input.workers-checkboxes) {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #f9fafb;
    font-weight: 700;
    cursor: pointer;
}

label:has(input.workers-checkboxes) input {
    width: auto;
    margin: 0;
}

#id_worker_ids {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

html.theme-dark .worker-role-note {
    background: rgba(99, 102, 241, .18);
    color: #c7d2fe;
}

html.theme-dark .worker-role-note.danger {
    background: rgba(239, 68, 68, .18);
    color: #fecaca;
}

html.theme-dark label:has(input.workers-checkboxes) {
    border-color: #374151;
    background: #111827;
}


.inline-action-form {
    margin: 0;
}

.inline-action-form .button {
    width: auto;
}


/* v116: сегодняшний день — компактный блок мастеров между услугой и статусом */
.today-columns-card {
    grid-template-columns: 58px minmax(175px, .95fr) minmax(190px, 1fr) minmax(190px, .9fr) minmax(145px, .62fr) minmax(230px, 1.05fr);
    column-gap: 22px;
}

.today-workers-column {
    min-width: 0;
}

.today-workers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
}

.today-worker-chip,
.today-workers-empty {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef6ff;
    color: #2563eb;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.today-workers-empty {
    background: #f1f5f9;
    color: #94a3b8;
}

html.theme-dark .today-worker-chip {
    background: rgba(37, 99, 235, .18);
    color: #93c5fd;
}

html.theme-dark .today-workers-empty {
    background: #1f2937;
    color: #64748b;
}

@media (max-width: 1320px) {
    .today-columns-card {
        grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr) minmax(0, .9fr);
        column-gap: 18px;
    }

    .today-workers-column,
    .today-status-column {
        grid-column: span 1;
    }
}

@media (max-width: 940px) {
    .today-columns-card {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .today-car-column,
    .today-service-column,
    .today-workers-column,
    .today-status-column {
        grid-column: 2 / -1;
    }
}

@media (max-width: 560px) {
    .today-columns-card {
        grid-template-columns: 1fr;
    }

    .today-car-column,
    .today-service-column,
    .today-workers-column,
    .today-status-column {
        grid-column: auto;
    }
}

/* v117: сегодняшний день — компактные ссылки выбора мастеров */
.today-workers-list {
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 4px;
}

.today-worker-link,
.today-worker-action {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    min-height: 22px;
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: #5f7898;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: color .16s ease, transform .16s ease;
}

.today-worker-action {
    color: #4f7fb8;
}

.today-worker-link:hover,
.today-worker-action:hover {
    color: #2563eb;
    transform: translateY(-1px);
}

.today-worker-add {
    margin-top: 2px;
}

html.theme-dark .today-worker-link,
html.theme-dark .today-worker-action {
    color: #93a9c7;
}

html.theme-dark .today-worker-link:hover,
html.theme-dark .today-worker-action:hover {
    color: #bfdbfe;
}

/* v118: профиль мастера */
.worker-name-link {
    display: inline-flex;
    width: fit-content;
    color: inherit;
    text-decoration: none;
}

.worker-name-link:hover {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.worker-profile-hero {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.2fr);
    gap: 20px;
    align-items: stretch;
}

.worker-profile-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.worker-profile-main h2 {
    margin: 0;
    font-size: 26px;
    color: #0f172a;
}

.worker-profile-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.worker-stat-card {
    min-height: 104px;
    padding: 16px;
    border-radius: 22px;
    background: linear-gradient(135deg, #f8fbff, #eef5ff);
    border: 1px solid #dbeafe;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.worker-stat-card span {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

.worker-stat-card strong {
    color: #0f172a;
    font-size: 24px;
    line-height: 1.05;
}

.worker-status-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    background: #eef2ff;
    color: #4f46e5;
}

.worker-jobs-card table small {
    color: #64748b;
    font-weight: 800;
}

html.theme-dark .worker-name-link:hover {
    color: #93c5fd;
}

html.theme-dark .worker-profile-main h2,
html.theme-dark .worker-stat-card strong {
    color: #e5e7eb;
}

html.theme-dark .worker-stat-card {
    background: linear-gradient(135deg, #111827, #172033);
    border-color: #26344f;
}

html.theme-dark .worker-stat-card span,
html.theme-dark .worker-jobs-card table small {
    color: #94a3b8;
}

html.theme-dark .worker-status-pill {
    background: rgba(99, 102, 241, .18);
    color: #c7d2fe;
}

@media (max-width: 900px) {
    .worker-profile-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .worker-profile-stats {
        grid-template-columns: 1fr;
    }
}


/* v119: напарники в профиле мастера */
.worker-coworkers-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.worker-coworkers-list a {
    color: #64748b;
    font-size: 13px;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color .16s ease;
}

.worker-coworkers-list a:hover {
    color: #2563eb;
}

.worker-solo-note {
    display: inline-flex;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

html.theme-dark .worker-coworkers-list a {
    color: #94a3b8;
}

html.theme-dark .worker-coworkers-list a:hover {
    color: #93c5fd;
}

html.theme-dark .worker-solo-note {
    background: rgba(148, 163, 184, .12);
    color: #cbd5e1;
}


/* v120: аккуратная сетка таблицы работ мастера на 16:9 */
.worker-jobs-card {
    overflow-x: visible !important;
}

.worker-jobs-card .worker-jobs-table {
    width: 100% !important;
    table-layout: fixed !important;
}

.worker-jobs-card .worker-jobs-table th,
.worker-jobs-card .worker-jobs-table td {
    padding-left: 12px !important;
    padding-right: 12px !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    vertical-align: middle;
}

.worker-jobs-table .worker-col-date { width: 10%; }
.worker-jobs-table .worker-col-client { width: 11.5%; }
.worker-jobs-table .worker-col-car { width: 13.5%; }
.worker-jobs-table .worker-col-service { width: 15%; }
.worker-jobs-table .worker-col-total { width: 11.5%; }
.worker-jobs-table .worker-col-coworkers { width: 8.5%; }
.worker-jobs-table .worker-col-share { width: 14%; }
.worker-jobs-table .worker-col-status { width: 16%; }

.worker-jobs-table th:nth-child(3),
.worker-jobs-table td:nth-child(3) {
    padding-left: 20px !important;
}

.worker-jobs-table th:nth-child(6),
.worker-jobs-table td:nth-child(6) {
    padding-left: 0 !important;
    padding-right: 6px !important;
}

.worker-jobs-table th:nth-child(7),
.worker-jobs-table td:nth-child(7) {
    padding-left: 8px !important;
}

.worker-jobs-table th:nth-child(6) {
    white-space: nowrap;
}

.worker-jobs-table th:nth-child(8),
.worker-jobs-table td:nth-child(8) {
    padding-left: 8px !important;
    padding-right: 8px !important;
}

.worker-jobs-table .worker-status-pill {
    max-width: 100%;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
}

.worker-jobs-table .service-color-tag {
    max-width: 100%;
}

@media (max-width: 1180px) {
    .worker-jobs-card {
        overflow-x: auto !important;
    }

    .worker-jobs-card .worker-jobs-table {
        min-width: 1060px;
    }
}

/* V123: управление работниками */
.workers-manage-table th:nth-child(1),
.workers-manage-table td:nth-child(1) {
    width: 42%;
}

.workers-manage-table th:nth-child(2),
.workers-manage-table td:nth-child(2) {
    width: 25%;
}

.workers-manage-table th:nth-child(3),
.workers-manage-table td:nth-child(3) {
    width: 33%;
}

.workers-manage-table tr.is-worker-fired td {
    opacity: .72;
}

.worker-row-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.worker-row-actions form {
    margin: 0;
}

.worker-action-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color .16s ease, opacity .16s ease;
}

.worker-action-link:hover {
    color: #2563eb;
}

.worker-action-link.danger {
    color: #b91c1c;
}

.worker-action-link.danger:hover {
    color: #dc2626;
}

html.theme-dark .worker-action-link {
    color: #94a3b8;
}

html.theme-dark .worker-action-link:hover {
    color: #93c5fd;
}

html.theme-dark .worker-action-link.danger {
    color: #fca5a5;
}

html.theme-dark .workers-manage-table tr.is-worker-fired td {
    opacity: .66;
}

@media (max-width: 760px) {
    .workers-table-card {
        overflow-x: auto;
    }

    .workers-manage-table {
        min-width: 720px;
    }
}


/* v125: быстрый фильтр по дате перенесён в воронку заголовка */
.funnel-icon {
    position: relative;
    width: 14px;
    height: 12px;
    display: inline-block;
}

.funnel-icon::before {
    content: "";
    position: absolute;
    top: 0;
    left: 1px;
    width: 12px;
    height: 4px;
    border: 2px solid #111827;
    border-bottom: 0;
    border-radius: 2px 2px 0 0;
    box-sizing: border-box;
}

.funnel-icon::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 4px;
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 6px solid #111827;
}

.th-search-btn.is-filter-active {
    background: #e8f0ff !important;
}

.th-search-btn.is-filter-active .funnel-icon::before {
    border-color: #2563eb;
}

.th-search-btn.is-filter-active .funnel-icon::after {
    border-top-color: #2563eb;
}

.date-filter-popover-links {
    display: grid;
    gap: 8px;
    min-width: 180px;
}

.date-filter-popover-link {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-weight: 800;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.date-filter-popover-link:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #1d4ed8;
}

.date-filter-popover-link.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

html.theme-dark .funnel-icon::before {
    border-color: #e5e7eb;
}

html.theme-dark .funnel-icon::after {
    border-top-color: #e5e7eb;
}

html.theme-dark .th-search-btn.is-filter-active {
    background: rgba(37, 99, 235, .18) !important;
}

html.theme-dark .th-search-btn.is-filter-active .funnel-icon::before {
    border-color: #93c5fd;
}

html.theme-dark .th-search-btn.is-filter-active .funnel-icon::after {
    border-top-color: #93c5fd;
}

html.theme-dark .date-filter-popover-link {
    background: #0f172a;
    border-color: #1e293b;
    color: #cbd5e1;
}

html.theme-dark .date-filter-popover-link:hover {
    background: #172554;
    border-color: #1d4ed8;
    color: #bfdbfe;
}

html.theme-dark .date-filter-popover-link.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}


/* v126: быстрое модальное окно выбора мастеров */
.worker-picker-modal-head h2 {
    font-size: 30px;
}

.worker-picker-form {
    display: grid;
    gap: 16px;
}

.worker-picker-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
}

.worker-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 900;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.worker-picker-item:hover {
    background: #eef5ff;
    border-color: #bfdbfe;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, .08);
}

.worker-picker-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.worker-picker-check {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    flex: 0 0 auto;
    position: relative;
}

.worker-picker-item input:checked + .worker-picker-check {
    border-color: #2563eb;
    background: #2563eb;
}

.worker-picker-item input:checked + .worker-picker-check::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 3px;
    width: 6px;
    height: 11px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.worker-picker-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.worker-picker-empty {
    margin: 0;
}

html.theme-dark .worker-picker-item {
    background: #0f172a;
    border-color: #1e293b;
    color: #e5e7eb;
}

html.theme-dark .worker-picker-item:hover {
    background: #172033;
    border-color: #334155;
}

html.theme-dark .worker-picker-check {
    background: #111827;
    border-color: #475569;
}

html.theme-dark .worker-picker-item input:checked + .worker-picker-check {
    background: #3b82f6;
    border-color: #3b82f6;
}


/* v127: календарный день открывается кликом по клетке */
.calendar-day-link {
    cursor: pointer;
}

.calendar-day-link .calendar-appointment {
    cursor: pointer;
}

.calendar-day-link:hover .calendar-date-number {
    color: #2563eb;
}

html.theme-dark .calendar-day-link:hover .calendar-date-number {
    color: #93c5fd;
}

/* v128: настройки зарплаты компании */
.payroll-card {
    display: grid;
    gap: 18px;
}

.payroll-settings-form {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.3fr) auto;
    gap: 14px;
    align-items: end;
}

.payroll-count-field,
.payroll-days-grid label {
    display: grid;
    gap: 8px;
}

.payroll-count-field span,
.payroll-days-grid label span {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

.payroll-count-field select,
.payroll-days-grid input {
    width: 100%;
    min-height: 44px;
    border-radius: 14px;
    border: 1px solid #dbe3ef;
    background: #f8fafc;
    color: #0f172a;
    padding: 10px 12px;
    font-weight: 800;
    outline: none;
}

.payroll-count-field select:focus,
.payroll-days-grid input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.payroll-days-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.payroll-readonly-note {
    padding: 12px 14px;
    border-radius: 16px;
    background: #f8fafc;
    color: #64748b;
    font-weight: 800;
}

.worker-stat-card small {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

html.theme-dark .payroll-count-field span,
html.theme-dark .payroll-days-grid label span,
html.theme-dark .worker-stat-card small {
    color: #94a3b8;
}

html.theme-dark .payroll-count-field select,
html.theme-dark .payroll-days-grid input,
html.theme-dark .payroll-readonly-note {
    background: #0f172a;
    border-color: #243145;
    color: #e5e7eb;
}

@media (min-width: 901px) {
    .worker-profile-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .payroll-settings-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .payroll-days-grid {
        grid-template-columns: 1fr;
    }
}

/* v129: кнопка сброса суммы к зарплате */
.worker-action-link.salary-paid {
    color: #2563eb;
}

.worker-action-link.salary-paid:hover {
    color: #1d4ed8;
}

html.theme-dark .worker-action-link.salary-paid {
    color: #93c5fd;
}

html.theme-dark .worker-action-link.salary-paid:hover {
    color: #bfdbfe;
}


/* v131: кнопка действия внутри уведомления зарплаты */
.app-toast-action {
    width: fit-content;
    margin-top: 7px;
    padding: 7px 10px;
    border: 0;
    border-radius: 10px;
    background: #dcfce7;
    color: #166534;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}

.app-toast-action:hover {
    background: #bbf7d0;
    transform: translateY(-1px);
}

html.theme-dark .app-toast-action {
    background: rgba(34, 197, 94, .18);
    color: #86efac;
}

html.theme-dark .app-toast-action:hover {
    background: rgba(34, 197, 94, .28);
}


/* v136: мастера в таблице записей клиентов */
.dashboard-workers-list {
    min-width: 92px;
    max-width: 160px;
}

.dashboard-workers-list .today-worker-link,
.dashboard-workers-list .today-worker-action {
    font-size: 12px;
}


/* v137: плюсик добавления мастера в таблице записей */
.dashboard-workers-cell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px;
    align-items: center;
    gap: 10px;
    min-width: 150px;
}

.dashboard-workers-cell .dashboard-workers-list {
    min-width: 0;
}

.dashboard-worker-plus {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    justify-self: center;
    align-self: center;
    text-decoration: none;
    font-size: 17px;
    line-height: 1;
    font-weight: 900;
    color: #2563eb;
    background: #eef5ff;
    border: 1px solid #dbeafe;
    transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease;
}

.dashboard-worker-plus:hover {
    transform: translateY(-1px);
    background: #dbeafe;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

html.theme-dark .dashboard-worker-plus {
    color: #93c5fd;
    background: rgba(37, 99, 235, .16);
    border-color: rgba(147, 197, 253, .18);
}

html.theme-dark .dashboard-worker-plus:hover {
    background: rgba(37, 99, 235, .26);
    color: #bfdbfe;
}

/* v138: история выдачи зарплаты */
.salary-history-card {
    overflow-x: auto;
}

.salary-history-table {
    width: 100%;
    border-collapse: collapse;
}

.salary-history-table th,
.salary-history-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: middle;
}

.salary-history-table th {
    color: #64748b;
    font-size: 13px;
    font-weight: 900;
    background: #f8fafc;
}

.salary-history-table td {
    color: #0f172a;
    font-weight: 800;
}

.salary-history-table small {
    color: #64748b;
    font-weight: 800;
}

.salary-history-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 26px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.salary-history-status.paid {
    background: #dcfce7;
    color: #166534;
}

.salary-history-status.cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.salary-history-table tr.is-cancelled-payment td {
    color: #94a3b8;
}

html.theme-dark .salary-history-table th {
    background: #111827;
    color: #94a3b8;
}

html.theme-dark .salary-history-table th,
html.theme-dark .salary-history-table td {
    border-bottom-color: #1f2937;
}

html.theme-dark .salary-history-table td {
    color: #e5e7eb;
}

html.theme-dark .salary-history-table small,
html.theme-dark .salary-history-table tr.is-cancelled-payment td {
    color: #94a3b8;
}

html.theme-dark .salary-history-status.paid {
    background: rgba(34, 197, 94, .16);
    color: #86efac;
}

html.theme-dark .salary-history-status.cancelled {
    background: rgba(239, 68, 68, .16);
    color: #fca5a5;
}


/* v140: расходы в таблице записей */
.table-expenses-note {
    display: inline-block;
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

html.theme-dark .table-expenses-note {
    color: #94a3b8;
}

/* v142: услуги в записи без браузерного datalist, с несколькими строками */
.service-multi-label > input[name="service"] {
    display: none !important;
}

.service-multi-list {
    display: grid;
    gap: 8px;
}

.service-line-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.service-line-row:has(.service-line-remove) {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.service-line-input {
    width: 100%;
}

.found-services-button {
    height: 40px;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid #dbeafe;
    background: #f8fbff;
    color: #334155;
    font-weight: 900;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity .16s ease, transform .16s ease, background .16s ease, border-color .16s ease;
    white-space: nowrap;
}

.found-services-button[hidden] {
    display: none !important;
}

.found-services-button.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.found-services-button:hover {
    background: #eef5ff;
    border-color: #bfdbfe;
}

.found-services-button-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
}

.found-services-button-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

.service-add-line-button {
    width: fit-content;
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.service-add-line-button:hover {
    color: #2563eb;
}

.service-line-remove {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 20px;
    line-height: 1;
    font-weight: 900;
    cursor: pointer;
}

.service-line-remove:hover {
    color: #dc2626;
    background: #fff1f2;
    border-color: #fecdd3;
}

.service-suggestions-popover {
    position: fixed;
    z-index: 1000000;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid #dbeafe;
    background: #ffffff;
    box-shadow: 0 22px 70px rgba(15, 23, 42, .22);
}

.service-suggestions-popover-title {
    padding: 2px 4px 10px;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

.service-suggestions-popover-list {
    display: grid;
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
}

.service-suggestions-popover-list button {
    width: 100%;
    text-align: left;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
    border-radius: 12px;
    padding: 10px 12px;
    font-weight: 900;
    cursor: pointer;
}

.service-suggestions-popover-list button:hover {
    background: #eef5ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

html.theme-dark .found-services-button {
    background: #132033;
    border-color: #26344f;
    color: #cbd5e1;
}

html.theme-dark .found-services-button:hover {
    background: #172b46;
    border-color: #3b82f6;
}

html.theme-dark .service-add-line-button {
    color: #93a9c7;
}

html.theme-dark .service-add-line-button:hover {
    color: #bfdbfe;
}

html.theme-dark .service-line-remove {
    background: #111827;
    border-color: #26344f;
    color: #94a3b8;
}

html.theme-dark .service-line-remove:hover {
    background: rgba(220, 38, 38, .12);
    border-color: rgba(248, 113, 113, .45);
    color: #fca5a5;
}

html.theme-dark .service-suggestions-popover {
    background: #111827;
    border-color: #26344f;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .5);
}

html.theme-dark .service-suggestions-popover-title {
    color: #94a3b8;
}

html.theme-dark .service-suggestions-popover-list button {
    background: #0f172a;
    border-color: #1e293b;
    color: #e5e7eb;
}

html.theme-dark .service-suggestions-popover-list button:hover {
    background: #172554;
    border-color: #2563eb;
    color: #bfdbfe;
}

@media (max-width: 760px) {
    .service-line-row,
    .service-line-row:has(.service-line-remove) {
        grid-template-columns: 1fr;
    }

    .found-services-button,
    .service-line-remove {
        width: fit-content;
    }
}


/* v143: компактная страница дня без верхнего заголовка */
.today-hero-compact {
    min-height: 0 !important;
    padding: 18px 20px !important;
    margin-top: 0 !important;
    margin-bottom: 12px !important;
}

.today-hero-compact::after {
    width: 150px !important;
    height: 150px !important;
    right: -48px !important;
    top: -58px !important;
}

.today-hero-compact .today-hero-kicker {
    margin-bottom: 6px !important;
    padding: 5px 9px !important;
    font-size: 12px !important;
}

.today-hero-compact h2 {
    margin-bottom: 6px !important;
    font-size: 24px !important;
}

.today-hero-compact p {
    font-size: 13px !important;
}

.today-hero-compact .today-date-badge {
    width: 82px !important;
    height: 82px !important;
    border-radius: 22px !important;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .18) !important;
}

.today-hero-compact .today-date-badge span {
    font-size: 32px !important;
}

.today-hero-compact .today-date-badge small,
.today-hero-compact .today-date-badge em {
    font-size: 11px !important;
}

.today-hero-compact + .today-list {
    margin-top: 0 !important;
}

@media (max-width: 760px) {
    .today-hero-compact {
        padding: 16px !important;
    }

    .today-hero-compact .today-date-badge {
        width: 72px !important;
        height: 72px !important;
    }

    .today-hero-compact .today-date-badge span {
        font-size: 28px !important;
    }
}

/* v144: расписание дня с временной шкалой слева */
.today-schedule {
    display: grid;
    gap: 0;
    margin-top: 0;
}

.today-time-row {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 12px;
    min-height: 42px;
    position: relative;
}

.today-time-row::before {
    content: "";
    position: absolute;
    left: 61px;
    right: 0;
    top: 20px;
    border-top: 1px dashed rgba(148, 163, 184, .35);
    pointer-events: none;
}

.today-time-row.has-appointments {
    min-height: 0;
    margin-bottom: 10px;
}

.today-time-row.has-appointments::before {
    top: 24px;
}

.today-time-label {
    position: relative;
    z-index: 1;
    width: fit-content;
    align-self: start;
    padding-top: 10px;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .01em;
    font-variant-numeric: tabular-nums;
}

.today-time-row.is-extra-time .today-time-label {
    color: #2563eb;
}

.today-time-content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
    min-width: 0;
}

.today-time-row:not(.has-appointments) .today-time-content {
    min-height: 42px;
}

.today-schedule .today-appointment-card {
    margin: 0;
}

html.theme-dark .today-time-row::before {
    border-top-color: rgba(148, 163, 184, .18);
}

html.theme-dark .today-time-label {
    color: #94a3b8;
}

html.theme-dark .today-time-row.is-extra-time .today-time-label {
    color: #93c5fd;
}

@media (max-width: 760px) {
    .today-time-row {
        grid-template-columns: 54px minmax(0, 1fr);
        gap: 8px;
    }

    .today-time-row::before {
        left: 53px;
    }

    .today-time-label {
        font-size: 11px;
    }
}

/* v147: компактная страница дня без шкалы времени слева */
.today-compact-list {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.today-compact-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .08);
    padding: 18px 24px;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) 130px;
    gap: 20px;
    align-items: center;
}

.today-compact-time-cell {
    display: grid;
    justify-items: center;
    gap: 10px;
}

.today-compact-time {
    min-width: 68px;
    padding: 12px 13px;
    border-radius: 18px;
    background: linear-gradient(135deg, #eaf3ff, #f8fbff);
    border: 1px solid #bfdbfe;
    color: #2563eb;
    font-size: 20px;
    line-height: 1;
    font-weight: 950;
    text-align: center;
}

.today-compact-main {
    display: grid;
    grid-template-columns: minmax(190px, 1.15fr) minmax(220px, 1.25fr) minmax(120px, .7fr) minmax(150px, .75fr);
    gap: 22px;
    align-items: center;
}

.today-compact-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.today-compact-col strong {
    color: #0f172a;
    font-size: 18px;
    font-weight: 950;
    line-height: 1.15;
}

.today-compact-col small {
    color: #64748b;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.2;
}

.today-compact-service .service-color-tag {
    width: fit-content;
    max-width: 100%;
}

.today-compact-details {
    justify-self: end;
    position: relative;
}

.today-compact-details > summary {
    list-style: none;
    cursor: pointer;
    border: 0;
    padding: 9px 13px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 13px;
    font-weight: 950;
    user-select: none;
    transition: background .18s ease, color .18s ease;
}

.today-compact-details > summary::-webkit-details-marker {
    display: none;
}

.today-compact-details > summary:hover,
.today-compact-details[open] > summary {
    background: #e8f0ff;
    color: #2563eb;
}

.today-compact-details-grid {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 20;
    width: min(760px, calc(100vw - 360px));
    padding: 16px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #dbeafe;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .18);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.today-compact-details-grid > div {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.today-compact-details-grid strong {
    color: #0f172a;
    font-size: 15px;
    font-weight: 950;
}

.today-compact-details-grid small {
    color: #64748b;
    font-size: 12px;
    font-weight: 850;
}

.compact-details-workers {
    align-items: flex-start;
}

html.theme-dark .today-compact-card,
html.theme-dark .today-compact-details-grid {
    background: #111827;
    border-color: #1f2937;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .22);
}

html.theme-dark .today-compact-time {
    background: linear-gradient(135deg, rgba(37, 99, 235, .22), rgba(15, 23, 42, .55));
    border-color: rgba(96, 165, 250, .35);
    color: #bfdbfe;
}

html.theme-dark .today-compact-col strong,
html.theme-dark .today-compact-details-grid strong {
    color: #e5e7eb;
}

html.theme-dark .today-compact-col small,
html.theme-dark .today-compact-details-grid small {
    color: #94a3b8;
}

html.theme-dark .today-compact-details > summary {
    background: rgba(148, 163, 184, .12);
    color: #cbd5e1;
}

html.theme-dark .today-compact-details > summary:hover,
html.theme-dark .today-compact-details[open] > summary {
    background: rgba(37, 99, 235, .22);
    color: #bfdbfe;
}

@media (max-width: 1180px) {
    .today-compact-card {
        grid-template-columns: 82px 1fr;
    }

    .today-compact-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .today-compact-details {
        grid-column: 2;
        justify-self: start;
    }

    .today-compact-details-grid {
        left: 0;
        right: auto;
        width: min(720px, calc(100vw - 120px));
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .today-compact-card {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .today-compact-time-cell {
        justify-items: start;
        grid-template-columns: auto auto;
        align-items: center;
    }

    .today-compact-main {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .today-compact-details {
        grid-column: auto;
    }

    .today-compact-details-grid {
        position: static;
        width: auto;
        margin-top: 10px;
        grid-template-columns: 1fr;
    }
}

/* v148: сегодняшний день — возвращены широкие полосы, изменён порядок колонок */
.today-striped-list {
    gap: 14px;
}

.today-clean-card.today-columns-card {
    grid-template-columns: 82px minmax(230px, 1.05fr) minmax(240px, 1.15fr) minmax(160px, .7fr) minmax(180px, .75fr) !important;
    column-gap: 28px !important;
    align-items: center;
}

.today-time-number {
    width: 64px !important;
    height: 48px !important;
    border-radius: 18px !important;
    font-size: 17px !important;
    letter-spacing: -.02em;
}

.today-clean-card .today-price-column strong,
.today-clean-card .today-phone-column strong {
    color: #0f172a;
    font-size: 17px;
    line-height: 1.15;
}

.today-clean-card .today-price-column span:not(.today-column-label),
.today-clean-card .today-phone-column span:not(.today-column-label) {
    color: #ef4444;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.25;
}

.today-clean-card .today-service-column .service-color-tag {
    max-width: 100%;
}

html.theme-dark .today-clean-card .today-price-column strong,
html.theme-dark .today-clean-card .today-phone-column strong {
    color: #f8fafc;
}

html.theme-dark .today-clean-card .today-price-column span:not(.today-column-label),
html.theme-dark .today-clean-card .today-phone-column span:not(.today-column-label) {
    color: #fca5a5;
}

@media (max-width: 1180px) {
    .today-clean-card.today-columns-card {
        grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1fr) !important;
        column-gap: 20px !important;
    }

    .today-clean-card .today-service-column,
    .today-clean-card .today-price-column,
    .today-clean-card .today-phone-column {
        grid-column: span 1;
    }
}

@media (max-width: 760px) {
    .today-clean-card.today-columns-card {
        grid-template-columns: 72px minmax(0, 1fr) !important;
    }

    .today-clean-card .today-car-column,
    .today-clean-card .today-service-column,
    .today-clean-card .today-price-column,
    .today-clean-card .today-phone-column {
        grid-column: 2 / -1;
    }
}


/* v149: доработка полосок страницы дня и глобальный плюсик */
.today-striped-list .today-columns-card.today-clean-card {
    grid-template-columns: 86px minmax(170px, 1fr) minmax(220px, 1.1fr) minmax(150px, .8fr) minmax(170px, .9fr) minmax(240px, 1.15fr) !important;
    gap: 24px !important;
    align-items: center !important;
}

.today-striped-list .today-time-number {
    width: 74px !important;
    min-width: 74px !important;
    height: 42px !important;
    border-radius: 16px !important;
    padding: 0 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    font-weight: 950 !important;
    letter-spacing: -0.03em !important;
    font-variant-numeric: tabular-nums !important;
}

.today-striped-list .today-price-column strong,
.today-striped-list .today-price-column span,
.today-striped-list .today-client-column-mini strong,
.today-striped-list .today-client-column-mini p {
    font-weight: 950 !important;
    letter-spacing: -0.02em !important;
}

.today-striped-list .today-price-column strong,
.today-striped-list .today-client-column-mini strong {
    color: #0f172a !important;
    font-size: 17px !important;
    line-height: 1.15 !important;
}

.today-striped-list .today-price-column span,
.today-striped-list .today-client-column-mini p {
    margin: 0 !important;
    color: #64748b !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
}

.today-striped-list .today-status-column {
    justify-content: center !important;
}

.today-striped-list .today-status-form,
.today-striped-list .today-status-form .status-select {
    width: 100% !important;
}

.global-create-appointment-fab {
    position: fixed;
    right: 26px;
    bottom: 26px;
    z-index: 90;
    width: 58px;
    height: 58px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #ffffff;
    text-decoration: none;
    font-size: 34px;
    font-weight: 850;
    line-height: 1;
    box-shadow: 0 18px 42px rgba(37, 99, 235, .34);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, opacity .2s ease;
}

.global-create-appointment-fab:hover {
    transform: translateY(-2px);
    background: #1d4ed8;
    box-shadow: 0 22px 52px rgba(37, 99, 235, .42);
}

html.theme-dark .today-striped-list .today-price-column strong,
html.theme-dark .today-striped-list .today-client-column-mini strong {
    color: #e5e7eb !important;
}

html.theme-dark .today-striped-list .today-price-column span,
html.theme-dark .today-striped-list .today-client-column-mini p {
    color: #94a3b8 !important;
}

html.theme-dark .global-create-appointment-fab {
    background: #3b82f6;
    box-shadow: 0 18px 42px rgba(59, 130, 246, .24);
}

@media (max-width: 1250px) {
    .today-striped-list .today-columns-card.today-clean-card {
        grid-template-columns: 86px repeat(2, minmax(0, 1fr)) !important;
    }

    .today-striped-list .today-service-column,
    .today-striped-list .today-price-column,
    .today-striped-list .today-client-column-mini,
    .today-striped-list .today-status-column {
        grid-column: 2 / -1;
    }
}

@media (max-width: 760px) {
    .global-create-appointment-fab {
        right: 18px;
        bottom: 18px;
        width: 52px;
        height: 52px;
        border-radius: 18px;
        font-size: 30px;
    }
}

/* v150: усиление карточек дня и видимый глобальный плюс */
.today-striped-list .today-columns-card.today-clean-card {
    grid-template-columns: 110px minmax(190px, 1fr) minmax(230px, 1.08fr) minmax(170px, .78fr) minmax(190px, .86fr) minmax(240px, 1.1fr) !important;
    column-gap: 22px !important;
}

.today-striped-list .today-time-number {
    width: 94px !important;
    min-width: 94px !important;
    height: 46px !important;
    border-radius: 18px !important;
    padding: 0 14px !important;
    box-sizing: border-box !important;
    font-size: 20px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

.today-striped-list .today-client-column-mini strong {
    display: block !important;
    margin: 0 0 8px !important;
    color: #0f172a !important;
    font-size: 20px !important;
    font-weight: 950 !important;
    line-height: 1.05 !important;
    letter-spacing: -0.035em !important;
}

.today-striped-list .today-client-column-mini p {
    margin: 0 !important;
    color: #64748b !important;
    font-size: 16px !important;
    font-weight: 950 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em !important;
}

.today-striped-list .today-price-column strong {
    display: block !important;
    margin: 0 0 7px !important;
    color: #0f172a !important;
    font-size: 18px !important;
    font-weight: 950 !important;
    line-height: 1.1 !important;
    letter-spacing: -0.035em !important;
}

.today-striped-list .today-price-column span:not(.today-column-label) {
    display: block !important;
    color: #ef4444 !important;
    font-size: 15px !important;
    font-weight: 950 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em !important;
}

.global-create-appointment-fab {
    position: fixed !important;
    right: 28px !important;
    bottom: 28px !important;
    z-index: 999999 !important;
    width: 62px !important;
    height: 62px !important;
    min-width: 62px !important;
    min-height: 62px !important;
    border-radius: 22px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: .65 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    background: #2563eb !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 36px !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    box-shadow: 0 20px 52px rgba(37, 99, 235, .42) !important;
}

.global-create-appointment-fab:hover {
    transform: translateY(-3px) !important;
    background: #1d4ed8 !important;
}

html.theme-dark .today-striped-list .today-client-column-mini strong,
html.theme-dark .today-striped-list .today-price-column strong {
    color: #f8fafc !important;
}

html.theme-dark .today-striped-list .today-client-column-mini p {
    color: #94a3b8 !important;
}

html.theme-dark .today-striped-list .today-price-column span:not(.today-column-label) {
    color: #fca5a5 !important;
}

@media (max-width: 1250px) {
    .today-striped-list .today-columns-card.today-clean-card {
        grid-template-columns: 104px repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 760px) {
    .today-striped-list .today-columns-card.today-clean-card {
        grid-template-columns: 104px minmax(0, 1fr) !important;
    }

    .global-create-appointment-fab {
        right: 18px !important;
        bottom: 18px !important;
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
        min-height: 56px !important;
        border-radius: 20px !important;
        font-size: 32px !important;
    }
}


/* v151: финальное принудительное исправление карточек дня */
.today-striped-list .today-columns-card.today-clean-card {
    grid-template-columns: 128px minmax(210px, 1fr) minmax(250px, 1.12fr) minmax(190px, .78fr) minmax(220px, .9fr) minmax(245px, 1.05fr) !important;
    column-gap: 22px !important;
    align-items: center !important;
}

.today-striped-list .today-order-cell {
    width: 112px !important;
    min-width: 112px !important;
    align-items: center !important;
}

.today-striped-list .today-time-number,
.today-striped-list .today-order-cell .today-appointment-number.today-time-number {
    width: 102px !important;
    min-width: 102px !important;
    max-width: 102px !important;
    height: 48px !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
    border-radius: 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
    white-space: nowrap !important;
    color: #2563eb !important;
    font-size: 22px !important;
    font-weight: 950 !important;
    letter-spacing: -0.045em !important;
    font-variant-numeric: tabular-nums !important;
}

.today-striped-list .today-client-column-mini strong {
    display: block !important;
    margin: 0 0 10px !important;
    color: #0f172a !important;
    font-size: 22px !important;
    font-weight: 950 !important;
    line-height: 1.05 !important;
    letter-spacing: -0.04em !important;
}

.today-striped-list .today-client-column-mini p {
    display: block !important;
    margin: 0 !important;
    color: #64748b !important;
    font-size: 18px !important;
    font-weight: 950 !important;
    line-height: 1.1 !important;
    letter-spacing: -0.03em !important;
}

.today-striped-list .today-price-column strong {
    display: block !important;
    margin: 0 0 9px !important;
    color: #0f172a !important;
    font-size: 20px !important;
    font-weight: 950 !important;
    line-height: 1.05 !important;
    letter-spacing: -0.04em !important;
}

.today-striped-list .today-price-column span:not(.today-column-label) {
    display: block !important;
    margin: 0 !important;
    color: #ef4444 !important;
    font-size: 17px !important;
    font-weight: 950 !important;
    line-height: 1.1 !important;
    letter-spacing: -0.03em !important;
}

.global-create-appointment-fab {
    position: fixed !important;
    right: 28px !important;
    bottom: 28px !important;
    z-index: 2147483647 !important;
    width: 64px !important;
    height: 64px !important;
    min-width: 64px !important;
    min-height: 64px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 22px !important;
    opacity: .65 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    background: #2563eb !important;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 40px !important;
    font-weight: 950 !important;
    line-height: 1 !important;
    box-shadow: 0 0 26px rgba(37, 99, 235, .24) !important;
}

.global-create-appointment-fab:hover,
.global-create-appointment-fab:focus-visible,
.global-create-appointment-fab:active {
    opacity: 1 !important;
}

@media (prefers-reduced-motion: reduce) {
    .global-create-appointment-fab {
        transition: none;
    }
}

html.theme-dark .today-striped-list .today-client-column-mini strong,
html.theme-dark .today-striped-list .today-price-column strong {
    color: #f8fafc !important;
}

html.theme-dark .today-striped-list .today-client-column-mini p {
    color: #94a3b8 !important;
}

html.theme-dark .today-striped-list .today-price-column span:not(.today-column-label) {
    color: #fca5a5 !important;
}

@media (max-width: 1250px) {
    .today-striped-list .today-columns-card.today-clean-card {
        grid-template-columns: 118px repeat(2, minmax(0, 1fr)) !important;
    }

    .today-striped-list .today-order-cell {
        width: 104px !important;
        min-width: 104px !important;
    }
}


/* v152: правка ширины карточек, типографики и FAB на странице дня */
.today-striped-list .today-columns-card.today-clean-card {
    grid-template-columns: 118px minmax(180px, 1fr) minmax(210px, 1.02fr) minmax(170px, .72fr) minmax(180px, .78fr) minmax(200px, .9fr) !important;
    column-gap: 18px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.today-striped-list .today-order-cell {
    width: 96px !important;
    min-width: 96px !important;
}

.today-striped-list .today-time-number,
.today-striped-list .today-order-cell .today-appointment-number.today-time-number {
    width: 88px !important;
    min-width: 88px !important;
    max-width: 88px !important;
    height: 52px !important;
    padding: 0 12px !important;
    border-radius: 18px !important;
    font-size: 17px !important;
    letter-spacing: -0.03em !important;
}

.today-striped-list .today-service-column .service-color-tag {
    font-size: 13px !important;
    line-height: 1.15 !important;
    padding: 6px 13px !important;
    border-radius: 999px !important;
    max-width: 100% !important;
}

.today-striped-list .today-client-column-mini strong {
    margin: 0 0 8px !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 1.08 !important;
    letter-spacing: -0.03em !important;
}

.today-striped-list .today-client-column-mini p {
    margin: 0 !important;
    font-size: 13px !important;
    font-weight: 850 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.02em !important;
}

.today-striped-list .today-price-column strong {
    margin: 0 0 7px !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 1.08 !important;
    letter-spacing: -0.03em !important;
}

.today-striped-list .today-price-column span:not(.today-column-label) {
    margin: 0 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    letter-spacing: -0.01em !important;
    color: #f08b8b !important;
}

.today-striped-list .today-status-column {
    min-width: 180px !important;
}

.today-striped-list .today-status-column .status-select {
    width: 100% !important;
}

body.appointment-modal-open .global-create-appointment-fab {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(14px) scale(.94) !important;
}

html.theme-dark .today-striped-list .today-price-column span:not(.today-column-label) {
    color: #d88a8a !important;
}

@media (max-width: 1380px) {
    .today-striped-list .today-columns-card.today-clean-card {
        grid-template-columns: 108px minmax(150px, .95fr) minmax(180px, 1fr) minmax(150px, .72fr) minmax(165px, .78fr) minmax(180px, .88fr) !important;
        column-gap: 14px !important;
    }
}

@media (max-width: 1250px) {
    .today-striped-list .today-columns-card.today-clean-card {
        grid-template-columns: 100px repeat(2, minmax(0, 1fr)) !important;
    }
}


/* v153: выравнивание колонок и автодата для новой записи */
.today-striped-list .today-columns-card.today-clean-card {
    align-items: stretch !important;
    grid-template-columns: 118px minmax(180px, 1fr) minmax(210px, 1.02fr) minmax(170px, .72fr) minmax(180px, .78fr) minmax(200px, .9fr) !important;
}

.today-striped-list .today-column {
    justify-content: flex-start !important;
    align-items: flex-start !important;
    gap: 8px !important;
    min-height: 100% !important;
    padding: 6px 0 6px 18px !important;
    border-left: 1px solid #e5e7eb !important;
    box-sizing: border-box !important;
}

.today-striped-list .today-column-label {
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    margin-top: 0 !important;
}

.today-striped-list .today-car-column strong,
.today-striped-list .today-client-column-mini strong,
.today-striped-list .today-price-column strong {
    display: block !important;
    margin: 0 !important;
    color: #0f172a !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 1.08 !important;
    letter-spacing: -0.03em !important;
}

.today-striped-list .today-car-column span:not(.today-column-label) {
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.18 !important;
}

.today-striped-list .today-service-column .service-color-tag {
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
    padding: 6px 13px !important;
}

.today-striped-list .today-client-column-mini p {
    display: block !important;
    margin: 0 !important;
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 850 !important;
    line-height: 1.16 !important;
    letter-spacing: -0.02em !important;
}

.today-striped-list .today-price-column strong {
    margin-bottom: 2px !important;
}

.today-striped-list .today-price-column span:not(.today-column-label) {
    display: block !important;
    margin: 0 !important;
    color: #eea1a1 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.16 !important;
    letter-spacing: -0.01em !important;
}

.today-striped-list .today-status-column {
    min-width: 190px !important;
}

html.theme-dark .today-striped-list .today-column {
    border-left-color: rgba(71, 85, 105, .62) !important;
}

html.theme-dark .today-striped-list .today-car-column strong,
html.theme-dark .today-striped-list .today-client-column-mini strong,
html.theme-dark .today-striped-list .today-price-column strong {
    color: #f8fafc !important;
}

html.theme-dark .today-striped-list .today-car-column span:not(.today-column-label),
html.theme-dark .today-striped-list .today-client-column-mini p {
    color: #94a3b8 !important;
}

html.theme-dark .today-striped-list .today-price-column span:not(.today-column-label) {
    color: #dca0a0 !important;
}


/* v154: цена в карточке дня меньше и ровнее */
.today-striped-list .today-price-column strong {
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
    letter-spacing: -0.01em !important;
}

.today-striped-list .today-price-column span:not(.today-column-label) {
    font-size: 12px !important;
    color: #eaa0a0 !important;
    font-weight: 800 !important;
}


/* v155: навигация по дням и финальная полировка карточек дня */
.today-hero-compact {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 18px !important;
}

.today-hero-date-nav {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-right: 4px !important;
}

.today-date-arrow {
    width: 34px !important;
    height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    background: rgba(255,255,255,.84) !important;
    border: 1px solid rgba(148,163,184,.35) !important;
    color: #2563eb !important;
    text-decoration: none !important;
    font-size: 24px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    box-shadow: 0 8px 18px rgba(15,23,42,.05) !important;
}

.today-date-arrow:hover {
    transform: translateY(-1px) !important;
}

.today-striped-list .today-column-label {
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}

.today-striped-list .today-price-column strong {
    margin: 0 0 5px !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1.12 !important;
    letter-spacing: -0.01em !important;
}

.today-striped-list .today-price-column span:not(.today-column-label) {
    font-size: 12px !important;
    color: #e7a4a4 !important;
}

html.theme-dark .today-date-arrow {
    background: rgba(15, 23, 42, .78) !important;
    border-color: rgba(71,85,105,.7) !important;
    color: #60a5fa !important;
}

@media (max-width: 760px) {
    .today-hero-compact {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .today-hero-date-nav {
        align-self: flex-end !important;
    }
}


/* v156: финальная правка размера заголовка цены и возврат крупной суммы */
.today-striped-list .today-column-label {
    font-size: 11px !important;
}

.today-striped-list .today-price-column strong {
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 1.08 !important;
    letter-spacing: -0.03em !important;
}


/* v156: исправление подписи "Цена" и возврат размера самой суммы */
.today-striped-list .today-column-label {
    font-size: 10.5px !important;
    padding: 4px 8px !important;
    line-height: 1 !important;
}

.today-striped-list .today-price-column .today-column-label {
    font-size: 10.5px !important;
}

.today-striped-list .today-price-column strong {
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 1.08 !important;
    letter-spacing: -0.03em !important;
    margin: 0 0 5px !important;
}

.today-striped-list .today-price-column span:not(.today-column-label) {
    font-size: 12px !important;
    color: #e7a4a4 !important;
    font-weight: 800 !important;
}


/* v157: контрол даты и времени с маской и кнопкой календаря */
.appointment-datetime-wrap {
    position: relative;
}

.appointment-datetime-wrap input[name="appointment_date"] {
    padding-right: 52px !important;
}

.appointment-datetime-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.appointment-datetime-btn:hover {
    background: rgba(148, 163, 184, 0.12);
}

.appointment-datetime-btn svg {
    width: 18px;
    height: 18px;
}

.appointment-datetime-proxy {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    left: 0;
    top: 0;
}

.today-striped-list .today-column-label {
    font-size: 11px !important;
}

.today-striped-list .today-price-column strong {
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 1.08 !important;
    letter-spacing: -0.03em !important;
}

html.theme-dark .appointment-datetime-btn {
    color: #cbd5e1;
}

html.theme-dark .appointment-datetime-btn:hover {
    background: rgba(51, 65, 85, 0.45);
}


/* v158: умная маска даты/времени и подсказка остатка формата */
.appointment-datetime-wrap {
    position: relative;
}

.appointment-datetime-mask-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: -0.01em;
    pointer-events: none;
    white-space: nowrap;
    max-width: calc(100% - 76px);
    overflow: hidden;
    z-index: 1;
}

.appointment-datetime-wrap input[name="appointment_date"] {
    position: relative;
    z-index: 2;
    background: transparent !important;
}

.appointment-datetime-btn {
    z-index: 3;
}

.today-striped-list .today-price-column .today-column-label {
    font-size: 10px !important;
    padding: 3px 7px !important;
}

.today-striped-list .today-price-column strong {
    font-size: 16px !important;
}

html.theme-dark .appointment-datetime-mask-hint {
    color: #64748b;
}


/* v159: сворачиваемый блок дополнительных полей в записи */
.appointment-additional-card {
    margin-top: 18px;
    border: 1px solid #dbe3ef;
    border-radius: 22px;
    background: #f8fbff;
    overflow: hidden;
}

.appointment-additional-summary {
    list-style: none;
    cursor: pointer;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    user-select: none;
}

.appointment-additional-summary::-webkit-details-marker {
    display: none;
}

.appointment-additional-summary span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 18px;
    color: #0f172a;
}

.appointment-additional-summary span::before {
    content: "+";
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    font-size: 18px;
    line-height: 1;
    font-weight: 900;
}

.appointment-additional-card[open] .appointment-additional-summary span::before {
    content: "−";
}

.appointment-additional-summary small {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

.appointment-additional-grid {
    padding: 0 20px 20px;
    border-top: 1px solid #e3ebf5;
}

html.theme-dark .appointment-additional-card {
    background: rgba(10, 19, 38, 0.85);
    border-color: rgba(71, 85, 105, 0.7);
}

html.theme-dark .appointment-additional-summary span {
    color: #f8fafc;
}

html.theme-dark .appointment-additional-summary small {
    color: #94a3b8;
}

html.theme-dark .appointment-additional-grid {
    border-top-color: rgba(71, 85, 105, 0.55);
}

@media (max-width: 760px) {
    .appointment-additional-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .appointment-additional-summary small {
        text-align: left;
    }
}


/* v161: ровный верхний отступ внутри блока «Дополнительно» */
.appointment-additional-grid {
    padding-top: 22px !important;
}

.appointment-additional-grid > label:first-child,
.appointment-additional-grid > label:nth-child(2) {
    margin-top: 0 !important;
}


/* v162: ещё более компактные карточки на странице конкретного дня */
.today-striped-list {
    gap: 12px !important;
}

.today-striped-list .today-columns-card.today-clean-card {
    grid-template-columns: 84px minmax(160px, 0.95fr) minmax(180px, 1fr) minmax(135px, 0.62fr) minmax(150px, 0.72fr) minmax(168px, 0.82fr) !important;
    column-gap: 12px !important;
    padding: 18px 20px !important;
    border-radius: 26px !important;
    min-height: 0 !important;
}

.today-striped-list .today-order-cell {
    width: 64px !important;
    min-width: 64px !important;
    gap: 10px !important;
    align-items: center !important;
    justify-content: center !important;
}

.today-striped-list .today-time-number,
.today-striped-list .today-order-cell .today-appointment-number.today-time-number {
    width: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
    height: 40px !important;
    padding: 0 8px !important;
    border-radius: 14px !important;
    font-size: 15px !important;
    font-weight: 900 !important;
}

.today-striped-list .today-edit-icon {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
}

.today-striped-list .today-edit-icon svg {
    width: 16px !important;
    height: 16px !important;
}

.today-striped-list .today-column {
    gap: 6px !important;
    padding: 4px 0 4px 12px !important;
}

.today-striped-list .today-column-label {
    font-size: 11px !important;
    font-weight: 900 !important;
    padding: 3px 7px !important;
}

.today-striped-list .today-car-column strong,
.today-striped-list .today-client-column-mini strong,
.today-striped-list .today-price-column strong {
    font-size: 14px !important;
    line-height: 1.08 !important;
}

.today-striped-list .today-car-column span:not(.today-column-label),
.today-striped-list .today-client-column-mini p,
.today-striped-list .today-price-column span:not(.today-column-label) {
    font-size: 12px !important;
    line-height: 1.14 !important;
}

.today-striped-list .today-service-column .service-color-tag {
    font-size: 12px !important;
    line-height: 1.1 !important;
    padding: 6px 12px !important;
}

.today-striped-list .today-price-column strong {
    margin-bottom: 3px !important;
}

.today-striped-list .today-status-column {
    min-width: 160px !important;
}

.today-striped-list .today-status-column .status-select {
    min-height: 42px !important;
    height: 42px !important;
    font-size: 13px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

@media (max-width: 1450px) {
    .today-striped-list .today-columns-card.today-clean-card {
        grid-template-columns: 78px minmax(145px, 0.92fr) minmax(170px, 1fr) minmax(125px, 0.6fr) minmax(138px, 0.68fr) minmax(156px, 0.78fr) !important;
        column-gap: 10px !important;
        padding: 16px 18px !important;
    }
}


/* v163: принудительный ультра-компактный режим карточек дня */
.today-striped-list {
    gap: 8px !important;
}

.today-striped-list .today-ultra-compact-card.today-columns-card {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 62px minmax(130px, .95fr) minmax(160px, 1fr) minmax(110px, .62fr) minmax(130px, .72fr) minmax(150px, .82fr) !important;
    align-items: center !important;
    column-gap: 8px !important;
    padding: 11px 14px !important;
    min-height: 86px !important;
    border-radius: 18px !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .055) !important;
}

.today-striped-list .today-ultra-compact-card:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .075) !important;
}

.today-striped-list .today-ultra-compact-card .today-order-cell {
    width: 52px !important;
    min-width: 52px !important;
    gap: 6px !important;
}

.today-striped-list .today-ultra-compact-card .today-time-number,
.today-striped-list .today-ultra-compact-card .today-order-cell .today-appointment-number.today-time-number {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: 32px !important;
    padding: 0 5px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    letter-spacing: -0.02em !important;
}

.today-striped-list .today-ultra-compact-card .today-edit-icon {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    border-radius: 10px !important;
}

.today-striped-list .today-ultra-compact-card .today-edit-icon svg {
    width: 14px !important;
    height: 14px !important;
}

.today-striped-list .today-ultra-compact-card .today-column {
    justify-content: flex-start !important;
    gap: 4px !important;
    padding: 2px 0 2px 9px !important;
    min-height: 58px !important;
    overflow: hidden !important;
}

.today-striped-list .today-ultra-compact-card .today-column-label {
    padding: 2px 6px !important;
    font-size: 10px !important;
    line-height: 1 !important;
    border-radius: 999px !important;
}

.today-striped-list .today-ultra-compact-card .today-car-column strong,
.today-striped-list .today-ultra-compact-card .today-client-column-mini strong,
.today-striped-list .today-ultra-compact-card .today-price-column strong {
    font-size: 13px !important;
    line-height: 1.05 !important;
    white-space: normal !important;
}

.today-striped-list .today-ultra-compact-card .today-car-column span:not(.today-column-label),
.today-striped-list .today-ultra-compact-card .today-client-column-mini p,
.today-striped-list .today-ultra-compact-card .today-price-column span:not(.today-column-label) {
    font-size: 11px !important;
    line-height: 1.08 !important;
}

.today-striped-list .today-ultra-compact-card .today-service-column .service-color-tag {
    font-size: 11px !important;
    line-height: 1.05 !important;
    padding: 5px 10px !important;
    max-width: 100% !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08) !important;
}

.today-striped-list .today-ultra-compact-card .today-price-column strong {
    margin-bottom: 1px !important;
}

.today-striped-list .today-ultra-compact-card .today-status-column {
    min-width: 142px !important;
}

.today-striped-list .today-ultra-compact-card .today-status-form .status-select {
    min-height: 34px !important;
    height: 34px !important;
    border-radius: 14px !important;
    padding: 6px 28px 6px 10px !important;
    font-size: 11px !important;
    font-weight: 850 !important;
}

@media (max-width: 1450px) {
    .today-striped-list .today-ultra-compact-card.today-columns-card {
        grid-template-columns: 58px minmax(118px, .9fr) minmax(145px, 1fr) minmax(100px, .58fr) minmax(118px, .66fr) minmax(140px, .78fr) !important;
        column-gap: 7px !important;
        padding: 10px 12px !important;
    }
}


.today-payment-method {
    margin-top: 5px;
    color: #64748b;
    font-size: 11px;
    font-weight: 850;
}

html.theme-dark .today-payment-method {
    color: #94a3b8;
}


/* v165: переключатель аналитики компании */
.analytics-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: 18px;
    background: #eef4ff;
    border: 1px solid #dbeafe;
}

.analytics-tab {
    border: 0;
    border-radius: 14px;
    padding: 10px 16px;
    background: transparent;
    color: #64748b;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.analytics-tab.is-active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, .22);
}

.company-analytics-panel[hidden] {
    display: none !important;
}

html.theme-dark .analytics-switcher {
    background: rgba(15, 23, 42, .72);
    border-color: rgba(71, 85, 105, .72);
}

html.theme-dark .analytics-tab {
    color: #94a3b8;
}

html.theme-dark .analytics-tab.is-active {
    color: #fff;
    background: #2563eb;
}


/* v167: настройки процента компании */
.company-settings-card {
    margin-bottom: 28px;
}

.company-profit-explain {
    display: grid;
    grid-template-columns: minmax(220px, .32fr) 1fr;
    gap: 18px;
    align-items: center;
    padding: 18px;
    border-radius: 22px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    margin-bottom: 18px;
}

.company-profit-explain span {
    display: block;
    color: #64748b;
    font-size: 13px;
    font-weight: 850;
    margin-bottom: 6px;
}

.company-profit-explain strong {
    display: block;
    color: #0f172a;
    font-size: 32px;
    line-height: 1;
    font-weight: 950;
}

.company-profit-explain p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

.company-settings-form {
    display: flex;
    align-items: end;
    gap: 14px;
    flex-wrap: wrap;
}

.company-settings-form label {
    display: grid;
    gap: 8px;
    min-width: 280px;
}

.company-settings-form label > span {
    color: #0f172a;
    font-weight: 900;
}

.percent-input-wrap {
    position: relative;
}

.percent-input-wrap input {
    width: 100%;
    min-height: 48px;
    border-radius: 16px;
    border: 1px solid #cbd5e1;
    padding: 0 46px 0 16px;
    font-size: 17px;
    font-weight: 900;
    color: #0f172a;
    background: #fff;
}

.percent-input-wrap b {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 16px;
    font-weight: 950;
}

.settings-readonly-note {
    color: #64748b;
    font-weight: 750;
}

html.theme-dark .company-profit-explain {
    background: rgba(15, 23, 42, .7);
    border-color: rgba(71, 85, 105, .7);
}

html.theme-dark .company-profit-explain strong,
html.theme-dark .company-settings-form label > span {
    color: #f8fafc;
}

html.theme-dark .company-profit-explain span,
html.theme-dark .company-profit-explain p,
html.theme-dark .settings-readonly-note {
    color: #94a3b8;
}

html.theme-dark .percent-input-wrap input {
    background: #0b1730;
    border-color: #334155;
    color: #f8fafc;
}

@media (max-width: 800px) {
    .company-profit-explain {
        grid-template-columns: 1fr;
    }
}


/* v168: аналитика без процента и работники внутри настроек компании */
.company-analytics-empty-setup {
    padding: 34px 24px;
    border-radius: 24px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    text-align: center;
    color: #64748b;
}

.company-analytics-empty-setup h3 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 22px;
    font-weight: 950;
}

.company-analytics-empty-setup p {
    margin: 0;
    font-size: 14px;
    font-weight: 750;
}

.company-settings-workers-block {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.company-settings-workers-block .workers-table-card {
    margin: 0;
    box-shadow: none;
    border-color: #e2e8f0;
}

html.theme-dark .company-analytics-empty-setup {
    background: rgba(15, 23, 42, .7);
    border-color: rgba(71, 85, 105, .8);
    color: #94a3b8;
}

html.theme-dark .company-analytics-empty-setup h3 {
    color: #f8fafc;
}

html.theme-dark .company-settings-workers-block {
    border-top-color: rgba(71, 85, 105, .7);
}


/* v169: кнопка перехода к настройке процента и возврат работников отдельным блоком */
.company-settings-anchor-btn {
    margin-top: 14px;
    width: fit-content;
    text-decoration: none;
}

.company-settings-card {
    scroll-margin-top: 24px;
}


/* v170: плавный переход к настройке процента компании */
html {
    scroll-behavior: smooth;
}

.company-settings-card {
    scroll-margin-top: 90px !important;
}

.company-profit-percent-label {
    position: relative;
    width: fit-content;
    border-radius: 12px;
    padding: 4px 8px;
    margin: -4px -8px;
    transition: background .28s ease, color .28s ease, box-shadow .28s ease;
}

.company-profit-percent-label.is-profit-highlighted {
    background: rgba(37, 99, 235, .14);
    color: #1d4ed8;
    box-shadow: 0 0 0 6px rgba(37, 99, 235, .08);
    animation: profitLabelPulse 1.25s ease-in-out 2;
}

@keyframes profitLabelPulse {
    0%, 100% { transform: scale(1); }
    45% { transform: scale(1.025); }
}

html.theme-dark .company-profit-percent-label.is-profit-highlighted {
    background: rgba(96, 165, 250, .18);
    color: #93c5fd;
    box-shadow: 0 0 0 6px rgba(96, 165, 250, .10);
}


/* v172: PIN-защита страницы компании */
.company-pin-page {
    min-height: calc(100vh - 90px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px 0;
}

.company-pin-card {
    width: min(520px, 100%);
    padding: 34px;
    text-align: center;
    border-radius: 30px;
}

.company-pin-icon {
    width: 64px;
    height: 64px;
    display: inline-grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 22px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 28px;
}

.company-pin-card h1 {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: 30px;
    letter-spacing: -0.04em;
}

.company-pin-card p {
    margin: 0 auto 24px;
    max-width: 430px;
    color: #64748b;
    font-weight: 700;
    line-height: 1.45;
}

.company-pin-form {
    display: grid;
    gap: 16px;
    text-align: left;
}

.company-pin-form label span {
    display: block;
    margin-bottom: 8px;
    color: #0f172a;
    font-weight: 900;
}

.company-pin-form input {
    width: 100%;
    height: 58px;
    border-radius: 18px;
    border: 1px solid #cbd5e1;
    padding: 0 18px;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: .22em;
    text-align: center;
    box-sizing: border-box;
}

.company-pin-form small {
    display: block;
    margin-top: 8px;
    color: #dc2626;
    font-weight: 800;
}

.company-pin-form .button {
    width: 100%;
    justify-content: center;
}

.company-pin-note {
    margin-top: 16px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 750;
}

html.theme-dark .company-pin-icon {
    background: #172554;
    color: #93c5fd;
}

html.theme-dark .company-pin-card h1,
html.theme-dark .company-pin-form label span {
    color: #f8fafc;
}

html.theme-dark .company-pin-card p,
html.theme-dark .company-pin-note {
    color: #94a3b8;
}

html.theme-dark .company-pin-form input {
    background: #0b1224;
    border-color: #334155;
    color: #f8fafc;
}


/* v173: компактный PIN-экран компании и сброс PIN */
.company-pin-page {
    min-height: calc(100vh - 120px) !important;
    padding: 18px 0 !important;
}

.company-pin-card {
    width: min(450px, 100%) !important;
    padding: 28px !important;
    border-radius: 26px !important;
}

.company-pin-icon {
    width: 50px !important;
    height: 50px !important;
    margin-bottom: 14px !important;
    border-radius: 18px !important;
    background: #f1f5f9 !important;
    color: #0f172a !important;
    font-size: 0 !important;
}

.company-pin-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.15;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.company-pin-card h1 {
    margin-bottom: 8px !important;
    font-size: 25px !important;
}

.company-pin-card p {
    max-width: 320px !important;
    margin-bottom: 18px !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
}

.company-pin-form {
    gap: 12px !important;
}

.company-pin-form label span {
    margin-bottom: 7px !important;
    font-size: 14px !important;
}

.company-pin-form input {
    height: 50px !important;
    border-radius: 16px !important;
    font-size: 20px !important;
    letter-spacing: .22em !important;
}

.company-pin-form .button {
    min-height: 46px !important;
}

.company-pin-reset-form {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #dbe3ef;
    border-radius: 18px;
    background: #f8fbff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.company-pin-reset-form strong,
.company-pin-reset-form span {
    display: block;
}

.company-pin-reset-form strong {
    color: #0f172a;
    font-size: 15px;
    font-weight: 900;
}

.company-pin-reset-form span {
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

html.theme-dark .company-pin-icon {
    background: #1f2937 !important;
    color: #f8fafc !important;
}

html.theme-dark .company-pin-reset-form {
    background: rgba(15, 23, 42, .55);
    border-color: rgba(71, 85, 105, .65);
}

html.theme-dark .company-pin-reset-form strong {
    color: #f8fafc;
}

html.theme-dark .company-pin-reset-form span {
    color: #94a3b8;
}

@media (max-width: 760px) {
    .company-pin-reset-form {
        flex-direction: column;
        align-items: stretch;
    }
}


/* v174: PIN поверх страницы компании и упрощённые настройки */
.company-protected-content.is-pin-locked {
    filter: blur(14px);
    transform: scale(.992);
    pointer-events: none;
    user-select: none;
}

.company-pin-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(241, 245, 249, .42);
    backdrop-filter: blur(10px);
}

.company-pin-overlay .company-pin-card {
    width: min(430px, 100%) !important;
    padding: 26px !important;
    border-radius: 26px !important;
    text-align: center;
    box-shadow: 0 28px 90px rgba(15, 23, 42, .18);
}

.company-pin-overlay .company-pin-icon {
    width: 48px !important;
    height: 48px !important;
    margin-bottom: 13px !important;
}

.company-pin-overlay .company-pin-card h1 {
    font-size: 24px !important;
    margin-bottom: 8px !important;
}

.company-pin-overlay .company-pin-card p {
    margin-bottom: 17px !important;
    font-size: 14px !important;
}

.company-pin-overlay .company-pin-form input::placeholder {
    letter-spacing: .28em;
}

.company-settings-head-clean {
    margin-bottom: 14px;
}

.company-setting-cloud {
    padding: 18px;
    border: 1px solid #dbe3ef;
    border-radius: 20px;
    background: #f8fbff;
}

.company-profit-settings-inline {
    display: flex !important;
    align-items: flex-end !important;
    gap: 14px !important;
    flex-wrap: wrap !important;
    margin-top: 0 !important;
}

.company-profit-settings-inline label {
    margin: 0 !important;
    min-width: min(420px, 100%) !important;
}

.company-profit-settings-inline .button {
    min-height: 52px;
}

.company-profit-explain {
    display: none !important;
}

html.theme-dark .company-pin-overlay {
    background: rgba(2, 6, 23, .38);
}

html.theme-dark .company-setting-cloud {
    background: rgba(15, 23, 42, .55);
    border-color: rgba(71, 85, 105, .65);
}


/* v175: убираем дёргание скролла и фиксируем PIN-оверлей */
html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    overflow-x: hidden;
}

.sidebar {
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

body.company-pin-active {
    overflow: hidden !important;
}

body.company-pin-active .global-create-appointment-fab {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(14px) scale(.94) !important;
}

.company-protected-content.is-pin-locked {
    filter: blur(18px) !important;
    transform: scale(.992) !important;
}

.company-pin-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
    overflow: hidden !important;
    background: rgba(15, 23, 42, .36) !important;
    backdrop-filter: blur(18px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(120%) !important;
}

.company-pin-overlay .company-pin-card {
    position: relative !important;
    z-index: 2147483001 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    width: min(430px, calc(100vw - 48px)) !important;
    max-height: calc(100vh - 48px) !important;
    overflow: visible !important;
}

html.theme-dark .company-pin-overlay {
    background: rgba(2, 6, 23, .56) !important;
}


/* v176: реальный PIN-оверлей внутри content и блокировка прокрутки */
body.company-pin-active,
body.company-pin-active html {
    overflow: hidden !important;
}

body.company-pin-active .content {
    overflow: hidden !important;
}

.company-pin-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483600 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
    background: rgba(15, 23, 42, .42) !important;
    backdrop-filter: blur(20px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(120%) !important;
}

.company-pin-overlay .company-pin-card {
    display: block !important;
    position: relative !important;
    z-index: 2147483601 !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: min(430px, calc(100vw - 48px)) !important;
    max-height: calc(100vh - 48px) !important;
    overflow: visible !important;
    pointer-events: auto !important;
}

.company-protected-content.is-pin-locked {
    filter: blur(20px) !important;
    pointer-events: none !important;
    user-select: none !important;
}


/* v177: фикс видимости PIN-плашки и блокировки прокрутки */
html:has(body.company-pin-active),
body.company-pin-active {
    overflow: hidden !important;
    height: 100% !important;
}

body.company-pin-active .content {
    overflow: hidden !important;
}

.company-pin-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483640 !important;
    display: grid !important;
    place-items: center !important;
    padding: 24px !important;
    background: rgba(15, 23, 42, .52) !important;
    backdrop-filter: blur(24px) saturate(115%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(115%) !important;
    pointer-events: auto !important;
}

.company-pin-overlay .company-pin-card {
    display: block !important;
    position: relative !important;
    z-index: 2147483641 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    width: min(420px, calc(100vw - 48px)) !important;
    pointer-events: auto !important;
}

body.company-pin-active .global-create-appointment-fab {
    display: none !important;
}


/* v178: PIN-карточка не размывается, фон фиксируется сверху */
html.company-pin-active-html,
body.company-pin-active {
    overflow: hidden !important;
    height: 100% !important;
}

body.company-pin-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
}

body.company-pin-active .content {
    overflow: hidden !important;
}

.company-protected-content.is-pin-locked {
    filter: blur(18px) saturate(108%) !important;
    transform: none !important;
    pointer-events: none !important;
    user-select: none !important;
}

.company-pin-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483640 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
    background: rgba(15, 23, 42, .48) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    pointer-events: auto !important;
}

.company-pin-overlay .company-pin-card {
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    position: relative !important;
    z-index: 2147483641 !important;
    width: min(420px, calc(100vw - 48px)) !important;
    background: #ffffff !important;
    box-shadow: 0 32px 100px rgba(15, 23, 42, .34) !important;
}

html.theme-dark .company-pin-overlay {
    background: rgba(2, 6, 23, .66) !important;
}

html.theme-dark .company-pin-overlay .company-pin-card {
    background: #0f172a !important;
}

body.company-pin-active .global-create-appointment-fab {
    display: none !important;
}


/* v179: позиция PIN, белая полоса и верх страницы */
html.company-pin-active-html {
    overflow: hidden !important;
    scrollbar-width: none !important;
}

html.company-pin-active-html::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

body.company-pin-active {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;
    min-height: 100vh !important;
    overflow: hidden !important;
}

body.company-pin-active .main {
    min-height: 100vh !important;
}

.company-pin-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: 100vw !important;
    height: 100vh !important;
    min-width: 100vw !important;
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
    margin: 0 !important;
    background: rgba(15, 23, 42, .52) !important;
    overflow: hidden !important;
}

.company-pin-overlay .company-pin-card {
    margin-top: 42px !important;
    transform: none !important;
}

.company-protected-content.is-pin-locked {
    transform: none !important;
}


/* v180: PIN строго по центру экрана и без белой полосы при свернутой панели */
.company-pin-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-width: 100vw !important;
    min-height: 100vh !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    background: rgba(15, 23, 42, .52) !important;
    overflow: hidden !important;
    z-index: 999999 !important;
}

.company-pin-overlay .company-pin-card {
    position: fixed !important;
    left: 50vw !important;
    top: 50vh !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    z-index: 1000000 !important;
}

body.sidebar-collapsed::before {
    display: none !important;
    content: none !important;
}

body.sidebar-collapsed .main {
    padding-left: 32px !important;
}

@media (max-width: 1000px) {
    body.sidebar-collapsed .main {
        padding-left: 18px !important;
    }
}


/* v181: убираем временный второй скроллбар при переходах/обновлении */
html {
    overflow-y: scroll !important;
    scrollbar-gutter: stable !important;
}

body {
    overflow-x: hidden !important;
}

.main,
.auth-main {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    transform: none !important;
    animation: pageFadeInNoScrollV181 .18s ease both !important;
}

body.page-leaving .main,
body.page-leaving .auth-main {
    transform: none !important;
    opacity: 0 !important;
    transition: opacity .14s ease !important;
}

body:not(.page-leaving) .main,
body:not(.page-leaving) .auth-main {
    transform: none !important;
}

@keyframes pageFadeInNoScrollV181 {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* v185: библиотека марок и моделей внутри каждой компании */
.car-input-action-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.car-input-action-wrap input {
    width: 100%;
}

.found-cars-button {
    min-width: 154px;
    justify-content: center;
    white-space: nowrap;
}

body.car-picker-open {
    overflow: hidden !important;
}

.car-catalog-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(15, 23, 42, .46);
    backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

.car-catalog-picker-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.car-catalog-picker-overlay.is-hiding {
    opacity: 0;
    pointer-events: none;
}

.car-catalog-picker {
    width: min(1040px, 100%);
    max-height: min(86vh, 780px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .26);
    border-radius: 28px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 30px 90px rgba(15, 23, 42, .28);
    transform: translateY(10px) scale(.985);
    transition: transform .18s ease;
}

.car-catalog-picker-overlay.is-visible .car-catalog-picker {
    transform: translateY(0) scale(1);
}

html.theme-dark .car-catalog-picker {
    border-color: rgba(148, 163, 184, .18);
    background: rgba(15, 23, 42, .97);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .42);
}

.car-catalog-picker-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 26px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.car-catalog-picker-kicker {
    margin-bottom: 6px;
    color: #2563eb;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

html.theme-dark .car-catalog-picker-kicker {
    color: #93c5fd;
}

.car-catalog-picker-head h2 {
    margin: 0;
    color: #0f172a;
    font-size: 24px;
    line-height: 1.15;
}

html.theme-dark .car-catalog-picker-head h2 {
    color: #f8fafc;
}

.car-catalog-picker-head p {
    max-width: 680px;
    margin: 8px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.45;
}

html.theme-dark .car-catalog-picker-head p {
    color: #94a3b8;
}

.car-catalog-picker-close {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 16px;
    background: rgba(15, 23, 42, .06);
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: transform .16s ease, background .16s ease;
}

.car-catalog-picker-close:hover {
    transform: scale(1.04);
    background: rgba(15, 23, 42, .1);
}

html.theme-dark .car-catalog-picker-close {
    background: rgba(255, 255, 255, .08);
    color: #f8fafc;
}

.car-catalog-picker-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 16px 26px;
    border-bottom: 1px solid rgba(148, 163, 184, .14);
}

.car-catalog-picker-search {
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
    border: 1px solid rgba(148, 163, 184, .34);
    border-radius: 16px;
    background: rgba(248, 250, 252, .9);
    color: #0f172a;
    font: inherit;
    outline: none;
}

.car-catalog-picker-search:focus {
    border-color: rgba(37, 99, 235, .58);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

html.theme-dark .car-catalog-picker-search {
    border-color: rgba(148, 163, 184, .22);
    background: rgba(15, 23, 42, .72);
    color: #f8fafc;
}

.car-catalog-picker-count {
    min-width: 112px;
    color: #64748b;
    font-size: 13px;
    font-weight: 900;
    text-align: right;
}

html.theme-dark .car-catalog-picker-count {
    color: #94a3b8;
}

.car-catalog-picker-letters {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 12px 26px;
    border-bottom: 1px solid rgba(148, 163, 184, .14);
    scrollbar-width: thin;
}

.car-catalog-picker-letters button {
    flex: 0 0 auto;
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 999px;
    background: rgba(248, 250, 252, .9);
    color: #334155;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.car-catalog-picker-letters button:hover {
    border-color: rgba(37, 99, 235, .42);
    color: #1d4ed8;
}

html.theme-dark .car-catalog-picker-letters button {
    border-color: rgba(148, 163, 184, .2);
    background: rgba(30, 41, 59, .72);
    color: #cbd5e1;
}

.car-catalog-picker-list {
    flex: 1;
    overflow: auto;
    padding: 20px 26px 26px;
    scroll-behavior: smooth;
}

.car-catalog-picker-section {
    scroll-margin-top: 16px;
}

.car-catalog-picker-section + .car-catalog-picker-section {
    margin-top: 24px;
}

.car-catalog-picker-section h3 {
    position: sticky;
    top: -20px;
    z-index: 1;
    margin: 0 0 12px;
    padding: 10px 0;
    background: linear-gradient(to bottom, rgba(255,255,255,.98), rgba(255,255,255,.88));
    color: #0f172a;
    font-size: 18px;
    font-weight: 950;
}

html.theme-dark .car-catalog-picker-section h3 {
    background: linear-gradient(to bottom, rgba(15,23,42,.98), rgba(15,23,42,.88));
    color: #f8fafc;
}

.car-catalog-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
    gap: 10px;
}

.car-catalog-picker-item {
    min-height: 58px;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 18px;
    background: rgba(248, 250, 252, .86);
    color: #0f172a;
    text-align: left;
    cursor: pointer;
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease, background .14s ease;
}

.car-catalog-picker-item:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, .36);
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
}

.car-catalog-picker-item strong {
    display: block;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.25;
}

.car-catalog-picker-item span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

html.theme-dark .car-catalog-picker-item {
    border-color: rgba(148, 163, 184, .16);
    background: rgba(30, 41, 59, .58);
    color: #f8fafc;
}

html.theme-dark .car-catalog-picker-item:hover {
    border-color: rgba(96, 165, 250, .36);
    background: rgba(30, 41, 59, .86);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
}

html.theme-dark .car-catalog-picker-item span {
    color: #94a3b8;
}

.car-catalog-picker-empty {
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: 28px;
    border: 1px dashed rgba(148, 163, 184, .36);
    border-radius: 22px;
    color: #64748b;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
}

html.theme-dark .car-catalog-picker-empty {
    color: #94a3b8;
}

@media (max-width: 760px) {
    .car-input-action-wrap {
        grid-template-columns: 1fr;
    }

    .found-cars-button {
        width: fit-content;
        min-width: 0;
    }

    .car-catalog-picker-overlay {
        align-items: flex-end;
        padding: 10px;
    }

    .car-catalog-picker {
        max-height: 92vh;
        border-radius: 24px;
    }

    .car-catalog-picker-head,
    .car-catalog-picker-search-row,
    .car-catalog-picker-letters,
    .car-catalog-picker-list {
        padding-left: 16px;
        padding-right: 16px;
    }

    .car-catalog-picker-search-row {
        grid-template-columns: 1fr;
    }

    .car-catalog-picker-count {
        text-align: left;
    }

    .car-catalog-picker-grid {
        grid-template-columns: 1fr;
    }
}


/* v187: фиксируем алфавитную строку в библиотеках машин/моделей/услуг */
.car-catalog-picker {
    min-height: min(520px, 86vh);
}

.car-catalog-picker-head,
.car-catalog-picker-search-row,
.car-catalog-picker-letters {
    flex: 0 0 auto;
}

.car-catalog-picker-letters {
    position: sticky;
    top: 0;
    z-index: 6;
    min-height: 56px;
    align-items: center;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 1px 0 rgba(148, 163, 184, .14);
}

.car-catalog-picker-list {
    min-height: 0;
    position: relative;
    overscroll-behavior: contain;
}

.car-catalog-picker-section {
    scroll-margin-top: 0;
}

.car-catalog-picker-section h3 {
    top: 0;
}

html.theme-dark .car-catalog-picker-letters {
    background: rgba(15, 23, 42, .97);
    box-shadow: 0 1px 0 rgba(148, 163, 184, .14);
}

@media (max-width: 760px) {
    .car-catalog-picker-letters {
        min-height: 54px;
    }
}
