body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f7fb;
    margin: 0;
    padding: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #e2e8f0;
}

.site-header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.site-logo {
    font-weight: 700;
    font-size: 27px;
    color: #0f172a;
}

.site-subtitle {
    font-size: 13px;
    color: #64748b;
}

.site-header-right {
    font-size: 12px;
    color: #94a3b8;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

h1 {
    margin-bottom: 24px;
}

.block {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

#orders-list table {
    width: 100%;
    table-layout: fixed;
}

#orders-list th:first-child,
#orders-list td:first-child {
    width: 15px;
    text-align: center;
}

#orders-list th:last-child,
#orders-list td:last-child {
    width: 80px;
    text-align: center;
}

#orders-list td {
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
}

.block h2 {
    margin-top: 0;
    margin-bottom: 12px;
}

label {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

input, select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #d0d7e2;
    font-size: 14px;
}

/* Цвет вариантов в выпадающем списке */
select option {
    color: #0f172a;
}

/* Плейсхолдер внутри списка */
select option[disabled] {
    color: #94a3b8;
}

/* Цвет текста в ЗАКРЫТОМ селекте:
   - плейсхолдер серый
   - выбранное значение тёмное */
.select-placeholder {
    color: #94a3b8;
}

.select-has-value {
    color: #0f172a;
}

.form-row {
    margin-bottom: 10px;
}

button {
    display: inline-block;
    margin-top: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    border: none;
    background: #2563eb;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
}

button:hover {
    background: #1d4ed8;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-button {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 14px;
    cursor: pointer;
    color: #0f172a;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.tab-button.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.35);
}

.tab-button:hover:not(.active) {
    background: #e2e8f0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 13px;
}

th, td {
    border: 1px solid #e2e8f0;
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Таблица "Заказы выбранной ТТ" */
#orders-list table {
    table-layout: fixed;
}

/* Столбцы "Статус" и "Тип" чуть шире */
#orders-list th:nth-child(5),
#orders-list td:nth-child(5) {
    width: 70px;
}

#orders-list th:nth-child(7),
#orders-list td:nth-child(7) {
    width: 70px;
}

/* Столбец "ФИО сотрудника" шире для удобства чтения */
#orders-list th:nth-child(8),
#orders-list td:nth-child(8) {
    width: 100px;
}

/* Столбец "Предоплата" немного шире */
#orders-list th:nth-child(10),
#orders-list td:nth-child(10) {
    width: 80px;
}

/* Столбец с кнопкой "Открыть" уже */
#orders-list th:nth-child(11),
#orders-list td:nth-child(11) {
    width: 70px;
    text-align: center;
}

th {
    background: #f1f5f9;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.pt-model-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 2px;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.pt-model-row span {
    line-height: 1.3;
}

.pt-model-row:hover {
    background: #e5edff;
}

.pt-model-row.selected {
    background: #2563eb;
    color: #ffffff;
}

.pt-size-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pt-size-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e2e8f0;
    font-size: 13px;
    cursor: pointer;
    color: #1e293b;
    min-width: 80px;
    transition: background 0.12s ease, color 0.12s ease;
}

.pt-size-option.selected {
    background: #2563eb;
    color: #ffffff;
}

.pt-size-option:hover:not(.selected) {
    background: #cbd5e1;
}

.scroll-to-top-zone,
.scroll-to-top-zone-left {
    position: fixed;
    top: 0;
    width: 12px;
    height: 100vh;
    cursor: pointer;
    z-index: 10;
}

.scroll-to-top-zone {
    right: 0;
}

.scroll-to-top-zone-left {
    left: 0;
    width: 40px;
    height: 100vh;
}

@media (max-width: 768px) {
    .scroll-to-top-zone {
        display: none;
    }
    .scroll-to-top-zone-left {
        display: none;
    }
}

.catalog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.catalog-table th,
.catalog-table td {
    border: 1px solid #e2e8f0;
    padding: 4px 6px;
    text-align: left;
}

.catalog-table thead th {
    position: sticky;
    top: 0;
    background: #cbd5e1;
    color: #0f172a;
    z-index: 1;
}

.catalog-table tbody tr:nth-child(odd) {
    background-color: #f8fafc;
}

.catalog-table tbody tr:nth-child(even) {
    background-color: #ffffff;
}

.catalog-table tbody tr:hover {
    background-color: #e2e8f0;
}

.badge {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    margin-left: 6px;
    border-radius: 50%;
    background-color: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
}

.order-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    max-width: 560px;
    width: 100%;
    max-height: 100vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
    padding: 18px 22px 18px;
}

.order-modal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 18px;
    line-height: 1;
}

.tt-open-order {
    padding: 4px 8px;
    font-size: 12px;
}

.chat-btn {
    padding: 10px 28px;
    font-size: 14px;
}

/* Более компактная карточка заказа в модалке */
.order-card {
    font-size: 15px;
    line-height: 1.35;
}

.order-card h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
}

.order-card p {
    margin: 2px 0;
}

.order-card .form-row {
    margin-top: 6px;
    margin-bottom: 6px;
}

.pt-section-title {
    margin-top: 8px;
    margin-bottom: 4px;
    font-size: 18px;
    font-weight: 600;
    color: #475569;
}

.pt-buttons-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.pt-buttons-row-bottom {
    margin-top: 10px;
}

.pt-models-box {
    max-height: 220px;
    overflow-y: auto;
    margin-top: 4px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 8px;
    max-width: 420px;
    background: #f8fafc;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06) inset;
}

.pt-changes-info {
    margin-top: 6px;
    font-size: 13px;
    color: #0f172a;
}

.changes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 4px;
}

.changes-table th,
.changes-table td {
    border: 1px solid #e2e8f0;
    padding: 4px 6px;
    text-align: left;
}

.changes-table thead th {
    background: #e5e7eb;
}

.changes-table tbody tr:nth-child(odd) {
    background-color: #f9fafb;
}

.changes-table tbody tr:nth-child(even) {
    background-color: #ffffff;
}

.price-up {
    color: #ef4444;
    font-weight: 600;
}

.price-down {
    color: #16a34a;
    font-weight: 600;
}

.price-main {
    font-size: 13px;
    font-weight: 600;
}

.price-delta {
    font-size: 11px;
}

.price-delta-past {
    opacity: 0.9;
}

.btn-warning {
    background: #f97316;
    color: #ffffff;
}

.btn-warning:hover {
    background: #ea580c;
}

