/* ======================================================= */
/* === БЛОК 1: ОСНОВНІ СТИЛІ САЙТУ === */
/* ======================================================= */
body { font-family: 'Nunito', sans-serif; background-color: #FDF8F0; color: #4A4A4A; line-height: 1.6; }
.accent-text { color: #A7C7E7; }
.card { background-color: #FFFFFF; border-radius: 12px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); transition: all 0.3s ease; }
.card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); }
.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 16px; font-weight: 600; }
.nav-item i { font-size: 28px; }
h2.page-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: #333;
    text-align: center;
}
h3 {
    font-size: 1.7rem !important;
    font-weight: 800 !important;
    color: #2c3e50;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #FFC107;
}
.card .no-style-h3 { font-size: inherit; font-weight: inherit; color: inherit; margin: 0; padding: 0; border: none; }
.breadcrumb { color: #888; font-size: 0.9rem; margin-bottom: 1rem; }
.breadcrumb a { color: #A7C7E7; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.btn {
    background-color: #FFC107;
    color: #333;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease-in-out;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.btn:hover {
    background-color: #FFA000;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.btn:active { transform: scale(0.98); }
.btn-danger { background-color: #ef4444; color: white; }
.btn-danger:hover { background-color: #dc2626; color: white; }
.btn-secondary { background-color: #9ca3af; color: white; }
.btn-secondary:hover { background-color: #6b7280; color: white; }
.btn:disabled { background-color: #ccc; cursor: not-allowed; transform: none; box-shadow: none; }
.input-field { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 8px; }
.modal-overlay { 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; }
.modal-content { background: white; padding: 2rem; border-radius: 12px; max-width: 90%; width: 500px; max-height: 90vh; overflow-y: auto; }
.form-label { display: block; margin-bottom: 0.5rem; font-weight: 600; color: #555; }

/* ======================================================= */
/* === БЛОК 2: СТИЛІ АДМІН-ПАНЕЛІ === */
/* ======================================================= */

.admin-nav-link { 
    display: block; 
    padding: 12px 16px; 
    border-radius: 8px; 
    font-weight: 600; 
    transition: background-color 0.2s; 
}
.admin-nav-link:hover { background-color: #f3f4f6; }
.admin-nav-link.active { background-color: #FFC107; color: #333; }

.tree-node { 
    padding: 8px; 
    border-left: 2px solid #eee; 
    margin-top: 4px; 
    border-radius: 4px; 
}
.tree-node:hover { background-color: #f9f9f9; }
.tree-node-content { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
}
.tree-node-name { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    cursor: default; 
}

.tree-node.inactive-item > .tree-node-content .tree-node-name {
    opacity: 0.6;
    color: #6b7280;
    text-decoration: line-through;
}
.tree-node.inactive-item {
    background-color: #f9fafb;
}

.tree-node-actions {
    visibility: visible !important;
    display: flex;
    align-items: center;
    gap: 8px; 
}

.action-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    transition: background-color 0.2s ease, transform 0.1s ease, color 0.2s ease !important;
    font-size: 1.6rem !important;
    cursor: pointer !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    color: #6b7280;
}
.action-btn:hover {
    background-color: #f0f0f0 !important;
    transform: scale(1.1);
}
.action-btn:active {
    transform: scale(0.95);
}

.action-btn-placeholder {
    display: block;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.action-btn.toggle-active-btn i {
    transition: color 0.2s ease-in-out;
    color: #9ca3af;
}
.action-btn.toggle-active-btn.active i {
    color: #22c55e;
}

a.action-btn, 
.action-btn.edit-node-btn { color: #3b82f6 !important; }
.action-btn.move-node-btn { color: #8b5cf6; }
.action-btn.delete-node-btn { color: #ef4444; }
.action-btn.add-item-to-folder-btn,
.action-btn.add-folder-to-folder-btn { color: #4b5563; }

.actions-header {
    display: flex;
    justify-content: space-between;
    padding: 0 8px;
    margin-bottom: 8px;
    border-bottom: 2px solid #f3f4f6;
}
.actions-header-name {
    flex-grow: 1;
    font-weight: 600;
    color: #6b7280;
    font-size: 0.8rem;
    text-transform: uppercase;
    align-self: center;
}
.actions-header-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}
.action-header-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 30px;
    color: #9ca3af;
    font-size: 1.2rem;
    cursor: help;
}

/* ======================================================= */
/* === БЛОК 3: СТИЛІ ДЛЯ АСИСТЕНТІВ (V11 - ЦЕНТР) === */
/* ======================================================= */

/* --- Вікно чат-асистента (залишається в кутку) --- */
#assistant-window { 
    position: fixed; 
    bottom: 6.5rem;
    right: 1.25rem; 
    width: 350px; 
    max-width: 90vw; 
    height: 500px; 
    max-height: calc(100vh - 8rem); 
    z-index: 998; 
    background: white; 
    border-radius: 16px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    transition: all 0.3s ease-in-out; 
}
#assistant-window.hidden { 
    opacity: 0; 
    transform: translateY(20px); 
    pointer-events: none; 
}
#assistant-header { 
    padding: 1rem; 
    background-color: #f7f7f7; 
    border-bottom: 1px solid #eee; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
#assistant-messages { 
    flex-grow: 1; 
    padding: 1rem; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    gap: 0.75rem; 
}
#assistant-form { 
    padding: 1rem; 
    border-top: 1px solid #eee; 
    display: flex; 
    gap: 0.5rem; 
}

/* --- Плаваюча кнопка чату (залишається в кутку) --- */
#assistant-btn { 
    display: none;
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 999;
    width: 60px;
    height: 60px;
    padding: 0;
    font-size: 1.8rem;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    align-items: center;
    justify-content: center;
    background-color: #FFC107;
    color: #333;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
#assistant-btn.visible {
    display: flex;
}
#assistant-btn:hover {
    transform: scale(1.1);
    background-color: #FFA000;
    color: white;
}

/* --- Хмарка з підказками (ЗМІНЕНО: тепер по центру) --- */
#speech-bubble {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Центрування */
    width: 90vw; /* На мобільних займає 90% ширини */
    max-width: 450px; /* Обмеження ширини на великих екранах */
    z-index: 1001; /* Вище за модальні вікна */
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: all 0.3s ease-out;
    pointer-events: auto;
}
#speech-bubble.hidden {
    opacity: 0;
    transform: translate(-50%, -45%); /* Ефект "зникнення" вгору */
    pointer-events: none;
}
#speech-bubble p {
    margin: 0 0 1rem 0;
    text-align: center;
    font-size: 1.1rem;
}
#speech-bubble .buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}
#speech-bubble .buttons button {
    width: 100%;
    font-weight: 700;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    font-size: 1rem;
}

/* ======================================================= */
/* === БЛОК 4: СТИЛІ ДЛЯ ЧЕК-ЛИСТІВ (ФІНАЛЬНИЙ ДИЗАЙН) === */
/* ======================================================= */

/* "Липкий" прогрес-бар */
.checklist-progress-container {
    position: sticky;
    top: 10px;
    z-index: 10;
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    padding: 4px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.checklist-progress-bar {
    background-color: #FFC107;
    color: #1f2937;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
    transition: width 0.4s ease-in-out;
    border-radius: 6px;
}

/* Заголовок секції */
.section-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}
.section-header:hover { background-color: #f9fafb; }
.section-header .title-text { display: flex; align-items: center; gap: 8px; }
.section-header .toggle-arrow { transition: transform 0.3s ease; }
.section-container.collapsed .toggle-arrow { transform: rotate(-90deg); }
.section-container.collapsed .section-items { display: none; }

/* Пункт чек-листа */
.checklist-item {
    padding: 16px 8px;
    border-top: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}
.checklist-item.item-problem { background-color: #fef2f2; }
.checklist-item .item-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.checklist-item .item-title { display: flex; align-items: center; gap: 12px; }
.checklist-item .item-status-icon { font-size: 1.5rem; width: 24px; text-align: center; }

/* Кольорові іконки статусу */
.item-status-icon.status-yes, .item-status-icon.status-yes-supply { color: #16a34a; }
.item-status-icon.status-no { color: #dc2626; }
.item-status-icon.status-na { color: #6b7280; }
.item-status-icon.status-order { color: #f59e0b; }

/* Новий дизайн кнопок вибору */
.checklist-options-container, .segmented-control {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.checklist-option-btn, .quick-fill-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #f9fafb;
    font-weight: 700;
    font-size: 1rem;
    color: #4b5563;
}
.quick-fill-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
}
.checklist-option-btn input { display: none; }
.checklist-option-btn:hover, .quick-fill-btn:hover { border-color: #d1d5db; }

/* Стилі для вибраної/активної кнопки */
.checklist-option-btn.active, .quick-fill-btn.active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    font-weight: 800 !important;
}
.checklist-option-btn.active.status-yes, .quick-fill-btn[data-fill-value="yes"].active { border-color: #16a34a; background-color: #ecfdf5; color: #065f46; }
.checklist-option-btn.active.status-no, .quick-fill-btn[data-fill-value="no"].active { border-color: #dc2626; background-color: #fef2f2; color: #991b1b; }
.checklist-option-btn.active.status-na, .quick-fill-btn[data-fill-value="na"].active { border-color: #6b7280; background-color: #f3f4f6; color: #374151; }
.checklist-option-btn.active.status-order, .quick-fill-btn[data-fill-value="Замовити"].active { border-color: #f59e0b; background-color: #fffbeb; color: #b45309; }
.checklist-option-btn.active.status-yes-supply, .quick-fill-btn[data-fill-value="Достатньо"].active { border-color: #16a34a; background-color: #ecfdf5; color: #065f46; }

/* Адаптивність для мобільних */
@media (max-width: 640px) {
    .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}