* { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== ОСНОВНОЙ ГРАДИЕНТНЫЙ ФОН ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 32px;
}

/* ===== КАРТОЧКИ С ТЕНЬЮ И СКРУГЛЕНИЯМИ ===== */
.user-panel,
.tabs,
.order-card,
.product-list,
.client-card,
.execution-item,
.report-section,
.stats-panel,
.admin-panel,
.modal-content {
    background: rgba(245, 245, 255, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.order-card,
.client-card,
.execution-item {
    background: white;
}

.user-panel,
.tabs {
    border-radius: 40px;
}

/* ===== ЗАГОЛОВКИ ===== */
h1 { font-size: 28px; font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; color: white; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
h2 { font-size: 20px; font-weight: 500; margin: 24px 0 12px; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.1); }

/* ===== ВКЛАДКИ ===== */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    flex-wrap: wrap;
}
.tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    border-radius: 30px;
    font-weight: 500;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}
.tab.active {
    background: #1976d2;
    color: white;
}

/* ===== ПАНЕЛЬ ПОЛЬЗОВАТЕЛЯ ===== */
.user-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 8px 16px;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
}
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1976d2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}
.logout-btn {
    background: none;
    border: none;
    color: #c62828;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
}

/* ===== АДМИН-ПАНЕЛЬ ===== */
.admin-panel {
    padding: 16px;
    margin-bottom: 20px;
    border-left: 4px solid #ffc107;
}
.admin-panel h3 {
    color: #ffc107;
    margin-bottom: 10px;
}
.logs-container {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 12px;
    margin-top: 10px;
}
.log-item {
    padding: 6px;
    border-bottom: 1px solid #eee;
}
.log-item:last-child { border-bottom: none; }

/* ===== СТАТИСТИКА ===== */
.stats-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px;
    margin-bottom: 20px;
}
.stat-item {
    background: rgba(255,255,255,0.5);
    border-radius: 16px;
    padding: 12px;
    text-align: center;
}
.stat-label { font-size: 13px; color: #666; margin-bottom: 4px; }
.stat-value { font-size: 24px; font-weight: 600; color: #1976d2; }
.stat-value.small { font-size: 18px; }
.stat-progress {
    grid-column: span 2;
    background: rgba(255,255,255,0.3);
    border-radius: 20px;
    height: 10px;
    overflow: hidden;
    margin-top: 8px;
}
.progress-bar {
    height: 100%;
    background: #1976d2;
    width: 0%;
    transition: width 0.3s;
}

/* ===== ПОИСК И ФИЛЬТРЫ ===== */
.search-section {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.2);
}
.search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.search-input {
    flex: 1;
    padding: 12px;
    border-radius: 30px;
    border: 2px solid rgba(255,255,255,0.3);
    font-size: 14px;
    background: transparent;
    color: #333;
}
.filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.filter-select {
    padding: 10px;
    border-radius: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    background: transparent;
    font-size: 14px;
    flex: 1;
    min-width: 120px;
    color: #333;
}
.date-input {
    padding: 10px;
    border-radius: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    background: transparent;
    font-size: 14px;
    flex: 1;
    color: #333;
}
.clear-filters {
    color: #c62828;
    font-size: 12px;
    text-align: right;
    cursor: pointer;
    margin-top: 8px;
}
.export-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.export-buttons .button {
    flex: 1;
    margin: 0;
}

/* ===== КАРТОЧКА ЗАКАЗА ===== */
.order-card {
    padding: 16px;
    margin-bottom: 16px;
    cursor: pointer;
}
.order-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    pointer-events: none;
}
.order-number { font-weight: 600; font-size: 18px; }
.order-badge {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
}
.order-badge.work { background: #fff3e0; color: #e65100; }
.order-badge.done { background: #e8f5e8; color: #2e7d32; }
.order-badge.partial { background: #fff3e0; color: #e65100; }
.order-badge.cancelled { background: #ffebee; color: #c62828; }
.order-badge.pending-payment { background: #e0e0e0; color: #757575; }
.order-date {
    font-size: 12px;
    color: #777;
    margin-bottom: 8px;
}
.days-remaining {
    font-size: 13px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-block;
    margin-left: 8px;
}
.days-green { background: #e8f5e8; color: #2e7d32; }
.days-yellow { background: #fff3e0; color: #e65100; }
.days-red { background: #ffebee; color: #c62828; }
.customer {
    color: #555;
    font-size: 14px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    pointer-events: none;
}
.items { pointer-events: none; }
.item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}
.item-info { flex: 2; }
.item-name { font-weight: 500; }
.item-desc { font-size: 13px; color: #777; }
.item-deadline { font-size: 12px; color: #e65100; }
.item-extra {
    font-size: 12px;
    color: #1976d2;
    margin-top: 2px;
}
.item-status { flex: 1; text-align: right; }
select {
    padding: 6px 10px;
    border-radius: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    background: transparent;
    font-size: 14px;
    outline: none;
    pointer-events: auto;
    color: #333;
}
.total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    font-weight: 600;
    text-align: right;
    pointer-events: none;
}
.payment-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #eee;
    font-size: 14px;
    pointer-events: none;
}
.payment-status { font-weight: 500; }
.payment-status.unpaid { color: #c62828; }
.payment-status.partial { color: #e65100; }
.payment-status.paid { color: #2e7d32; }

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
    padding: 16px;
}
.modal.visible { display: flex; }
.modal-content {
    max-width: 500px;
    width: 100%;
    max-height: 90%;
    overflow-y: auto;
    padding: 24px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 { font-size: 22px; font-weight: 600; }
.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #777;
}
#deletePaymentModal { z-index: 2100; }

/* ===== ДЕТАЛЬНОЕ ОКНО ЗАКАЗА ===== */
.detail-modal-content { max-width: 700px !important; }
.detail-main-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.5);
    border-radius: 16px;
    flex-wrap: wrap;
}
.detail-customer-info {
    flex: 2;
    min-width: 250px;
}
.info-row {
    display: flex;
    margin-bottom: 8px;
    font-size: 14px;
}
.info-label {
    width: 100px;
    color: #666;
    font-weight: 500;
}
.info-value {
    color: #333;
    font-weight: 500;
}
.detail-payment-progress {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.progress-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(#2e7d32 0deg, #f0f0f0 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 5px;
}
.progress-circle::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
}
.progress-text {
    position: relative;
    z-index: 1;
    font-size: 18px;
    font-weight: 600;
    color: #1976d2;
}
.progress-stats {
    width: 100%;
    font-size: 13px;
    color: #555;
}
.progress-stats div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}
.detail-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: rgba(255,255,255,0.5);
    border-radius: 30px;
}
.detail-status-label {
    font-weight: 500;
    color: #555;
}
.order-status-badge {
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
}
.order-status-badge.work { background: #fff3e0; color: #e65100; }
.order-status-badge.done { background: #e8f5e8; color: #2e7d32; }
.order-status-badge.partial { background: #fff3e0; color: #e65100; }
.order-status-badge.cancelled { background: #ffebee; color: #c62828; }

.detail-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: rgba(255,255,255,0.5);
    border-radius: 30px;
    padding: 4px;
}
.detail-tab {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}
.detail-tab.active {
    background: #1976d2;
    color: white;
}
.detail-tab-content { display: none; }
.detail-tab-content.active { display: block; }

.items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.items-table th {
    text-align: left;
    padding: 8px 4px;
    border-bottom: 2px solid #1976d2;
    color: #1976d2;
    font-weight: 600;
}
.items-table td {
    padding: 8px 4px;
    border-bottom: 1px solid #eee;
}
.history-list {
    max-height: 300px;
    overflow-y: auto;
}
.history-item {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.history-time {
    color: #777;
    font-size: 11px;
    min-width: 50px;
}
.history-icon {
    font-size: 14px;
    width: 24px;
    text-align: center;
}
.history-text {
    flex: 1;
}
.history-amount {
    font-weight: 600;
    color: #1976d2;
}
.history-note {
    width: 100%;
    color: #666;
    font-size: 11px;
    margin-top: 2px;
}

/* ===== ФАЙЛЫ ===== */
.file-list { margin-top: 16px; }
.file-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: rgba(255,255,255,0.5);
    border-radius: 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.file-item:active { background: rgba(0,0,0,0.05); }
.file-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 20px;
}
.file-icon.image { background: #e3f2fd; color: #1976d2; }
.file-icon.document { background: #fff3e0; color: #e65100; }
.file-icon.archive { background: #e8f5e8; color: #2e7d32; }
.file-info { flex: 1; }
.file-name { font-weight: 500; font-size: 14px; margin-bottom: 2px; }
.file-meta { font-size: 12px; color: #777; }
.file-delete {
    color: #c62828;
    font-size: 20px;
    padding: 8px;
    cursor: pointer;
}
.upload-btn {
    background: linear-gradient(135deg, #1976d2, #0d47a1);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    margin-top: 16px;
    cursor: pointer;
}

/* ===== ПРОСМОТРЩИК ИЗОБРАЖЕНИЙ ===== */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    display: none;
    flex-direction: column;
}
.image-viewer.visible { display: flex; }
.image-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    color: white;
}
.image-viewer-close {
    font-size: 30px;
    cursor: pointer;
    padding: 10px;
}
.image-viewer-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.image-viewer-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.image-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    color: white;
    cursor: pointer;
    padding: 20px;
    user-select: none;
}
.image-viewer-nav.prev { left: 10px; }
.image-viewer-nav.next { right: 10px; }
.image-viewer-counter {
    text-align: center;
    color: white;
    padding: 16px;
}

/* ===== КНОПКИ ===== */
.button {
    background: linear-gradient(135deg, #1976d2, #0d47a1);
    border: none;
    border-radius: 40px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    margin-top: 8px;
    cursor: pointer;
    color: white;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(25, 118, 210, 0.3);
}
.button:hover {
    background: linear-gradient(135deg, #1565c0, #0a3a7a);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(25, 118, 210, 0.4);
}
.button.secondary {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.3);
    color: #333;
    box-shadow: none;
}
.button.secondary:hover {
    background: rgba(255,255,255,0.3);
    transform: none;
}
.button.small { padding: 8px; font-size: 14px; margin-top: 4px; width: auto; }
.button.filter {
    flex: 1;
    margin: 0 4px;
    padding: 10px 0;
    background: rgba(255,255,255,0.2);
    color: #333;
    border: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.button.filter.active {
    background: #1976d2;
    color: white;
}
.button.delete {
    background: linear-gradient(135deg, #c62828, #8e1a1a);
    box-shadow: 0 4px 15px rgba(198, 40, 40, 0.3);
}
.button.delete:hover {
    background: linear-gradient(135deg, #b71c1c, #6d1313);
}
.button.success { background: linear-gradient(135deg, #2e7d32, #1b5e20); }
.button.warning { background: linear-gradient(135deg, #e65100, #bf360c); }

/* ===== ТОВАРЫ ===== */
.product-list {
    padding: 16px;
    margin-bottom: 16px;
}
.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    cursor: pointer;
    transition: background-color 0.1s;
}
.product-item:active { background-color: rgba(0,0,0,0.05); }
.product-item:last-child { border-bottom: none; }
.product-name { font-weight: 500; }
.product-price { color: #1976d2; font-weight: 600; }
.product-group { font-size: 12px; color: #777; margin-top: 2px; }
.product-description { font-size: 12px; color: #777; margin-top: 2px; }
.product-lead-time { font-size: 12px; color: #e65100; margin-top: 2px; }
.add-product-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}
.add-product-form input, .add-product-form select, .add-product-form textarea {
    padding: 10px;
    border-radius: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    font-size: 14px;
    font-family: inherit;
    background: transparent;
    color: #333;
}
.add-product-form .button.small {
    width: auto;
    align-self: flex-end;
    padding: 8px 16px;
}

/* ===== ФОРМЫ ===== */
.form-row { margin-bottom: 12px; }
.form-row label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 14px;
    color: #333;
}
.form-row input, .form-row select, .form-row textarea {
    width: 100%;
    padding: 10px;
    border-radius: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    font-size: 14px;
    font-family: inherit;
    background: transparent;
    color: #333;
}
.form-row textarea { min-height: 60px; resize: vertical; }

.order-items-table-container {
    overflow-x: auto;
    margin: 15px 0;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.3);
}
.order-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 1200px;
}
.order-items-table th {
    background: #1976d2;
    color: white;
    padding: 10px 6px;
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
}
.order-items-table td {
    padding: 8px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    vertical-align: middle;
}
.order-items-table select,
.order-items-table input {
    width: 100%;
    padding: 6px 8px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    background: transparent;
    font-size: 13px;
    box-sizing: border-box;
    color: #333;
}
.order-items-table optgroup {
    font-weight: 600;
    color: #1976d2;
}
.item-action-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}
.item-action-btn.copy { color: #1976d2; }
.item-action-btn.delete { color: #c62828; }
.item-action-btn:hover { background: rgba(0,0,0,0.05); }
.order-totals {
    background: rgba(255,255,255,0.5);
    border-radius: 16px;
    padding: 12px 16px;
    margin-top: 16px;
}
.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    margin-bottom: 6px;
}
.total-row.with-discount {
    font-weight: 600;
    color: #2e7d32;
    font-size: 18px;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 6px;
    margin-top: 6px;
}
input.validate-required:invalid,
select.validate-required:invalid {
    border-color: #c62828 !important;
}
.required {
    color: #c62828;
    font-size: 12px;
    margin-left: 2px;
}

/* ===== КЛИЕНТЫ ===== */
.client-card {
    padding: 16px;
    margin-bottom: 16px;
    cursor: pointer;
}
.client-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.client-name { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.client-phone { color: #1976d2; margin-bottom: 8px; }
.client-extra { font-size: 13px; color: #777; margin-bottom: 8px; }
.client-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #555;
}
.client-stats .debt {
    color: #c62828;
    font-weight: 600;
}
.client-order-item {
    background: rgba(255,255,255,0.5);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 12px;
    cursor: pointer;
}
.client-order-item:active { background: rgba(0,0,0,0.05); }
.client-order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
}
.client-order-total {
    text-align: right;
    color: #1976d2;
    font-weight: 500;
}

/* ===== СКИДКИ ===== */
.discount-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0;
    padding: 8px;
    background: rgba(255,255,255,0.5);
    border-radius: 16px;
}
.discount-input {
    width: 80px;
    padding: 8px;
    border-radius: 20px;
    border: 2px solid #1976d2;
    text-align: center;
    font-size: 14px;
    background: transparent;
    color: #333;
}
.discount-label {
    font-weight: 500;
    color: #1976d2;
}
.total-with-discount {
    font-size: 16px;
    font-weight: 600;
    color: #2e7d32;
}

/* ===== ЗАДАЧИ (ЦЕХ/ДИЗАЙН) ===== */
.execution-item {
    padding: 16px;
    margin-bottom: 16px;
}
.execution-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
}
.execution-order-info {
    font-size: 13px;
    color: #1976d2;
    margin-bottom: 4px;
}
.execution-extra {
    font-size: 13px;
    color: #e65100;
    margin-bottom: 8px;
    background: #fff3e0;
    padding: 4px 8px;
    border-radius: 12px;
}
.execution-deadline {
    color: #e65100;
    font-size: 14px;
    margin-bottom: 8px;
}
.execution-deadline.overdue {
    color: #c62828;
    font-weight: 600;
}
.execution-status { margin-top: 8px; }
.execution-status select { width: 100%; padding: 10px; }
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 4px;
}
.status-work { background: #fff3e0; color: #e65100; }
.status-design { background: #e8eaf6; color: #3f51b5; }
.status-design-approval { background: #f3e5f5; color: #9c27b0; }
.status-production { background: #e0f2f1; color: #00796b; }
.status-ready { background: #e8f5e8; color: #2e7d32; }
.status-shipped { background: #e1f5fe; color: #0277bd; }
.status-done { background: #e0e0e0; color: #616161; }
.status-cancelled { background: #ffebee; color: #c62828; }
.status-pending { background: #f5f5f5; color: #9e9e9e; }

.filter-status-btn {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.filter-status-btn.active {
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transform: scale(1.02);
}
.filter-status-all {
    background: #e0e0e0;
    color: #333;
}
.filter-status-all.active {
    background: #1976d2;
    color: white;
}

/* ===== ОТЧЁТЫ ===== */
.report-section {
    padding: 20px;
    margin-bottom: 20px;
}
.report-period {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.report-period select, .report-period input {
    padding: 10px;
    border-radius: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    background: transparent;
    font-size: 14px;
    color: #333;
}
.report-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}
.report-card {
    background: rgba(255,255,255,0.5);
    border-radius: 16px;
    padding: 15px;
    text-align: center;
}
.report-card .label {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}
.report-card .value {
    font-size: 24px;
    font-weight: 600;
    color: #1976d2;
}
.report-card .value.small {
    font-size: 18px;
}
.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.report-table th {
    background: #1976d2;
    color: white;
    padding: 10px;
    text-align: left;
}
.report-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

/* ===== ПОДВАЛ ===== */
.footer { text-align: center; color: rgba(255,255,255,0.6); font-size: 12px; margin-top: 40px; }

/* ===== ТОСТЫ ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 350px;
    width: 100%;
}
.toast {
    padding: 16px 20px;
    border-radius: 30px;
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 5px solid;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}
.toast.success {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    color: #1b5e20;
    border-left-color: #2e7d32;
}
.toast.error {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #b71c1c;
    border-left-color: #c62828;
}
.toast.warning {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #bf360c;
    border-left-color: #e65100;
}
.toast.info {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #0d47a1;
    border-left-color: #1976d2;
}
.toast-icon { font-size: 24px; min-width: 30px; text-align: center; }
.toast-message { flex: 1; line-height: 1.4; }
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: rgba(255,255,255,0.5);
    border-radius: 0 0 0 10px;
    animation: toastProgress 3s linear forwards;
}
.toast.fade-out { animation: toastFadeOut 0.3s ease forwards; }

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastFadeOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}
@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ===== ПУСТЫЕ СОСТОЯНИЯ ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin: 20px 0;
}
.empty-state-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.7; }
.empty-state-title { font-size: 20px; font-weight: 600; color: #333; margin-bottom: 8px; }
.empty-state-text { font-size: 14px; color: #777; margin-bottom: 24px; }
.empty-state .button { width: auto; padding: 12px 24px; display: inline-block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ ===== */
.theme-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.theme-toggle:hover { background-color: rgba(0,0,0,0.05); }

/* ===== ТЁМНАЯ ТЕМА ===== */
.dark-theme body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
.dark-theme .user-panel,
.dark-theme .tabs,
.dark-theme .order-card,
.dark-theme .product-list,
.dark-theme .client-card,
.dark-theme .execution-item,
.dark-theme .report-section,
.dark-theme .stats-panel,
.dark-theme .admin-panel,
.dark-theme .modal-content,
.dark-theme .search-section {
    background: rgba(30, 30, 40, 0.9);
    border-color: rgba(255,255,255,0.1);
    color: #f0f0f0;
}
.dark-theme .tabs {
    background: rgba(30,30,40,0.9);
}
.dark-theme .tab {
    color: #aaa;
}
.dark-theme .tab.active {
    background: #1976d2;
    color: white;
}
.dark-theme h1, .dark-theme h2, .dark-theme .info-label, .dark-theme .customer, .dark-theme .order-date {
    color: #f0f0f0;
}
.dark-theme .order-card .customer,
.dark-theme .order-card .order-date {
    color: #bbb;
}
.dark-theme input, .dark-theme select, .dark-theme textarea {
    background: transparent !important;
    border-color: rgba(255,255,255,0.2) !important;
    color: #f0f0f0 !important;
}
.dark-theme .button.secondary {
    background: rgba(255,255,255,0.1);
    color: #f0f0f0;
    border-color: rgba(255,255,255,0.2);
}
.dark-theme .progress-circle::before {
    background: #2d2d2d;
}
.dark-theme .detail-main-info,
.dark-theme .detail-status-row,
.dark-theme .order-totals {
    background: rgba(255,255,255,0.1);
}
.dark-theme .order-items-table th {
    background: #1e3a5f;
    color: #bbdefb;
}
.dark-theme .order-items-table td {
    border-bottom-color: #444;
}
.dark-theme .order-items-table select,
.dark-theme .order-items-table input {
    background: transparent;
    border-color: #555;
    color: #f0f0f0;
}
.dark-theme .order-items-table optgroup {
    color: #90caf9;
}
.dark-theme .item-action-btn.copy { color: #90caf9; }
.dark-theme .item-action-btn.delete { color: #ef5350; }
.dark-theme .total-row.with-discount { color: #81c784; border-top-color: #555; }
.dark-theme .history-item { border-bottom-color: #444; color: #e0e0e0; }
.dark-theme .history-time { color: #aaa; }
.dark-theme .history-amount { color: #90caf9; }
.dark-theme .history-note { color: #aaa; }
.dark-theme .status-badge.work { background: #4a2c1a; color: #ffb74d; }
.dark-theme .status-badge.design { background: #1e3a5f; color: #90caf9; }
.dark-theme .status-badge.production { background: #1e4a2a; color: #81c784; }
.dark-theme .status-badge.ready { background: #1b5e20; color: #a5d6a7; }
.dark-theme .status-badge.shipped { background: #0d47a1; color: #bbdefb; }
.dark-theme .status-badge.done { background: #424242; color: #e0e0e0; }
.dark-theme .status-badge.cancelled { background: #4a1a1a; color: #ef9a9a; }
.dark-theme .status-badge.pending { background: #424242; color: #bdbdbd; }
.dark-theme .toast { background: #333; color: #f0f0f0; border: 1px solid #555; }
.dark-theme .toast.success { background: #1b5e20; }
.dark-theme .toast.error { background: #b71c1c; }
.dark-theme .toast.warning { background: #bf360c; }
.dark-theme .toast.info { background: #0d47a1; }
.dark-theme .empty-state { background: #2d2d2d; color: #e0e0e0; }

/* Переключение страниц */
.page { display: none; }
.page.active { display: block; }

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 500px) {
    .order-items-table {
        table-layout: fixed;
        min-width: 1200px;
        width: auto;
        font-size: 12px;
    }
    .order-items-table th:nth-child(1) { width: 300px; }
    .order-items-table th:nth-child(2) { width: 80px; }
    .order-items-table th:nth-child(3) { width: 80px; }
    .order-items-table th:nth-child(4) { width: 100px; }
    .order-items-table th:nth-child(5) { width: 100px; }
    .order-items-table th:nth-child(6) { width: 100px; }
    .order-items-table th:nth-child(7) { width: 150px; }
    .order-items-table th:nth-child(8) { width: 200px; }
    .order-items-table th:nth-child(9) { width: 60px; }
    .order-items-table th,
    .order-items-table td {
        white-space: nowrap;
        padding: 6px 4px;
    }
    .order-items-table th:nth-child(2),
    .order-items-table td:nth-child(2),
    .order-items-table th:nth-child(4),
    .order-items-table td:nth-child(4),
    .order-items-table th:nth-child(5),
    .order-items-table td:nth-child(5) {
        display: table-cell;
    }
    .detail-tabs { flex-wrap: wrap; }
    .detail-tab { flex: 1 0 30%; font-size: 12px; padding: 8px 2px; }
    .detail-main-info { flex-direction: column; }
    .detail-payment-progress { align-items: flex-start; }
    .detail-actions { flex-wrap: wrap; }
    .detail-actions .button { flex: 1 0 45%; margin: 2px; }
    .order-items-table-container { overflow-x: auto; }
    .client-stats { flex-wrap: wrap; gap: 8px; }
    .client-stats span { flex: 1 0 40%; }
}

/* Стили для полей ширины/высоты в форме заказа */
.product-row-dimensions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.product-row-dimensions input {
    flex: 1;
    min-width: 80px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white;
    font-size: 13px;
}
.product-row-dimensions select {
    width: 80px;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white;
    font-size: 13px;
}
.dark-theme .product-row-dimensions input,
.dark-theme .product-row-dimensions select {
    background: #3d3d3d;
    border-color: #555;
    color: #f0f0f0;
}

.expenses-list { margin-top: 8px; }
.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px;
    border-bottom: 1px solid #eee;
    gap: 8px;
    flex-wrap: wrap;
}
.expense-item:last-child { border-bottom: none; }
.expense-date { font-size: 12px; color: #777; min-width: 90px; }
.expense-category { font-weight: 500; min-width: 100px; }
.expense-amount { font-weight: 600; color: #c62828; }
.expense-description { flex: 1; color: #555; font-size: 13px; }
.expense-actions { white-space: nowrap; }
.expense-actions button { background: none; border: none; cursor: pointer; font-size: 14px; margin-left: 8px; }
.dark-theme .expense-item { border-bottom-color: #444; }
.dark-theme .expense-date { color: #aaa; }
.dark-theme .expense-description { color: #ccc; }

.profit-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}
.summary-card {
    background: rgba(255,255,255,0.5);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(5px);
}
.summary-card.profit {
    background: rgba(46, 125, 50, 0.2);
    border: 1px solid #2e7d32;
}
.summary-label { font-size: 14px; color: #666; margin-bottom: 8px; }
.summary-value { font-size: 28px; font-weight: 600; color: #1976d2; }
.profit-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,0.9);
    border-radius: 16px;
    overflow: hidden;
}
.profit-table th, .profit-table td { padding: 12px; text-align: left; border-bottom: 1px solid #eee; }
.profit-table th { background: #1976d2; color: white; }
.profit-positive { color: #2e7d32; font-weight: 600; }
.profit-negative { color: #c62828; font-weight: 600; }
.dark-theme .profit-table { background: rgba(30,30,40,0.9); }
.dark-theme .profit-table td { border-bottom-color: #444; }

.financials-stats {
    background: rgba(255,255,255,0.5);
    border-radius: 16px;
    padding: 16px;
    margin: 8px 0;
}
.financials-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}
.financials-item:last-child { border-bottom: none; }
.financials-item .label { font-weight: 500; }
.financials-item .value { font-weight: 600; }
.financials-item.profit .value { color: #2e7d32; }
.financials-item.profit .value.negative { color: #c62828; }
.financials-note { margin-top: 12px; font-size: 12px; color: #777; }
.dark-theme .financials-stats { background: rgba(255,255,255,0.1); }
.dark-theme .financials-item { border-bottom-color: rgba(255,255,255,0.2); }
.dark-theme .financials-note { color: #aaa; }

.subitem-row td:first-child { padding-left: 20px !important; }
.group-total-row { background: #f8f9fa; font-weight: 600; }
.dark-theme .group-total-row { background: #2d2d2d; }

.item-select {
    padding: 6px 10px;
    border-radius: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    background: transparent;
    font-size: 14px;
    outline: none;
    pointer-events: auto;
    color: #333;
    font-weight: 500;
    transition: all 0.2s;
}
.item-select.status-pending { background: #f5f5f5; color: #9e9e9e; border-color: #e0e0e0; }
.item-select.status-work { background: #fff3e0; color: #e65100; border-color: #ffe0b2; }
.item-select.status-design { background: #e8eaf6; color: #3f51b5; border-color: #c5cae9; }
.item-select.status-design-approval { background: #f3e5f5; color: #9c27b0; border-color: #e1bee7; }
.item-select.status-production { background: #e0f2f1; color: #00796b; border-color: #b2dfdb; }
.item-select.status-ready { background: #e8f5e8; color: #2e7d32; border-color: #c8e6c9; }
.item-select.status-shipped { background: #e1f5fe; color: #0277bd; border-color: #b3e5fc; }
.item-select.status-done { background: #e0e0e0; color: #616161; border-color: #d0d0d0; }
.item-select.status-cancelled { background: #ffebee; color: #c62828; border-color: #ffcdd2; }
.item-select.status-design-approved { background: #e8eaf6; color: #3f51b5; border-color: #c5cae9; }
.item-select.status-manufactured { background: #e0f2f1; color: #00796b; border-color: #b2dfdb; }
.dark-theme .item-select { background: transparent; color: #f0f0f0; border-color: #555; }
.dark-theme .item-select.status-pending { background: #424242; color: #bdbdbd; }
.dark-theme .item-select.status-work { background: #4a2c1a; color: #ffb74d; }
.dark-theme .item-select.status-design { background: #1e3a5f; color: #90caf9; }
.dark-theme .item-select.status-production { background: #1e4a2a; color: #81c784; }
.dark-theme .item-select.status-ready { background: #1b5e20; color: #a5d6a7; }
.dark-theme .item-select.status-shipped { background: #0d47a1; color: #bbdefb; }
.dark-theme .item-select.status-done { background: #424242; color: #e0e0e0; }
.dark-theme .item-select.status-cancelled { background: #4a1a1a; color: #ef9a9a; }
.dark-theme .item-select.status-design-approved { background: #1e3a5f; color: #90caf9; }
.dark-theme .item-select.status-manufactured { background: #1e4a2a; color: #81c784; }

.order-card .item-select.status-pending,
.order-card .item-select.status-work,
.order-card .item-select.status-design,
.order-card .item-select.status-design-approval,
.order-card .item-select.status-design-approved,
.order-card .item-select.status-production,
.order-card .item-select.status-manufactured,
.order-card .item-select.status-ready,
.order-card .item-select.status-shipped,
.order-card .item-select.status-done,
.order-card .item-select.status-cancelled {
    border-width: 2px;
    font-weight: 500;
}
.order-card .item-select.status-pending { background: #f5f5f5; color: #9e9e9e; border-color: #e0e0e0; }
.order-card .item-select.status-work { background: #fff3e0; color: #e65100; border-color: #ffe0b2; }
.order-card .item-select.status-design { background: #e8eaf6; color: #3f51b5; border-color: #c5cae9; }
.order-card .item-select.status-design-approval { background: #f3e5f5; color: #9c27b0; border-color: #e1bee7; }
.order-card .item-select.status-design-approved { background: #e8eaf6; color: #3f51b5; border-color: #c5cae9; }
.order-card .item-select.status-production { background: #e0f2f1; color: #00796b; border-color: #b2dfdb; }
.order-card .item-select.status-manufactured { background: #e0f2f1; color: #00796b; border-color: #b2dfdb; }
.order-card .item-select.status-ready { background: #e8f5e8; color: #2e7d32; border-color: #c8e6c9; }
.order-card .item-select.status-shipped { background: #e1f5fe; color: #0277bd; border-color: #b3e5fc; }
.order-card .item-select.status-done { background: #e0e0e0; color: #616161; border-color: #d0d0d0; }
.order-card .item-select.status-cancelled { background: #ffebee; color: #c62828; border-color: #ffcdd2; }
.dark-theme .order-card .item-select.status-pending { background: #424242; color: #bdbdbd; }
.dark-theme .order-card .item-select.status-work { background: #4a2c1a; color: #ffb74d; }
.dark-theme .order-card .item-select.status-design { background: #1e3a5f; color: #90caf9; }
.dark-theme .order-card .item-select.status-design-approval { background: #4a2c4a; color: #ce93d8; }
.dark-theme .order-card .item-select.status-production { background: #1e4a2a; color: #81c784; }
.dark-theme .order-card .item-select.status-manufactured { background: #1e4a2a; color: #81c784; }
.dark-theme .order-card .item-select.status-ready { background: #1b5e20; color: #a5d6a7; }
.dark-theme .order-card .item-select.status-shipped { background: #0d47a1; color: #bbdefb; }
.dark-theme .order-card .item-select.status-done { background: #424242; color: #e0e0e0; }
.dark-theme .order-card .item-select.status-cancelled { background: #4a1a1a; color: #ef9a9a; }
.item-select.status-design { background: red !important; color: white !important; }
.order-card .item-select.status-print { background: #ffe0b2; color: #e65100; border-color: #ffcc80; }
.dark-theme .order-card .item-select.status-print { background: #4a2c1a; color: #ffb74d; }
select option { background: #f5f5f5; color: #333; padding: 8px 12px; }
.dark-theme select option { background: #2d2d2d; color: #f0f0f0; }
.history-item.deleted { opacity: 0.7; text-decoration: line-through; }
.payment-deleted-reason { font-size: 11px; color: #c62828; margin-top: 4px; }

/* ===== ЧАТЫ – ФИНАЛЬНАЯ ВЕРСИЯ С ПРОКРУТКОЙ ===== */
.chats-layout {
    display: flex;
    gap: 20px;
    background: rgba(245, 245, 255, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    overflow: hidden;
    min-height: 500px;
    height: calc(100vh - 200px); /* фиксированная высота для всей области чатов */
}

.chats-list {
    width: 300px;
    background: rgba(245, 245, 255, 0.2);
    border-right: 1px solid rgba(255,255,255,0.2);
    overflow-y: auto;
    max-height: 100%;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}
.chat-item:hover {
    background: rgba(255,255,255,0.1);
}
.chat-item.active {
    background: rgba(25,118,210,0.2);
}
.chat-item-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
}
.chat-item-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.chat-item-info {
    flex: 1;
    min-width: 0;
}
.chat-item-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}
.chat-item-phone {
    font-size: 12px;
    color: #777;
}
.chat-item-last {
    font-size: 12px;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-unread {
    background: #1976d2;
    color: white;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 11px;
    align-self: center;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.2);
    border-radius: 24px;
    overflow: hidden;
    height: 100%;
}

.chat-header {
    flex-shrink: 0;
    padding: 12px 16px;
    background: rgba(255,255,255,0.6);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}
.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.chat-name {
    font-weight: 600;
    font-size: 18px;
    color: #333;
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scroll-behavior: smooth;
    min-height: 0; /* важно для правильной работы flex + overflow */
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-date-divider {
    text-align: center;
    font-size: 12px;
    color: #888;
    margin: 16px 0 8px;
    position: relative;
}
.message-date-divider::before,
.message-date-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: #ddd;
}
.message-date-divider::before { left: 0; }
.message-date-divider::after { right: 0; }

.chat-message {
    display: flex;
    margin-bottom: 4px;
}
.chat-message.outgoing {
    justify-content: flex-end;
}
.message-bubble {
    max-width: 70%;
    background: #e4e6eb;
    border-radius: 18px;
    padding: 8px 12px;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    display: inline-block;
}
.chat-message.outgoing .message-bubble {
    background: #1976d2;
    color: white;
}
.message-text {
    font-size: 14px;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}
.message-attachment {
    margin-top: 6px;
}
.message-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 12px;
    cursor: pointer;
}
.message-file {
    display: inline-block;
    background: rgba(0,0,0,0.1);
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    text-decoration: none;
    color: inherit;
}
.message-time {
    display: block;
    text-align: right;
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
}

.chat-input-area {
    flex-shrink: 0;
    padding: 12px;
    background: rgba(255,255,255,0.6);
    border-top: 1px solid rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}
#chatInput {
    flex: 1;
    padding: 8px;
    border-radius: 20px;
    border: 1px solid #ccc;
    resize: vertical;
    background: rgba(255,255,255,0.8);
}
#sendChatBtn {
    width: auto;
    padding: 8px 16px;
    margin-top: 0;
}
#attachFileBtn {
    width: auto;
    padding: 8px 12px;
    font-size: 18px;
}

.custom-context-menu {
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    overflow: hidden;
    z-index: 10000;
}
.custom-context-menu .context-menu-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s;
}
.custom-context-menu .context-menu-item:hover {
    background: #f0f0f0;
}

/* Тёмная тема */
.dark-theme .chats-layout {
    background: rgba(30,30,40,0.9);
}
.dark-theme .chats-list {
    background: rgba(30,30,40,0.5);
    border-right-color: rgba(255,255,255,0.1);
}
.dark-theme .chat-item {
    border-bottom-color: rgba(255,255,255,0.1);
}
.dark-theme .chat-item:hover {
    background: rgba(255,255,255,0.1);
}
.dark-theme .chat-item.active {
    background: rgba(25,118,210,0.3);
}
.dark-theme .chat-item-name {
    color: #f0f0f0;
}
.dark-theme .chat-item-phone,
.dark-theme .chat-item-last {
    color: #aaa;
}
.dark-theme .chat-area {
    background: rgba(30,30,40,0.5);
}
.dark-theme .chat-header {
    background: rgba(30,30,40,0.8);
    border-bottom-color: rgba(255,255,255,0.1);
}
.dark-theme .chat-name {
    color: #f0f0f0;
}
.dark-theme .message-bubble {
    background: #3a3a3a;
    color: #f0f0f0;
}
.dark-theme .chat-message.outgoing .message-bubble {
    background: #0d47a1;
}
.dark-theme .message-date-divider {
    color: #aaa;
}
.dark-theme .message-date-divider::before,
.dark-theme .message-date-divider::after {
    background: #555;
}
.dark-theme .chat-input-area {
    background: rgba(30,30,40,0.8);
    border-top-color: rgba(255,255,255,0.1);
}
.dark-theme #chatInput {
    background: rgba(30,30,40,0.9);
    border-color: #555;
    color: #f0f0f0;
}
.dark-theme .custom-context-menu {
    background: #2d2d2d;
    border-color: #555;
    color: #f0f0f0;
}
.dark-theme .custom-context-menu .context-menu-item:hover {
    background: #3a3a3a;
}