/* ========================================= */
/* ====== 1. Глобальные переменные и настройки ====== */
/* ========================================= */
:root {
    /* Цвета из первого файла (Приоритет) */
    --primary: #4f46e5;             /* Цвет для графиков (индиго) */
    --primary-hover: #4338ca;
    --dodo-orange: #ff7043;         /* Твой основной оранжевый */
    
    --bg-color: #f3f4f6;            /* Основной фон страниц */
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    
    /* Дополнительные переменные */
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --bg-light: #f9fafb; /* Добавлено из второго файла для мелких элементов */
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Стандартный select (если используется вне дашборда) */
select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: white;
    font-size: 1em;
    transition: 0.3s;
}

select:hover {
    border-color: var(--dodo-orange);
}

/* ========================================= */
/* ====== 2. Хедер и Навигация ====== */
/* ========================================= */
header {
    background: #1e1e1e;
    padding: 1rem 2rem;
    display: flex;
    justify-content: right;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

header .button, .home {
    color: #ffffff;
    padding: 10px;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: color 0.3s ease, transform 0.3s ease;
}

header .button:hover, .home:hover {
    color: var(--dodo-orange);
    transform: translateY(-2px);
}

/* ========================================= */
/* ====== 3. Плавающие кнопки и Модалка ====== */
/* ========================================= */
.bottom-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #f5f5f5, #ffffff);
    border-radius: 50px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.bottom-button:hover {
    background: linear-gradient(135deg, #fafafa, #fdfdfd);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.bottom-button button {
    margin: 5px;
    padding: 10px 22px;
    font-size: 16px;
    border: none;
    border-radius: 150px;
    background: linear-gradient(135deg, #ffffff, #f0f0f0);
    color: #333;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.bottom-button button:hover {
    background: var(--dodo-orange);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-bg {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: #fff;
    width: 90%;
    max-width: 420px;
    padding: 30px;
    border-radius: 14px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.4s ease-out;
}

.close-btn {
    float: right;
    cursor: pointer;
    font-weight: bold;
    font-size: 22px;
    color: #888;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: #111;
}

/* ========================================= */
/* ====== 4. Модули (Legacy Карточки) ====== */
/* ========================================= */
.modules-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 15px;
    margin-top: 20px;
    padding: 0 10px;
}

.module {
    flex: 1 1 47%;
    margin: 5px;
    padding: 15px;
    border-radius: 12px;
    background: linear-gradient(to bottom right, #fafafa, #f0f0f0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.module:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.module-header {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-content {
    font-size: 17px;
    color: #444;
    line-height: 1.5;
}

/* Переключатель Total/Restaurant (Старый стиль) */
.sales-toggle {
    display: flex;
    border: 1px solid #E67E22;
    border-radius: 15px;
    overflow: hidden;
    font-size: 12px;
    line-height: 1;
}

.sales-toggle .toggle-option {
    padding: 5px 10px;
    cursor: pointer;
    background-color: #fff;
    color: #E67E22;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.sales-toggle .toggle-option.active {
    background-color: #E67E22;
    color: #fff;
}

.sales-toggle .toggle-option:not(.active):hover {
    background-color: #FDF2E9;
}

/* Таблицы */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 25px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #ccc;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

th, td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid #eee;
    color: #333;
    font-weight: 600;
}

th {
    background-color: #ffefe6;
    color: var(--dodo-orange);
    text-transform: uppercase;
}

/* ========================================= */
/* ====== 5. ОСНОВНОЙ ДАШБОРД (Dashboard) ====== */
/* ========================================= */

/* Контейнер дашборда (Приоритет: Файл 1) */
.dashboard-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    
    max-width: none;
    width: auto;
    margin: 20px 15px;
    
    border: 1px solid var(--border);
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: var(--text-main);
}

/* Панель управления */
.controls-header {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.control-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* Группа кнопок (Добавлено из Файла 2 для красоты группировки) */
.btn-group {
    background: var(--bg-light);
    padding: 2px;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: inline-flex;
}

/* Элементы управления (Приоритет: Файл 1 + детали из Файла 2) */
.chart-select, .date-btn, .action-btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.chart-select:hover, .date-btn:hover, .action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.date-btn {
    /* Стили для кнопок даты внутри группы */
    border: none;
    background: transparent;
    border-radius: 4px; /* Чуть меньше радиус внутри группы */
}

.date-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Кастомный селект со стрелкой (Приоритет: Файл 1) */
.chart-select {
    min-width: 200px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    appearance: none;
}

/* Инпут выбора диапазона дат (Взято из Файла 2, так как в первом не было) */
.date-range-picker {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    gap: 8px;
}

.date-input {
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-main);
    background: transparent;
    cursor: pointer;
}

.date-separator {
    color: var(--text-muted);
    font-weight: bold;
}

/* Toggle Switch (Приоритет: Файл 1) */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch {
    position: relative;
    width: 36px;
    height: 20px;
    background: #e5e7eb;
    border-radius: 20px;
    transition: 0.3s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

input[type="checkbox"]:checked + .toggle-switch {
    background: var(--primary);
}

input[type="checkbox"]:checked + .toggle-switch::after {
    transform: translateX(16px);
}

/* Секция выбора франшиз (Приоритет: Файл 1) */
#franchiseControls, .unit-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.franchise-btn {
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
    user-select: none;
}

.franchise-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Область графика (Приоритет: Файл 1) */
.graph-container {
    position: relative;
    height: 60vh;
    min-height: 500px;
    width: 100%;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Старые стили графиков */
.graph {
    margin: 15px;
    border-radius: 12px;
    padding: 15px;
    background: linear-gradient(to bottom, #fdfdfd, #f3f3f3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.graph-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
    color: #222;
}

.graph canvas {
    max-height: 800px !important;
}

/* ========================================= */
/* ====== 6. Дополнительные элементы ====== */
/* ========================================= */

/* Отзывы */
#reviewsContainer {
    margin-top: 20px;
}

#reviewsContainer ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 15px;
}

#reviewsContainer li {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#reviewsContainer li:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#reviewsContainer li::before {
    content: "🍕 ";
}

.rating {
    color: var(--dodo-orange);
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

.review-text {
    font-style: italic;
}

/* Камеры */
.cameras {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
    padding: 0 15px;
}

.camera {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.camera:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.camera h2 {
    font-size: 1.1rem;
    color: #444;
    text-align: center;
    margin-bottom: 10px;
}

.iv-v {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 10px;
}

.iv-v iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 10px;
}

/* Меню-карточки */
.menu-container {
    width: 95%;
    max-width: 1100px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    padding: 20px;
    margin: auto;
}

.menu-card {
    background: #fff;
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.menu-card h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #333;
}

.menu-card small {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #666;
}

.controls {
    margin: auto;
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ========================================= */
/* ====== 7. Адаптивность ====== */
/* ========================================= */
@media (max-width: 600px) {
    .module {
        flex: 1 1 100%;
        margin: 10px 0;
    }

    table th {
        font-size: 14px;
        padding: 10px 12px;
    }

    table td {
        font-size: 13px;
        padding: 10px 12px;
    }

    .module-header {
        font-size: 18px;
    }

    .module-content {
        font-size: 15px;
    }
    
    /* Адаптив для дашборда */
    .dashboard-card {
        padding: 16px;
        margin: 10px;
    }
    
    .controls-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .control-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .chart-select {
        width: 100%;
        min-width: unset;
    }
    
    .graph-container {
        height: 400px;
    }
}

/* ========================================= */
/* ====== 8. Анимации ====== */
/* ========================================= */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translate(-50%, -60%); opacity: 0; }
    to { transform: translate(-50%, -50%); opacity: 1; }
}