/* --- СТИЛИ ЗУБНОЙ ФОРМУЛЫ И КОНСТРУКТОРА (СОХРАНЕНО ПОЛНОСТЬЮ - 87 СТРОК) --- */
.tooth-formula { display: flex; flex-direction: column; gap: 15px; align-items: center; padding: 5px; }
.jaw-row { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.jaw-quadrant { display: flex; gap: 2px; align-items: center; }
.tooth-cell {
    width: 30px; height: 30px; border: 1px solid rgba(255,255,255,0.3);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 0.75rem; font-weight: bold; border-radius: 4px;
    background: rgba(255,255,255,0.08); color: #ffffff; transition: 0.2s;
}
.tooth-cell.support { background-color: #dc3545 !important; }
.tooth-cell.pontic { background-color: #28a745 !important; }
.tooth-cell.cantilever { background-color: #ffc107 !important; color: black !important; }
.bridge-link { width: 8px; height: 8px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2); margin: 0 -2px; z-index: 1; background: #222; }
.bridge-link.active { background-color: #0d6efd !important; box-shadow: 0 0 5px #0d6efd; }

.constructor-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; }
.tool-btn { padding: 8px 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.4); background: rgba(255,255,255,0.1); color: #ffffff; font-size: 0.85rem; transition: 0.3s; }
.tool-btn.active { border-color: #8A2BE2; background: #8A2BE2; box-shadow: 0 0 10px rgba(138,43,226,0.5); }

@media (max-width: 400px) { .tooth-cell { width: 26px; height: 26px; font-size: 0.6rem; } .jaw-row { gap: 5px; } }

/* --- ПЛИТКИ КАТЕГОРИЙ (ИСПРАВЛЕНО ЦЕНТРИРОВАНИЕ И ЦВЕТ) --- */
.category-card, .card {
    background: rgba(255, 255, 255, 0.05) !important;
    -webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 16px; color: #ffffff !important;
}
.category-card .icon-box { font-size: 1.8rem; margin-bottom: 10px; color: #8A2BE2; display: flex; justify-content: center; width: 100%; }
.category-card .title { font-size: 0.9rem; font-weight: 600; color: #ffffff !important; width: 100%; text-align: center; }
.category-card .badge-price { position: absolute; top: 8px; right: 8px; font-size: 0.65rem; background: #483D8B; padding: 3px 8px; border-radius: 10px; color: #fff; }

/* ИСПРАВЛЕННЫЕ ЧИПСЫ ФИЛЬТРОВ */
.filter-chip {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #a0a0a0 !important;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
    display: inline-block;
}
.filter-chip.active {
    background: #8A2BE2 !important;
    color: #fff !important;
    border-color: #8A2BE2 !important;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.4);
}

/* --- МОДАЛЬНЫЕ ОКНА (ИСПРАВЛЕНО: НЕПРОЗРАЧНОСТЬ 98%) --- */
.modal-content {
    background-color: rgba(15, 15, 15, 0.98) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    color: #ffffff !important;
}
.modal-backdrop.show { opacity: 0.85 !important; }
.modal-header, .modal-footer { border-color: rgba(255, 255, 255, 0.1) !important; }

/* --- ИНТЕРАКТИВНАЯ КАРТА (ГОРИЗОНТАЛЬНАЯ) --- */
.nav-map { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; padding: 10px 5px; margin: 15px 0; overflow-x: auto; gap: 0; }
.map-step { display: flex; flex-direction: column; align-items: center; position: relative; min-width: 60px; }
.step-icon-circle { width: 34px; height: 34px; border-radius: 50%; background: #111; border: 2px solid #555; display: flex; align-items: center; justify-content: center; font-size: 1rem; color: #ffffff !important; z-index: 2; transition: 0.3s; }
.map-connector { flex-grow: 1; height: 2px; background: #444; min-width: 15px; margin-top: -15px; z-index: 1; }

.step-DONE .step-icon-circle { border-color: #00FF7F !important; background: #00FF7F !important; color: #000 !important; }
.step-IN_PROGRESS .step-icon-circle { border-color: #8A2BE2 !important; color: #8A2BE2 !important; box-shadow: 0 0 8px #8A2BE2; }
.step-READY .step-icon-circle { border-color: #0d6efd !important; color: #0d6efd !important; }
.step-PAUSED .step-icon-circle { border-color: #fd7e14 !important; color: #fd7e14 !important; }

/* --- ОКОННЫЙ РЕЖИМ И ТЕКСТ --- */
.search-box { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 12px; padding: 10px 15px; color: #ffffff; width: 100%; }
.text-muted { color: #cccccc !important; }

.scroll-window { height: calc(100vh - 210px); overflow-y: auto; padding-bottom: 30px; }
.task-card { border-left: 5px solid #444 !important; background: rgba(255, 255, 255, 0.04) !important; }
.overdue-red { border-left-color: #dc3545 !important; background: rgba(220, 53, 69, 0.15) !important; }
.urgent-yellow { border-left-color: #ffc107 !important; background: rgba(255, 193, 7, 0.15) !important; }

.history-log-container { background: #000; border-radius: 10px; padding: 12px; margin-top: 10px; font-size: 0.8rem; border: 1px solid #333; }
.history-item { border-bottom: 1px solid #222; padding: 6px 0; display: flex; justify-content: space-between; color: #eee !important; }

.attachment-link { display: inline-flex; align-items: center; gap: 6px; background: rgba(0, 255, 127, 0.1); color: #00FF7F !important; padding: 6px 12px; border-radius: 10px; font-size: 0.75rem; text-decoration: none; border: 1px solid rgba(0, 255, 127, 0.3); }

/* --- ФИКСЫ ДЛЯ ПАНЕЛИ УПРАВЛЕНИЯ ЛАБОЙ (НОВОЕ) --- */
.lab-admin-card { background: rgba(138, 43, 226, 0.05) !important; border: 1px solid #8A2BE2 !important; border-left: 5px solid #8A2BE2 !important; }

@keyframes highlight-glow {
    0% { 
        outline: 0px solid rgba(255, 255, 255, 0); 
        box-shadow: 0 0 0 rgba(255, 255, 255, 0);
        transform: scale(1);
    }
    15% { 
        outline: 4px solid rgba(255, 255, 255, 1); 
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.6);
        transform: scale(1.03); /* Плитка "прыгает" на пользователя */
    }
    100% { 
        outline: 2px solid rgba(255, 255, 255, 0); 
        box-shadow: 0 0 0 rgba(255, 255, 255, 0);
        transform: scale(1);
    }
}

.flash-highlight-glowing {
    position: relative; 
    overflow: hidden;
    z-index: 100 !important;
    /* Сразу задаем границу, которая плавно исчезнет через transition */
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    transition: border 1.5s ease, box-shadow 1.5s ease; 
}
/* Эффект стеклянного блика (бегающая полоска) */
.flash-highlight-glowing::after {
    content: ""; position: absolute; top: -50%; left: -150%; width: 200%; height: 200%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0) 100%);
    transform: rotate(30deg);
    /* animation-iteration-count: 1 (последняя цифра) */
    animation: glass-shimmer 1.5s ease-in-out 1 forwards; 
}
@keyframes glass-shimmer {
    0% { left: -150%; }
    100% { left: 150%; }
}
/* Вспышка самой плитки */
@keyframes tile-pulse {
    0% { background-color: transparent; }
    20% { background-color: rgba(255, 255, 255, 0.15); transform: scale(1.03); }
    100% { background-color: transparent; transform: scale(1); }
}
.tile-blink {
    animation: tile-pulse 1s ease-out forwards;
}


/* Искры (кубики) */
.spark-cube {
    position: absolute;
    width: 5px;
    height: 5px;
    background: #ffffff;
    box-shadow: 0 0 15px #ffffff;
    pointer-events: none;
    z-index: 10001;
}

@keyframes spark-fly {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) rotate(360deg); opacity: 0; }
}

@keyframes border-surge {
    0% { border: 2px solid transparent; box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); transform: scale(1); }
    15% { border: 3px solid #ffffff !important; box-shadow: 0 0 40px 10px rgba(255, 255, 255, 1); transform: scale(1.03); }
    100% { border: 1px solid rgba(255, 255, 255, 0.2); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); transform: scale(1); }
}

#twa-debug-log {
    position: fixed; top: 10px; left: 10px; right: 10px; 
    background: rgba(0,0,0,0.85); color: #00ff00; font-family: monospace; 
    font-size: 10px; padding: 10px; border-radius: 8px; z-index: 10000; 
    max-height: 150px; overflow-y: auto; pointer-events: none; border: 1px solid #444;
}

@keyframes highlight-glow-v2 {
    0% { transform: scale(1); border: 2px solid transparent; box-shadow: 0 0 0 0 rgba(255,255,255,0); }
    20% { transform: scale(1.04); border: 3px solid #ffffff !important; box-shadow: 0 0 40px 10px rgba(255,255,255,1); }
    100% { transform: scale(1); border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}


/* Стили для истории изменений */
.history-text b {
    color: #fff;
    font-weight: 600;
}
.history-text span.text-white-50 {
    font-size: 0.9em;
}
/* Отступ для вложенных строк "Было/Стало" */
.history-text {
    font-family: 'Segoe UI', sans-serif;
}

@keyframes badge-blink {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.blink-badge {
    animation: badge-blink 2s infinite ease-in-out;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}

/* Улучшаем кликабельность в канбане */
.kanban-card a:hover .text-white {
    color: #0d6efd !important;
    transition: 0.2s;
}