/* ==========================================================================
   1. БАЗОВЫЕ СТИЛИ (ТВОЯ РОДНАЯ ТЕМНАЯ ТЕМА)
   ========================================================================== */
body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, #020617, #020617 60%, #0f172a);
    color: #e2e8f0;
    min-height: 100vh;
}

/* контейнер */
.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
}

/* ===== МЕНЮ ===== */
.menu {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: rgba(2,6,23,0.9);
    border-bottom: 1px solid #1e293b;
}

.menu a {
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #cbd5f5;
    transition: 0.2s;
}

.menu a:hover {
    background: #1e293b;
}

/* ===== ЗАГОЛОВКИ ===== */
h2 {
    margin-bottom: 15px;
}

h4 {
    margin-bottom: 10px;
    color: #94a3b8;
}

/* ===== ФОРМЫ И КНОПКИ ===== */
form {
    background: rgba(30,41,59,0.6);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

input, select {
    flex: 1;
    min-width: 150px;
    padding: 10px;
    background: #020617;
    border: 1px solid #334155;
    color: white;
    border-radius: 6px;
}

button {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    color: white;
    cursor: pointer;
}

button:hover {
    opacity: 0.85;
}

/* ===== ТАБЛИЦЫ ===== */
table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(30,41,59,0.6);
    border-radius: 12px;
    overflow: hidden;
}

th {
    background: #020617;
    padding: 12px;
    text-align: left;
}

td {
    padding: 10px;
    border-bottom: 1px solid #334155;
}

tr:hover {
    background: rgba(51,65,85,0.5);
}

a {
    color: #38bdf8;
    text-decoration: none;
}


/* ==========================================================================
   2. СТИЛИ ДЛЯ ДРУГИХ СТРАНИЦ (КАНБАН, МАТЕРИАЛЫ)
   ========================================================================== */

/* КАНБАН */
.kanban {
    display: flex;
    gap: 20px;
}

.column {
    flex: 1;
    background: rgba(15,23,42,0.7);
    border: 1px solid #1e293b;
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 300px;
}

.order-card {
    padding: 12px;
    border-radius: 12px;
    cursor: grab;
    transition: 0.2s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}

.dragging {
    opacity: 0.5;
}

.top {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 6px;
}

.title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
}

.money {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 10px;
}

.profit { color: #22c55e; }
.loss { color: #ef4444; }

.actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.actions a { font-size: 16px; }

.mini-progress {
    height: 4px;
    background: #020617;
    border-radius: 4px;
    margin: 6px 0;
    overflow: hidden;
}
.mini-bar {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.qty-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 8px;
}
.qty-row input {
    width: 50px;
    padding: 3px;
    font-size: 12px;
}

/* МАТЕРИАЛЫ */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.material-card {
    padding: 12px;
    border-radius: 14px;
    background: rgba(30,41,59,0.8);
}

.mat-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
}

.stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress {
    height: 8px;
    background: #020617;
    border-radius: 6px;
    overflow: hidden;
}

.bar {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #4ade80);
}

.price-form, .adjust-form {
    display: flex;
    gap: 8px;
}
.price-form input, .adjust-form input { flex: 1; padding: 6px; }

.delete-btn {
    margin-top: 5px;
    display: inline-block;
    color: #ef4444;
}

.edit { display: none; width: 80px; }
.editing .view { display: none; }
.editing .edit { display: inline-block; }
.save-btn { display: none; }
.editing .save-btn { display: inline-block; }

.lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center; justify-content: center;
    z-index: 9999;
}
.lightbox img { max-width: 80%; max-height: 80%; border-radius: 12px; }

.material { font-size: 12px; opacity: 0.7; margin-bottom: 6px; }

.qty-btn {
    width: 70px; height: 50px; border-radius: 8px; border: none;
    cursor: pointer; font-size: 18px; background: #0f172a; color: white;
}
.qty-btn:hover { background: #1e293b; }
.qty-value { min-width: 70px; text-align: center; font-size: 15px; font-weight: 600; }


/* ==========================================================================
   3. ПРОКАЧАННЫЕ СТИЛИ ДЛЯ ОБНОВЛЕННОГО ДАШБОРДА
   ========================================================================== */

/* Верхняя панель дашборда */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.dash-header h2 { margin: 0; }

/* Календарь переключения месяца */
.month-bar-clean {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}
.month-bar-clean input[type="month"] {
    background: #0f172a;
    border: 1px solid #1e293b;
    padding: 8px 12px;
    border-radius: 8px;
    color: #e2e8f0;
    cursor: pointer;
}

/* Сетки */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.dash-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Карточки */
.dash-card {
    background: #0f172a;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #1e293b;
}

.dash-card .label {
    font-size: 13px;
    color: #94a3b8;
}

.dash-card .value {
    font-size: 24px;
    font-weight: 600;
    margin-top: 6px;
}

.dash-card .currency, .dash-card .unit {
    font-size: 14px;
    color: #64748b;
    font-weight: normal;
}

/* Акцент на прибыль */
.text-success {
    color: #10b981 !important;
}

/* Карточка долгов */
.dash-card.danger {
    background: #2d0606 !important;
    border: 1px solid #7f1d1d !important;
}
.dash-card.danger .label { color: #fca5a5; }
.dash-card.danger .value { color: #ef4444; }

/* Нижние контент-блоки */
.block {
    background: #0f172a;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid #1e293b;
}

/* Строки списков */
.style-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 !important;
    border-bottom: 1px solid rgba(30, 41, 59, 0.7) !important;
}
.style-row:last-child {
    border-bottom: none !important;
}

.order-title {
    font-weight: 500;
    color: #f1f5f9;
}

.client-subtext {
    color: #64748b;
    font-size: 12px;
    margin-top: 2px;
}

.row-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.price-text {
    font-size: 14px;
    color: #cbd5e1;
}

/* Аккуратные бэджи для статусов */
.badge {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-done { 
    background: rgba(16, 185, 129, 0.1); 
    color: #10b981; 
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.status-work { 
    background: rgba(245, 158, 11, 0.1); 
    color: #f59e0b; 
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.count-badge { 
    background: #1e293b; 
    color: #94a3b8; 
    border: 1px solid #334155;
}

/* Подвал статистики */
.alltime {
    margin-top: 25px;
    font-size: 14px;
    color: #94a3b8;
    padding: 15px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: 10px;
    border: 1px solid #1e293b;
}
.alltime strong { color: #f1f5f9; }

/* ==========================================================================
   4. ГЛОБАЛЬНАЯ ПЕРЕРАБОТКА ДАШБОРДА (ГЛУБОКИЙ UX/UI)
   ========================================================================== */

.subtitle {
    color: #64748b;
    font-size: 14px;
    margin: 4px 0 0 0;
}

/* Дополнительная инфо-строка внизу главных карточек */
.card-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.04);
    font-size: 12px;
    color: #64748b;
}

/* Цветовые акценты для карточек, чтобы они не сливались */
.card-accent-blue {
    border-left: 3px solid #3b82f6 !important;
}
.card-accent-green {
    border-left: 3px solid #10b981 !important;
}

/* Изменение логики карточки критического долга */
.dash-card.danger {
    background: #1c0a0a !important;
    border: 1px solid #991b1b !important;
    border-left: 3px solid #ef4444 !important;
}
.text-danger {
    color: #f87171 !important;
}

/* Блок воронки / статусов производства */
.status-overview-block {
    margin-bottom: 25px;
}
.status-pills-container {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}
.status-pill-item {
    flex: 1;
    min-width: 140px;
    background: #0b1120;
    border: 1px solid #1e293b;
    padding: 12px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.status-pill-item .pill-label {
    font-size: 12px;
    color: #64748b;
}
.status-pill-item .pill-val {
    font-size: 20px;
    font-weight: 600;
    color: #cbd5e1;
}

/* Специфические цвета для элементов воронки */
.item-work { border-bottom: 2px solid #f59e0b; }
.item-done { border-bottom: 2px solid #10b981; }
.item-cancel { border-bottom: 2px solid #ef4444; }

/* Заголовки блоков с элементами флекса */
.block-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.block-header-flex h4 { margin: 0; }

.alert-badge {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Интерактивные строки списка */
.actionable-row {
    transition: background 0.2s ease;
}
.actionable-row:hover {
    background: rgba(30, 41, 59, 0.3);
}

.order-link-title {
    color: #f1f5f9;
    text-decoration: none;
    transition: color 0.1s;
}
.order-link-title:hover {
    color: #38bdf8;
}

.client-name-bold {
    font-weight: 600;
    color: #f1f5f9;
}

.date-subtext {
    font-size: 11px;
    color: #475569;
}

/* Состояние пустых списков */
.empty-state {
    padding: 30px 10px;
    text-align: center;
    color: #475569;
    font-size: 14px;
    border: 1px dashed #1e293b;
    border-radius: 8px;
}

/* ==========================================================================
   5. ДИЗАЙН КАНБАН-ДОСКИ (СТИЛЬНЫЙ ТЕМНЫЙ ИНТЕРФЕЙС)
   ========================================================================== */

/* Шапка колонки со счетчиком */
.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.column-header h4 { margin: 0; color: #cbd5e1; }
.column-count {
    background: #1e293b;
    color: #94a3b8;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.cards-drop-zone {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 400px; /* зона для дропа карточек */
}

/* Базовая карточка — теперь глубокого графитового цвета */
.order-card {
    background: #0f172a !important;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

/* Кастомные аккуратные подсветки статусов сбоку (вместо заливки всей карты) */
.card-status-new {
    border-left: 3px solid #0284c7 !important; /* красивый синий */
}
.card-status-paid {
    border-left: 3px solid #10b981 !important; /* неоновый зеленый */
}
.card-status-unpaid {
    border-left: 3px solid #ef4444 !important; /* долг — красный */
    background: linear-gradient(135deg, #0f172a, #1a0808) !important; /* легкий винный отлив */
}

/* Элементы внутри карточки */
.order-num {
    color: #64748b;
    font-weight: bold;
    font-size: 12px;
}
.client-tag {
    background: #1e293b;
    color: #cbd5e1;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}
.material-tag {
    font-size: 12px;
    color: #94a3b8;
    background: rgba(2, 6, 23, 0.4);
    padding: 6px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.02);
}

/* Кнопки плюс-минус */
.kanban-qty-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    transition: 0.15s;
}
.kanban-qty-btn:hover {
    background: #334155;
    color: #38bdf8;
}

/* Сетка денег внутри карточки */
.kanban-money-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: #020617;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.01);
}
.money-item {
    display: flex;
    flex-direction: column;
}
.money-item .m-label {
    font-size: 10px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.money-item .m-val {
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
    color: #e2e8f0;
}
.color-profit { color: #10b981 !important; }
.color-loss { color: #f87171 !important; }

/* Кнопки действий */
.actions .btn-icon {
    font-size: 13px;
    background: #1e293b;
    padding: 4px 8px;
    border-radius: 6px;
    color: #94a3b8;
    border: 1px solid #334155;
    transition: 0.15s;
}
.actions .btn-icon:hover {
    background: #334155;
    color: white;
}
.actions .payment-trigger {
    font-size: 11px;
    font-weight: 600;
}

/* ==========================================================================
   6. СТИЛИЗАЦИЯ КЛИЕНТСКОЙ БАЗЫ И ТАБЛИЦ
   ========================================================================== */

/* Блок предупреждения / ошибки удаления */
.alert-box {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Выравнивание формы добавления в тон CRM */
.crm-inline-form {
    background: #0f172a !important;
    border: 1px solid #1e293b !important;
    padding: 16px !important;
    border-radius: 12px !important;
    margin-bottom: 25px !important;
}
.crm-inline-form input {
    background: #020617 !important;
    border: 1px solid #334155 !important;
    transition: border-color 0.15s ease;
}
.crm-inline-form input:focus {
    border-color: #38bdf8 !important;
    outline: none;
}
.crm-btn-primary {
    background: linear-gradient(135deg, #2563eb, #4f46e5) !important;
    font-weight: 600;
    padding: 10px 20px !important;
}

/* Оболочка для таблицы (закругление углов) */
.crm-table-wrapper {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Кастомная темная таблица */
.crm-custom-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent !important;
}
.crm-custom-table th {
    background: #020617 !important;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border-bottom: 1px solid #1e293b;
}
.crm-custom-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
    color: #e2e8f0;
    font-size: 14px;
    vertical-align: middle;
}
.crm-custom-table tr:last-child td {
    border-bottom: none;
}
.crm-custom-table tr:hover {
    background: rgba(30, 41, 59, 0.4) !important;
}

/* Контакты-ссылки */
.contact-link {
    text-decoration: none;
    transition: color 0.15s ease;
    font-size: 13.5px;
}
.phone-link { color: #cbd5e1; }
.phone-link:hover { color: #38bdf8; }
.tg-link { color: #38bdf8; }
.tg-link:hover { color: #7dd3fc; }

/* Текстовые хелперы */
.text-muted { color: #475569; font-size: 12px; }
.text-muted-dark { color: #334155; }
.client-table-name { color: #f1f5f9; font-weight: 600; }

/* Значки количества заказов */
.table-orders-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.table-orders-badge.has-orders {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.table-orders-badge.no-orders {
    background: #1e293b;
    color: #64748b;
    border: 1px solid #334155;
}

/* Кнопка удаления в таблице */
.table-action-btn {
    text-decoration: none;
    display: inline-block;
    padding: 6px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.1);
    transition: all 0.15s ease;
}
.table-action-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

/* Пустая таблица */
.table-empty-state {
    text-align: center;
    color: #475569 !important;
    padding: 40px !important;
    font-style: italic;
}

/* ==========================================================================
   7. СКЛАД МАТЕРИАЛОВ: ПРОФЕССИОНАЛЬНАЯ ВИТРИНА
   ========================================================================== */

/* Адаптивная сетка формы */
.flex-form-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 12px !important;
    align-items: center;
}
.file-upload-wrapper {
    background: #020617;
    border: 1px dashed #334155;
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
}
.file-label {
    font-size: 12px;
    color: #94a3b8;
    cursor: pointer;
}
.file-label input { display: none; }

/* Обновленная сетка карточек */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Карточка катушки */
.material-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, border-color 0.2s;
}
.material-card:hover {
    transform: translateY(-2px);
    border-color: #334155;
}

/* Контейнер картинки и бейджа */
.mat-img-container {
    position: relative;
    width: 100%;
    height: 180px;
    background: #020617;
    overflow: hidden;
}
.material-card .mat-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.material-card .mat-img:hover {
    transform: scale(1.04);
}

/* Заглушка, если фото нет */
.mat-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    background: linear-gradient(180deg, #0f172a, #020617);
}
.mat-img-placeholder span { font-size: 40px; }
.mat-img-placeholder small { color: #475569; font-weight: 600; text-transform: uppercase; }

/* Плашка остатка поверх картинки */
.stock-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(2, 6, 23, 0.75);
    backdrop-filter: blur(4px);
    color: #e2e8f0;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.05);
}
.stock-badge.badge-low {
    border-color: #ef4444;
    color: #f87171;
    background: rgba(127, 29, 29, 0.8);
}

/* Текстовые блоки внутри карты */
.mat-card-header { padding: 16px 16px 10px 16px; }
.mat-card-title { margin: 0; font-size: 16px; font-weight: 600; color: #f1f5f9; }
.mat-card-sub { font-size: 12px; color: #64748b; margin-top: 4px; text-transform: uppercase; font-weight: bold; }

.mat-card-form { padding: 0 16px 16px 16px; display: flex; flex-direction: column; flex: 1; }

/* Список параметров */
.stats-box { background: #020617; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.stat-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #94a3b8; }
.stat-row .s-label { color: #64748b; }
.highlight-row { border-top: 1px solid rgba(255,255,255,0.03); padding-top: 6px; margin-top: 2px; }

/* Переключатели режимов инлайна */
.edit-mode { display: none; }
.editing .view-mode { display: none; }
.editing .edit-mode { display: inline-block; }
.input-compact { width: 90px; padding: 4px 6px; background: #0f172a; border: 1px solid #334155; color: white; border-radius: 4px; font-size: 12px; text-align: right; }

/* Кнопка сохранения по умолчанию скрыта */
.btn-save-hidden { display: none !important; }
.editing .btn-save-hidden { display: inline-block !important; padding: 6px 12px !important; font-size: 12px; }

/* Полоса здоровья */
.progress-wrapper { margin: 15px 0; }
.progress-text-flex { display: flex; justify-content: space-between; font-size: 11px; color: #475569; margin-bottom: 4px; font-weight: 500; }
.progress-bar-bg { width: 100%; height: 6px; background: #020617; border-radius: 10px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 10px; transition: width 0.3s ease; }

/* Цвета индикаторов */
.bar-normal { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-warning { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-critical { background: linear-gradient(90deg, #ef4444, #f87171); box-shadow: 0 0 8px rgba(239,68,68,0.4); }

/* Контроллеры */
.mat-card-actions { display: flex; gap: 10px; align-items: center; margin-top: auto; padding-top: 10px; }
.crm-btn-icon { background: #1e293b; border: 1px solid #334155; color: #94a3b8; padding: 6px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; transition: 0.15s; }
.crm-btn-icon:hover { background: #334155; color: white; }
.btn-cancel-style { background: #7f1d1d !important; border-color: #b91c1c !important; color: #fca5a5 !important; }
.crm-btn-delete-link { margin-left: auto; color: #64748b; font-size: 12px; text-decoration: none; transition: color 0.15s; }
.crm-btn-delete-link:hover { color: #ef4444; }

.font-semibold { font-weight: 600; }

/* ==========================================================================
   8. СТИЛИЗАЦИЯ СЛОЖНЫХ МНОГОКОМПОНЕНТНЫХ ФОРМ
   ========================================================================== */

.form-wrapper-clean {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 14px;
    padding: 24px;
    max-width: 850px;
    margin: 20px auto 0 auto;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.crm-main-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

.crm-main-form input, .crm-main-form select {
    background: #020617 !important;
    border: 1px solid #334155 !important;
    color: #f1f5f9 !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    width: 100% !important;
    box-sizing: border-box;
}

.crm-main-form input:focus, .crm-main-form select:focus {
    border-color: #38bdf8 !important;
    outline: none !important;
}

/* Сетки для полей */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* Визуальный разделитель */
.form-divider {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 15px 0;
}

/* Информационные строки для подбора цветов */
.material-row-select {
    background: rgba(2, 6, 23, 0.3);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.01);
}
.alert-row-style {
    border-left: 3px solid #6366f1; /* Индиго маркер для второго цвета */
}

/* Виджет предпросмотра общей стоимости чека */
.budget-preview-box {
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 8px 14px;
    justify-content: center;
}
.live-budget-val {
    font-size: 20px;
    font-weight: 700;
    color: #10b981;
}
.live-budget-val small {
    font-size: 12px;
    color: #475569;
}

/* Кнопка отправки */
.form-actions-bar {
    margin-top: 10px;
    text-align: right;
}
.btn-large-submit {
    width: auto !important;
    padding: 12px 30px !important;
    font-size: 15px !important;
    cursor: pointer;
}

/* Маркеры слотов многоцветной печати */
.alert-row-style-main {
    border-left: 4px solid #0284c7 !important; /* Синий маркер базы */
    background: rgba(2, 84, 199, 0.03) !important;
}
.alert-row-style-sub {
    border-left: 4px solid #a855f7 !important; /* Пурпурный маркер дополнительных цветов (AMS) */
    background: rgba(168, 85, 247, 0.02) !important;
    margin-top: -5px; /* Склеиваем блоки визуально плотнее */
}

/* ==========================================================================
   9. ПРОГРЕСС И СТИЛИ ДЛЯ МНОГОЦВЕТНЫХ КАРТОЧЕК ЗАКАЗА
   ========================================================================== */

/* Плашка принтера */
.order-printer-badge {
    background: #020617;
    border: 1px solid #334155;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 12px;
    display: inline-block;
}

/* Список используемых цветов */
.order-mats-list {
    background: rgba(2, 6, 23, 0.4);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
}
.order-mats-list .mats-title {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}
.mat-color-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #e2e8f0;
    padding: 3px 0;
}
.mat-color-tag .color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 6px currentcolor;
}

/* Контейнер прогресс-бара */
.order-progress-container {
    margin-top: 15px;
}
.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 5px;
}
.progress-labels .pct-num {
    font-weight: bold;
    color: #10b981;
}

/* База прогресс-бара */
.neon-progress-bg {
    width: 100%;
    height: 12px;
    background: #020617;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #1e293b;
    position: relative;
}

/* Анимированное неоновое заполнение */
.neon-progress-fill {
    height: 100%;
    border-radius: 20px;
    /* Градиент от Cyan к Emerald-зеленому */
    background: linear-gradient(90deg, #06b6d4, #10b981, #34d399);
    background-size: 200% 100%;
    position: relative;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    /* Плавное переливание самого градиента */
    animation: gradient-shift 3s ease infinite;
}

/* Бегущий световой блик (эффект свечения) */
.neon-shine-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: neon-wave 2s infinite linear;
}

/* АНИМАЦИИ */
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes neon-wave {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==========================================================================
   10. СТИЛИ ДЛЯ ОБНОВЛЕННОГО ИНТЕРФЕЙСА ДИСПЕТЧЕРА ЗАКАЗОВ
   ========================================================================== */

/* Блок заголовка месяцев */
.month-section {
    margin-bottom: 40px;
}
.month-header-title {
    font-size: 20px;
    color: #f8fafc;
    border-bottom: 2px solid #1e293b;
    padding-bottom: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.month-count {
    font-size: 14px;
    color: #64748b;
    font-weight: normal;
}

/* Сетка карточек */
.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

/* Контейнер карточки */
.order-card-clean {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.order-card-clean:hover {
    transform: translateY(-2px);
    border-color: #334155;
}

/* Верх карточки */
.card-top-flex {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}
.order-num-tag {
    font-size: 11px;
    color: #475569;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.order-card-title {
    margin: 4px 0;
    font-size: 16px;
    color: #f1f5f9;
    font-weight: 600;
}
.order-client-name {
    font-size: 13px;
    color: #38bdf8;
}

/* Статусы-бейджы */
.status-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
}
.status-new { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.status-work { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.status-ready { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.status-done { background: rgba(71, 85, 105, 0.2); color: #94a3b8; }

/* Нижняя финансовая зона */
.card-bottom-area {
    margin-top: 20px;
}
.finance-row-box {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 12px;
    background: #020617;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #1e293b;
}
.profit-color {
    color: #10b981;
}

/* Хэддер-панель Табов-фильтров */
.filter-tabs-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: #020617;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid #1e293b;
    display: inline-flex;
}
.tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tab-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.02);
}
.tab-btn.active {
    background: #1e293b;
    color: #38bdf8;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Цветная точка материалов */
.order-mats-list .mat-color-tag .color-dot {
    width: 6px;
    height: 6px;
    background: #a855f7;
    border-radius: 50%;
    display: inline-block;
}

.empty-state-box {
    text-align: center;
    color: #64748b;
    padding: 50px;
    background: #0f172a;
    border-radius: 12px;
    border: 1px dashed #1e293b;
}

/* ==========================================================================
   11. ИНТЕРАКТИВНЫЕ ЭЛЕМЕНТЫ УПРАВЛЕНИЯ И СТИЛИ РАЗГРАНИЧЕНИЯ КАРТОЧЕК
   ========================================================================== */

/* --- ЦВЕТОВЫЕ МАРКЕРЫ ГРАНИЦ ДЛЯ РАЗДЕЛЕНИЯ СОСТОЯНИЙ --- */
.visual-status-new {
    border-left: 5px solid #eab308 !important; /* Желтый маркер для Новых */
}
.visual-status-work {
    border-left: 5px solid #38bdf8 !important; /* Синий маркер для В работе */
}
.visual-paid-danger {
    border-left: 5px solid #ef4444 !important; /* Красный маркер: Готов, но НЕ ОПЛАЧЕН */
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.05);
}
.visual-paid-success {
    border-left: 5px solid #10b981 !important; /* Зеленый маркер: Готов и ОПЛАЧЕН */
}

/* Кнопка удаления заказа */
.delete-card-btn {
    background: transparent;
    border: none;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s;
    padding: 0;
}
.delete-card-btn:hover {
    opacity: 1;
}

/* Блок инпута брака */
.waste-counter-box {
    margin-top: 12px;
    background: rgba(2, 6, 23, 0.2);
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px dashed #1e293b;
}
.waste-counter-box label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: bold;
}
.waste-counter-box input {
    background: #020617 !important;
    border: 1px solid #1e293b !important;
    color: #ef4444 !important; /* Выделяем брак красным цветом */
    font-weight: bold;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    max-width: 70px;
    text-align: center;
}
.save-waste-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
}

/* Переключатель статуса оплаты */
.pay-toggle-btn {
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.pay-toggle-btn.paid-no {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}
.pay-toggle-btn.paid-no:hover {
    background: rgba(239, 68, 68, 0.3);
}
.pay-toggle-btn.paid-yes {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
.pay-toggle-btn.paid-yes:hover {
    background: rgba(16, 185, 129, 0.3);
}

/* Кнопки прибавления/убавления штук тиража (+ и -) */
.qty-change-btn {
    background: #1e293b;
    border: 1px solid #334155;
    color: #f1f5f9;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.qty-change-btn:hover:not(:disabled) {
    background: #38bdf8;
    border-color: #38bdf8;
    color: #020617;
}
.qty-change-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

/* Кастомизация выпадающего списка периодов */
#global-month-select {
    background: transparent;
    border: none;
    color: #f1f5f9;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    outline: none;
    padding-right: 5px;
}
#global-month-select option {
    background: #0f172a;
    color: #f1f5f9;
}
