/* Файл: style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #1058d0; 
    --primary-hover: #0d4eb8;
    --success: #28a745; 
    --success-grad: linear-gradient(90deg, #2fc6f6 0%, #28a745 100%);
    --warning: #ffc107;
    --danger: #dc3545;
    --bg-color: #f4f7f9;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #6c757d;
    --border-color: #eef2f4;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --border-radius: 8px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* Навигация (Скроллится на мобильных) */
.nav-menu { 
    background: var(--card-bg); 
    padding: 12px 20px; 
    border-bottom: 1px solid #dee2e6; 
    display: flex; 
    gap: 10px; 
    overflow-x: auto; 
    white-space: nowrap; 
    -webkit-overflow-scrolling: touch;
}
.nav-menu a { 
    text-decoration: none; 
    color: var(--text-muted); 
    font-weight: 500; 
    padding: 8px 16px; 
    border-radius: 20px; 
    font-size: 14px; 
    background: #f1f3f5;
    transition: all 0.2s; 
}
.nav-menu a:hover { background: #e2e6ea; color: var(--text-main); }
.nav-menu a.active { background: var(--primary); color: white; }
.nav-menu a.special { background: var(--warning); color: #212529; }

/* Общие контейнеры */
.container { display: flex; gap: 20px; padding: 20px; max-width: 1600px; margin: 0 auto; align-items: flex-start; }
.main-content { flex: 3; min-width: 0; }
.sidebar-content { flex: 1; min-width: 300px; }

/* Формы */
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 20px; align-items: flex-end; }
.grid-form .full-width { grid-column: 1 / -1; }
.grid-form label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }

/* Analytics Dashboard */
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; align-items: start; }
.analytics-card { background: var(--card-bg); border-radius: var(--border-radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--border-color); display: flex; flex-direction: column; }
.analytics-card h3 { margin-top: 0; font-size: 15px; color: var(--text-main); margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid var(--border-color); }
.chart-wrapper { position: relative; height: 300px; width: 100%; flex: 1; }
.analytics-empty { color: var(--text-muted); font-size: 14px; text-align: center; padding: 20px 0; }

/* Карточки и панели */
.card-panel {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

/* Элементы форм */
input[type="text"], input[type="password"], input[type="date"], input[type="number"], input[type="file"], select {
    width: 100%; padding: 10px; border: 1px solid #ced4da; border-radius: 6px; font-size: 14px; font-family: 'Inter', sans-serif; transition: border-color 0.2s;
}
input:focus, select:focus { border-color: var(--primary); outline: none; }

@media (min-width: 993px) {
    input[type="text"], input[type="password"], input[type="date"], input[type="number"], input[type="file"], select {
        max-width: 400px;
    }
}

.form-row { margin-bottom: 15px; }
.form-row label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text-main); }

/* Кнопки */
.btn {
    display: inline-block; text-align: center; text-decoration: none; border: none; padding: 10px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 14px; transition: 0.2s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-danger-outline { background: transparent; border: 1px solid var(--danger); color: var(--danger); }

/* === АДАПТИВНАЯ ТАБЛИЦА === */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}
.table-responsive table {
    width: 100%;
    min-width: 1000px; /* ЖЕСТКОЕ ПРАВИЛО: таблица не сожмется меньше 1000px, появится свайп */
    border-collapse: collapse;
    font-size: 13px;
    background: var(--card-bg);
}
.table-responsive th {
    background: #f8fbfd; padding: 12px 15px; border-bottom: 2px solid var(--border-color); color: var(--text-muted); font-weight: 600; text-align: left; white-space: nowrap;
}
.table-responsive td {
    padding: 12px 15px; border-bottom: 1px solid var(--border-color); vertical-align: middle;
}
.table-responsive tr:hover td { background-color: #f9fbfd; }
.nowrap { white-space: nowrap; }

/* Календарь */
.cal-date-header { font-weight: 600; padding: 10px; margin-top: 15px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; border-radius: 6px; background: #f8fbfd; }
.cal-date-header.today { background: #e8f4fd; color: var(--primary); }
.cal-task-card { background: var(--card-bg); border: 1px solid var(--border-color); border-left-width: 4px; padding: 12px; margin-top: 8px; border-radius: 6px; font-size: 13px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }

/* === ПРАВИЛЬНАЯ АДАПТИВНОСТЬ (МОБИЛЬНАЯ ВЕРСИЯ БЕЗ СКРОЛЛА) === */
@media (max-width: 992px) {
    /* Сброс ширин */
    html, body { overflow-x: hidden; width: 100%; position: relative; }
    .container { flex-direction: column; padding: 10px; width: 100%; box-sizing: border-box; }
    .main-content, .sidebar-content, .card-panel { width: 100%; min-width: auto; padding: 12px; box-sizing: border-box; }
    
    /* Шапка */
    .header-main { flex-direction: column; text-align: center; gap: 12px; padding: 15px; }
    .header-main > div { display: flex; flex-direction: column; gap: 5px; }
    .logout-btn { width: 100%; text-align: center; display: block; box-sizing: border-box; }
    
    /* Фильтры (строго друг под другом) */
    .filter-panel { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
    .filter-group { width: 100%; }
    .filter-group label { margin-bottom: 5px; display: block; }
    .filter-actions { display: flex; gap: 10px; width: 100%; }
    .filter-actions .btn { flex: 1; text-align: center; margin: 0; padding: 10px; }
    
    /* Кнопки создания и сохранения */
    .main-action-btn, .bulk-save-btn { width: 100%; text-align: center; display: block; margin-top: 10px; padding: 12px; }
    .bulk-save-wrapper { display: flex; justify-content: center; margin-bottom: 15px; }
    h2 { text-align: center; width: 100%; margin-bottom: 5px; font-size: 22px !important; }
    
    /* ==================================================== */
    /* МАГИЯ ТАБЛИЦЫ: ПРЕВРАЩЕНИЕ В КАРТОЧКИ (БЕЗ СКРОЛЛА!) */
    /* ==================================================== */
    .table-responsive { overflow: hidden; border: none; }
    .table-responsive table { width: 100%; min-width: 0; background: transparent; }
    
    /* Прячем заголовки столбцов */
    .table-responsive thead { display: none; }
    
    /* Каждая строка становится отдельной белой карточкой */
    .table-responsive tr { 
        display: block; 
        background: var(--card-bg); 
        margin-bottom: 15px; 
        border-radius: var(--border-radius); 
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border: 1px solid var(--border-color);
        padding: 10px;
    }
    
    /* Ячейки идут друг под другом с выравниванием */
    .table-responsive td { 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        padding: 8px 5px;
        border-bottom: 1px solid #f1f3f5;
        text-align: right;
    }
    .table-responsive td:last-child { border-bottom: none; }
    
    /* Автоматически подставляем названия полей слева */
    .table-responsive td::before { 
        content: attr(data-label); 
        font-weight: 600; 
        color: var(--text-muted); 
        text-align: left; 
        flex: 1;
        padding-right: 10px;
    }
    
    /* Поправляем элементы внутри карточек */
    .mobile-select { width: 55% !important; flex: none; text-align: right; }
    .table-responsive td[data-label="Действие"] { display: block; padding-top: 15px; }
    .table-responsive td[data-label="Действие"]::before { display: none; } /* Скрываем слово "Действие" */
    .table-responsive td[data-label="Сводка"] { align-items: flex-end; flex-direction: column; }
    .table-responsive td[data-label="Сводка"]::before { width: 100%; text-align: left; margin-bottom: 5px; }
    
    /* Календарь */
    .calendar-sidebar form > div { flex-direction: column; align-items: stretch; gap: 10px; }
    .calendar-sidebar form input, .calendar-sidebar button { width: 100%; }
}
/* ========================================= */
/* СТИЛИ ДЛЯ КАРТОЧКИ ЗАКАЗА (view_order.php)*/
/* ========================================= */

/* Верхняя навигация "Назад" */
.header-top {
    background: var(--card-bg);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}
.header-top a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s;
}
.header-top a:hover {
    color: var(--primary-hover);
}

/* Сетка карточки заказа */
.main { 
    flex: 3; 
    min-width: 0; 
}
.sidebar { 
    flex: 1; 
    min-width: 300px; 
    background: var(--card-bg); 
    padding: 20px; 
    border-radius: var(--border-radius); 
    box-shadow: var(--shadow); 
    border: 1px solid var(--border-color);
    height: fit-content;
}

/* Шапка инфо о заказе */
.order-info {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* АККОРДЕОНЫ (Сворачивающиеся этапы) */
.accordion-item {
    margin-bottom: 15px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden;
}
.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8fbfd;
    border-bottom: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}
.accordion-header:hover { 
    background: #f1f5f9; 
}
.accordion-header.active { 
    background: #e8f4fd; 
    border-bottom-color: #bee3f8; 
}
.acc-title { 
    font-weight: 600; 
    font-size: 15px; 
    color: var(--text-main); 
    flex: 1; 
}

/* Прогресс-бары внутри этапов */
.acc-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 150px;
    margin-right: 20px;
}
.acc-progress-bg {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}
.acc-progress-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.4s ease;
}
.acc-progress-text { 
    font-size: 12px; 
    font-weight: 700; 
    color: var(--text-muted); 
    width: 35px; 
    text-align: right; 
}
.acc-icon { 
    font-size: 12px; 
    color: var(--text-muted); 
    transition: transform 0.3s; 
}
.accordion-header.active .acc-icon { 
    transform: rotate(180deg); 
}

.accordion-content { 
    padding: 20px; 
    background: var(--card-bg); 
}

/* Формы внутри этапов */
.accordion-content form {
    margin: 0;
}
.btn-save {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.btn-save:hover {
    filter: brightness(1.1);
}

/* Адаптивность для карточки заказа */
@media (max-width: 992px) {
    .main, .sidebar { 
        width: 100%; 
        flex: none; 
    }
    .acc-progress-wrapper { 
        display: none; /* Прячем ползунок прогресса на мобильных, чтобы не ломать верстку */
    }
    .order-info > div {
        flex-direction: column;
    }
}

/* ========================================= */
/* СТИЛИ ШАПКИ И НАВИГАЦИИ (shared) */
/* ========================================= */
.header-main { background: #1c232b; color: #fff; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.logout-btn { color: #fff; text-decoration: none; background: rgba(255,255,255,0.1); padding: 8px 15px; border-radius: 6px; font-size: 13px; font-weight: 600; transition: background 0.2s; }
.logout-btn:hover { background: var(--danger); }
.action-btns { display: flex; gap: 5px; }

/* Примечание: Мобильные стили .header-main уже есть выше в @media (max-width: 992px) */
@media (max-width: 992px) {
    .action-btns { justify-content: flex-end; width: 100%; }
}

/* ========================================= */
/* СТРАНИЦА ВХОДА (login.php) */
/* ========================================= */
.login-page { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    min-height: 100vh; 
    padding: 20px;
    background: #1c232b; 
}
.login-box {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 380px;
}
@media (max-width: 768px) {
    .login-box { padding: 20px; }
}

/* ========================================= */
/* СТРАНИЦА ЗАКАЗА (view_order.php) */
/* ========================================= */
.success-msg { background: #d4edda; color: #155724; padding: 15px; border-radius: 5px; margin-bottom: 20px; border: 1px solid #c3e6cb; }
.error-msg { background: #f8d7da; color: #721c24; padding: 15px; border-radius: 5px; margin-bottom: 20px; border: 1px solid #f5c6cb; }

/* ========================================= */
/* РАБОЧИЙ СТОЛ: КАЛЕНДАРЬ */
/* ========================================= */
.ribbon-wrapper { background: #fff; padding: 20px; border-radius: var(--border-radius); box-shadow: var(--shadow); margin-bottom: 20px; border: 1px solid var(--border-color); }
.ribbon-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 10px; }
.cal-title-block { display: flex; align-items: baseline; gap: 15px; }
.cal-title-block h2 { margin: 0; font-size: 18px; color: var(--text-main); }
.cal-week-badge { background: #e8f4fd; color: var(--primary); font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 20px; border: 1px solid #bee3f8; }
.cal-ribbon-container { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.scroll-btn { 
    background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 8px; width: 40px; height: 60px; 
    display: flex; align-items: center; justify-content: center; cursor: pointer; 
    font-size: 18px; color: var(--text-main); font-weight: bold; transition: 0.2s; z-index: 2; flex-shrink: 0;
}
.scroll-btn:hover { background: #e2e8f0; color: var(--primary); border-color: var(--primary); }
.scroll-btn:active { transform: scale(0.95); }
.cal-week-grid { display: flex; flex: 1; gap: 10px; width: 100%; }
.cal-day-card { 
    flex: 1; min-width: 0; padding: 12px 5px; border: 1px solid #e2e8f0; border-radius: 8px; 
    cursor: pointer; text-align: center; transition: all 0.2s; background: #f8fafc; user-select: none;
}
.cal-day-card:hover { border-color: var(--primary); background: #f1f5f9; }
.cal-day-card.is-weekend { background-color: #fff0f5; border-color: #ffd1dc; }
.cal-day-card.is-weekend:hover { background-color: #ffe4eb; }
.cal-day-card.is-today { background-color: #eaffea !important; border-color: #b2e8b2; border-bottom: 3px solid var(--success) !important; }
.cal-day-card.active { border-color: var(--primary) !important; box-shadow: 0 0 0 2px var(--primary) !important; background: #fff !important; }
.cal-date-num { font-size: 18px; font-weight: 700; color: var(--text-main); line-height: 1.2; }
.cal-weekday { font-size: 12px; color: var(--text-muted); text-transform: uppercase; font-weight: 500; }
.cal-badge { margin-top: 8px; font-size: 11px; font-weight: 600; color: var(--primary); background: rgba(16, 88, 208, 0.1); border-radius: 4px; padding: 3px 2px; display: inline-block; min-height: 22px; width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.cal-badge.empty { background: transparent; color: transparent; }
.tasks-display-area { margin-top: 5px; padding-top: 15px; border-top: 1px solid var(--border-color); }
.task-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; background: #fff; border: 1px solid var(--border-color); border-left-width: 4px; border-radius: 6px; margin-bottom: 10px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); animation: fadeIn 0.3s; }
.task-item:last-child { margin-bottom: 0; }
.task-item-left { display: flex; flex-direction: column; gap: 4px; }
.task-title { font-weight: 600; font-size: 14px; }
.task-client { font-size: 13px; color: var(--text-muted); }
.cal-date-picker { display: flex; gap: 8px; align-items: center; background: #f1f5f9; padding: 5px 10px; border-radius: 6px; border: 1px solid #cbd5e1; }
.cal-date-picker label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin: 0; }
.cal-date-picker input { border: none; background: #fff; font-size: 13px; padding: 5px 8px; border-radius: 4px; outline: none; cursor: pointer;}
.cal-date-picker input:focus { border: 1px solid var(--primary); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 992px) {
    .cal-week-grid { overflow-x: auto; padding-bottom: 5px; }
    .cal-day-card { min-width: 80px; }
}

/* ========================================= */
/* РАБОЧИЙ СТОЛ: ИСТОРИЯ ЛОГОВ */
/* ========================================= */
.logs-wrapper { background: var(--card-bg); padding: 20px; border-radius: var(--border-radius); box-shadow: var(--shadow); margin-bottom: 20px; border: 1px solid var(--border-color); }
.logs-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 15px; }
.logs-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.logs-filters select { padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; background: #f8fbfd; outline: none; cursor: pointer; color: var(--text-main); font-weight: 500;}
.logs-filters select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(16,88,208,0.1); background: #fff;}
.logs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.logs-table th { background: #f8fbfd; padding: 12px 15px; text-align: left; color: var(--text-muted); font-weight: 600; border-bottom: 2px solid var(--border-color); white-space: nowrap;}
.logs-table td { padding: 12px 15px; border-bottom: 1px solid var(--border-color); vertical-align: middle; line-height: 1.5; }
.logs-table tr:hover td { background: #f9fbfd; }

/* ========================================= */
/* РАБОЧИЙ СТОЛ: ЗАКАЗЫ (dashboard_orders_ui.php) */
/* ========================================= */
.filter-panel-modern { background: #fff; padding: 16px 20px; border-radius: var(--border-radius); box-shadow: 0 2px 12px rgba(0,0,0,0.04); margin-bottom: 20px; border: 1px solid var(--border-color); }
.filter-controls { display: flex; gap: 15px; align-items: flex-end; flex-wrap: wrap; }
.filter-item { flex: 1; min-width: 200px; }
.filter-item label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.filter-item select { width: 100%; padding: 10px 12px; border: 1px solid #d1d5da; border-radius: 6px; background-color: #f8fbfd; font-size: 14px; font-weight: 500; color: var(--text-main); transition: all 0.2s ease; cursor: pointer; }
.filter-item select:focus { border-color: var(--primary); background-color: #fff; box-shadow: 0 0 0 3px rgba(16, 88, 208, 0.1); }
.filter-actions { display: flex; gap: 10px; }
.filter-actions .btn { padding: 10px 20px; height: 41px; display: flex; align-items: center; justify-content: center; margin: 0; }
.status-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.status-chips label { display: inline-flex; margin: 0; cursor: pointer; }
.status-chips input[type="checkbox"] { display: none; }
.status-chips span { padding: 6px 14px; font-size: 13px; font-weight: 600; border-radius: 20px; border: 1px solid #d1d5da; color: var(--text-muted); background: #f8fafc; transition: all 0.2s; user-select: none; }
.status-chips input[value="new"]:checked + span { background: var(--primary); color: white; border-color: var(--primary); }
.status-chips input[value="in_progress"]:checked + span { background: #fd7e14; color: white; border-color: #fd7e14; }
.status-chips input[value="completed"]:checked + span { background: var(--success); color: white; border-color: var(--success); }
.status-chips input[value="canceled"]:checked + span { background: var(--danger); color: white; border-color: var(--danger); }
.pagination { display: flex; gap: 5px; justify-content: flex-start; margin-top: 20px; flex-wrap: wrap; }
.page-btn { padding: 8px 14px; border: 1px solid #cbd5e1; background: #fff; border-radius: 6px; cursor: pointer; color: #1e293b; font-weight: 600; transition: 0.2s; font-size: 14px; }
.page-btn:hover { background: #f1f5f9; border-color: #94a3b8; }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); z-index: 9999; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.modal-content { background: #fff; padding: 25px; border-radius: 12px; width: 100%; max-width: 450px; box-shadow: 0 20px 40px rgba(0,0,0,0.15); transform: translateY(-20px); animation: modalSlide 0.3s forwards; }
@keyframes modalSlide { to { transform: translateY(0); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { margin: 0; font-size: 18px; color: var(--text-main); }
.modal-close { cursor: pointer; font-size: 24px; color: #94a3b8; transition: 0.2s; line-height: 1; }
.modal-close:hover { color: var(--danger); }
@media (max-width: 768px) {
    .filter-controls { flex-direction: column; align-items: stretch; gap: 12px; }
    .filter-item { min-width: 100%; }
    .filter-actions { width: 100%; }
    .filter-actions .btn { flex: 1; }
}

/* ========================================= */
/* КОМПАКТНЫЕ МОБИЛЬНЫЕ СТИЛИ (ПО ЗАПРОСУ) */
/* ========================================= */
@media (max-width: 992px) {
    /* Календарь: вместить 7 дней без скролла */
    .cal-week-grid { gap: 2px !important; flex-wrap: nowrap; overflow-x: hidden !important; }
    .cal-day-card { min-width: 0 !important; width: 14.28%; padding: 6px 1px !important; border-radius: 4px; }
    .cal-date-num { font-size: 13px !important; }
    .cal-weekday { font-size: 9px !important; letter-spacing: -0.5px; }
    .today-mark { display: none !important; }
    .cal-badge { font-size: 13px !important; padding: 2px 0 !important; min-height: 18px !important; }
    .cal-badge .badge-text { display: none !important; }
    .cal-ribbon-container .scroll-btn { width: 20px; font-size: 14px; padding: 0; }
    
    /* Заказы: компактная карточка */
    tr.mobile-compact-order { display: flex; flex-wrap: wrap; padding: 12px 10px 8px 10px !important; gap: 4px !important; position: relative; align-items: center; }
    tr.mobile-compact-order td { display: block !important; padding: 0 !important; border: none !important; text-align: left !important; width: 100%; }
    tr.mobile-compact-order td::before { display: none !important; }
    
    /* Сетка внутри карточки заказа */
    tr.mobile-compact-order td[data-label="№"] { width: auto !important; font-size: 14px; }
    tr.mobile-compact-order td[data-label="Создан"] { width: auto !important; font-size: 12px; margin-left: 5px; padding-top: 1px !important; }
    tr.mobile-compact-order td[data-label="Статус"] { width: auto !important; position: absolute; top: 10px; right: 10px; }
    tr.mobile-compact-order td[data-label="Статус"] .mobile-select { padding: 3px 6px !important; font-size: 11px !important; width: auto !important; height: auto; border-radius: 4px; }
    tr.mobile-compact-order td[data-label="Покупатель"] { width: 100% !important; font-size: 14px; margin-top: 2px; }
    tr.mobile-compact-order td[data-label="Сводка"] { width: 60% !important; font-size: 11px; margin-top: 2px; display: flex !important; flex-direction: row !important; gap: 10px; }
    tr.mobile-compact-order td[data-label="Сводка"] div { margin: 0 !important; }
    tr.mobile-compact-order td[data-label="Сумма"] { width: 38% !important; text-align: right !important; margin-top: 2px; font-size: 13px; }
    tr.mobile-compact-order td[data-label="Ответственный"] { width: 100% !important; font-size: 11px; border-top: 1px solid #f1f3f5 !important; padding-top: 6px !important; margin-top: 4px; }
    tr.mobile-compact-order td[data-label="Ответственный"] select { padding: 4px !important; font-size: 11px !important; height: auto; }
    tr.mobile-compact-order td[data-label="Действие"] { width: 33% !important; margin-top: 4px; }
    tr.mobile-compact-order td[data-label="Прикрепить"] { width: 35% !important; margin-top: 4px; text-align: center !important; }
    tr.mobile-compact-order td[data-label="Скачать"] { width: 28% !important; display: flex !important; flex-direction: row !important; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 4px; }
    tr.mobile-compact-order td[data-label="Скачать"] a { display: inline-block !important; font-size: 11px; padding: 2px 4px; background: #f8fbfd; border: 1px solid #e2e8f0; border-radius: 4px; text-decoration: none; }
    tr.mobile-compact-order td[data-label="Скачать"] span { display: none !important; }
    tr.mobile-compact-order td[data-label="Действие"] .btn { padding: 5px 8px !important; font-size: 11px !important; }
    tr.mobile-compact-order td[data-label="Прикрепить"] .btn { padding: 5px 8px !important; font-size: 11px !important; }
    
    /* История действий: компактная карточка */
    tr.mobile-compact-log { display: flex; flex-direction: column; padding: 12px 10px !important; gap: 4px !important; position: relative; }
    tr.mobile-compact-log td { display: block !important; padding: 0 !important; border: none !important; text-align: left !important; width: 100%; }
    tr.mobile-compact-log td::before { display: none !important; }
    
    tr.mobile-compact-log td[data-label="Дата и Время"] { font-size: 11px; color: var(--text-muted); }
    tr.mobile-compact-log td[data-label="Пользователь"] { position: absolute; right: 10px; top: 12px; font-size: 11px; width: auto !important; }
    tr.mobile-compact-log td[data-label="Связь с заказом"] { font-size: 13px; margin-top: 2px; }
    tr.mobile-compact-log td[data-label="Связь с заказом"] a { font-size: 13px; }
    tr.mobile-compact-log td[data-label="Связь с заказом"] br { display: none; }
    tr.mobile-compact-log td[data-label="Связь с заказом"] span { display: inline-block; margin-left: 5px; font-size: 12px; color: var(--text-muted); }
    tr.mobile-compact-log td[data-label="Описание"] { font-size: 12px; margin-top: 4px; color: var(--text-main); line-height: 1.4; border-top: 1px solid #f1f3f5 !important; padding-top: 6px !important; }
    
    /* Analytics (analytics.php) */
    .analytics-grid { grid-template-columns: 1fr !important; gap: 15px !important; }
    .analytics-card { padding: 15px !important; }
    .chart-wrapper { height: 250px !important; }

    /* Окно заказа (view_order.php) */
    .order-info { padding: 15px 12px !important; margin-bottom: 15px; }
    .order-info h2 { font-size: 16px !important; flex-wrap: wrap; }
    .order-info p, .order-info select, .order-info button { font-size: 13px !important; }
    .accordion-header { padding: 12px 15px !important; }
    .acc-title { font-size: 14px !important; }
    .accordion-content { padding: 15px 10px !important; }
    .sidebar { padding: 15px 12px !important; margin-top: 20px; width: 100% !important; flex: none; }
    .sidebar h3 { font-size: 15px !important; }
    .grid-form { gap: 10px !important; margin-bottom: 15px !important; grid-template-columns: 1fr; }
    .grid-form input, .grid-form select { padding: 10px !important; font-size: 14px !important; }
    .btn-save { padding: 12px !important; font-size: 14px !important; width: 100%; display: block; }
}