/* ==========================================
   СКЛАД ИНСТРУМЕНТОВ — Windows 11 Fluent Design
   Светлая тема, единый стиль
   ========================================== */

/* Принудительный белый фон для всей страницы */
html {
    color-scheme: light;
}
html, body {
    background-color: #ffffff !important;
    color: #1a1a1a;
}

/* Windows 11 Fluent — Светлая тема */
:root {
    /* Основные фоны (Windows 11 mica-inspired — БЕЛЫЙ ФОН) */
    --bg-page: #ffffff;           /* Белый фон страницы */
    --bg-surface: #ffffff;        /* Карточки, панели */
    --bg-surface-hover: #f5f5f5;  /* Hover для поверхностей */
    --bg-elevated: #ffffff;       /* Модальные окна, dropdowns */
    --bg-overlay: rgba(0, 0, 0, 0.4);

    /* Текст (Segoe UI style) */
    --text-primary: #1a1a1a;      /* Основной текст */
    --text-secondary: #616161;    /* Вторичный текст */
    --text-tertiary: #9e9e9e;     /* Третичный текст */
    --text-link: #0067c0;         /* Ссылки (Windows blue) */
    --text-link-hover: #005a9e;   /* Ссылки hover */

    /* Границы (Windows 11 subtle borders) */
    --border-primary: #e5e5e5;    /* Основные границы */
    --border-secondary: #d1d1d1;  /* Вторичные границы */
    --border-focus: #0067c0;      /* Фокус */

    /* Семантические цвета */
    --color-success: #0f7b0f;     /* Успех */
    --success-bg: #f1faf1;
    --success-border: #d2e8d2;

    --color-error: #c42b1c;       /* Ошибка (Windows red) */
    --error-bg: #fdf3f2;
    --error-border: #f4b4a9;

    --color-warning: #9d5d00;     /* Предупреждение */
    --warning-bg: #fef9f0;
    --warning-border: #fce6b3;

    --color-info: #0078d4;        /* Информация (Windows blue) */
    --info-bg: #f0f6ff;
    --info-border: #b3d9ff;

    /* Акцент (Windows 11 accent) */
    --color-primary: #0067c0;     /* Windows 11 blue accent */
    --primary-hover: #005a9e;
    --primary-bg: #e8f4ff;
    --primary-border: #b3d9ff;

    /* Sidebar (Windows 11 navigation) */
    --sidebar-bg: #ffffff;
    --sidebar-border: #e5e5e5;
    --sidebar-text: #616161;
    --sidebar-hover: #f3f3f3;
    --sidebar-hover-text: #0067c0;

    /* Кнопка темы (удалена, но оставим для совместимости) */
    --theme-btn-bg: transparent;
    --theme-btn-border: transparent;
    --theme-btn-text: var(--text-primary);
    --theme-btn-hover: var(--bg-surface-hover);
    --theme-icon-color: var(--text-secondary);

    /* Windows 11 Fluent — тени и скругления */
    --shadow-card: 0 2px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 8px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-elevated: 0 32px 64px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.08);
    --shadow-modal: 0 24px 48px rgba(0, 0, 0, 0.12);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Шрифт Windows 11 */
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
}

/* Применяем шрифт ко всему */
* {
    font-family: var(--font-family);
}

/* Smooth transitions — только нужные свойства */
button, a, input, select, textarea {
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

/* ==========================================
   УТИЛИТЫ ФОНОВ (замена dark: классов)
   ========================================== */

.bg-page { background-color: var(--bg-page); }
.bg-surface { background-color: var(--bg-surface); }
.bg-surface-hover { background-color: var(--bg-surface-hover); }
.bg-elevated { background-color: var(--bg-elevated); }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-link { color: var(--text-link); }

.border-primary { border-color: var(--border-primary); }
.border-focus { border-color: var(--border-focus); }

/* ==========================================
   КАРТОЧКИ (Windows 11 Fluent)
   ========================================== */

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

/* Windows 11 style карточки */
.win-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-primary);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.win-card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

/* ==========================================
   КНОПКИ (Windows 11 Fluent)
   ========================================== */

.win-btn-primary {
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.win-btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 4px rgba(0, 103, 192, 0.3);
}

.win-btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.win-btn-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-secondary);
}

/* ==========================================
   ФОРМЫ (Windows 11 Fluent)
   ========================================== */

.win-input,
.win-input:focus {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.win-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(0, 103, 192, 0.2);
    outline: none;
}

.win-input::placeholder {
    color: var(--text-tertiary);
}

/* ==========================================
   МОДАЛЬНЫЕ ОКНА (Windows 11 Fluent)
   ========================================== */

.modal-backdrop {
    background-color: var(--bg-overlay);
}

.win-modal {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    border: 1px solid var(--border-primary);
}

/* ==========================================
   ТАБЛИЦЫ (Windows 11 Fluent)
   ========================================== */

.win-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-primary);
}

.win-table thead {
    background: #f9f9f9;
    border-bottom: 2px solid var(--border-primary);
}

.win-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.win-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
}

.win-table tbody tr:hover {
    background: var(--primary-bg);
}

.win-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================
   SIDEBAR (Windows 11 Navigation)
   ========================================== */

/* Sidebar container */
.win-sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e5e5e5 !important;
}

/* Sidebar text and icons */
.win-sidebar .sidebar-icon,
.win-sidebar .sidebar-text {
    color: #616161 !important;
    transition: color 0.15s ease;
}

/* Sidebar links */
.win-sidebar .sidebar-link {
    display: flex !important;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin: 0 0.25rem;
    border-radius: 4px;
    color: #616161 !important;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.win-sidebar .sidebar-link:hover {
    background-color: #e8f4ff !important;
    color: #0067c0 !important;
}

.win-sidebar .sidebar-link.active {
    background-color: #e8f4ff !important;
    color: #0067c0 !important;
    font-weight: 500;
}

/* Sidebar logout button */
.win-sidebar .sidebar-logout {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    margin: 0 0.25rem;
    border-radius: 4px;
    width: 100%;
    color: #616161 !important;
    background: transparent !important;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.win-sidebar .sidebar-logout:hover {
    background-color: #fdf3f2 !important;
    color: #c42b1c !important;
    border-color: #f4b4a9;
}

/* Sidebar group (for planning sub-items) */
.win-sidebar .sidebar-group {
    margin: 0.25rem 0;
    padding: 0.25rem 0;
}

.win-sidebar .sidebar-group-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #9e9e9e;
    padding: 0.5rem 0.75rem 0.25rem;
    letter-spacing: 0.5px;
}

.win-sidebar .sidebar-group .sidebar-link {
    padding-left: 1.5rem;
}

@media (min-width: 768px) {
    .win-sidebar .sidebar-logout {
        justify-content: flex-start;
    }
}

/* Кнопка сворачивания sidebar */
#sidebar-collapse-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: #616161;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    font-size: 12px;
}

#sidebar-collapse-btn:hover {
    background-color: #e8f4ff;
    color: #0067c0;
}

@media (min-width: 1024px) {
    #sidebar-collapse-btn {
        display: flex;
    }
}

@media (max-width: 1023px) {
    #sidebar-collapse-btn {
        display: none !important;
    }
}

/* ==========================================
   Scrollbar (Windows 11 style)
   ========================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ==========================================
   АДАПТИВНОСТЬ
   ========================================== */

/* Горизонтальная прокрутка для таблиц на мобильных */
.responsive-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Адаптивная сетка */
@media (max-width: 1024px) {
    .table-header-desktop {
        display: none;
    }
    .mobile-card-view {
        display: block;
    }
    .desktop-table-view {
        display: none;
    }
}

@media (min-width: 1025px) {
    .mobile-card-view {
        display: none;
    }
    .desktop-table-view {
        display: block;
    }
    .table-header-desktop {
        display: flex;
    }
}

/* Мобильная карточка детали */
.mobile-detail-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border-primary);
}

.mobile-detail-card:hover {
    box-shadow: var(--shadow-card-hover);
}

/* Адаптивный sidebar */
@media (max-width: 768px) {
    .sidebar-text {
        display: none;
    }
    .sidebar-mobile-compact {
        width: 48px !important;
    }
}

/* Адаптивные кнопки */
@media (max-width: 640px) {
    .btn-responsive-group {
        flex-direction: column;
    }
    .btn-responsive-group button,
    .btn-responsive-group a {
        width: 100%;
        margin-bottom: 8px;
    }
}

/* Адаптивные формы */
@media (max-width: 768px) {
    .form-grid-responsive {
        grid-template-columns: 1fr;
    }
    .form-group-full-width {
        grid-column: 1 / -1;
    }
}

/* Адаптивные модальные окна */
@media (max-width: 640px) {
    .modal-responsive {
        max-width: 95vw !important;
        margin: 1rem;
    }
    .modal-responsive .modal-header {
        font-size: 1.25rem;
    }
    .modal-responsive .modal-body {
        padding: 12px;
    }
}

/* ==========================================
   THEME TOGGLE — УДАЛЕНО
   Стили для кнопки переключения темы больше не нужны
   ========================================== */

.theme-toggle-sidebar-btn,
.theme-toggle-icon,
.theme-toggle-label {
    display: none;
}

/* ==========================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   Полная поддержка мобильных устройств
   ========================================== */

/* === Mobile Header === */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    padding: 0 16px;
    align-items: center;
    justify-content: flex-start;
    z-index: 40;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.mobile-header-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-left: 12px;
}

.hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: #0067c0;
    color: white;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.15s ease, transform 0.1s ease;
    flex-shrink: 0;
    z-index: 50;
    -webkit-appearance: none;
    appearance: none;
}

/* Ensure hamburger icon is visible even if Font Awesome fails */
.hamburger-btn i::before {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Fallback emoji for hamburger when Font Awesome fails */
.hamburger-icon-fallback {
    display: none;
    font-size: 24px;
    line-height: 1;
}

/* Show emoji fallback if Font Awesome icons don't load */
@supports not (font-display: swap) {
    .hamburger-btn i {
        display: none !important;
    }
    .hamburger-icon-fallback {
        display: block !important;
    }
}

/* Fallback for all Font Awesome icons on mobile - using text content instead of ::before */
@media (max-width: 1023px) {
    /* These will be overridden by JS fallback if Font Awesome doesn't load */
    .fa,
    .fas,
    .far,
    .fal,
    .fab {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    }
    
    /* Direct content replacement using ::after to ensure it works */
    .fa-bars::before,
    .fa-navicon::before,
    .fa-bars-staggered::before {
        content: "☰" !important;
    }
    
    .fa-home::before { content: "🏠" !important; }
    .fa-warehouse::before { content: "🏭" !important; }
    .fa-cube::before,
    .fa-boxes::before { content: "📦" !important; }
    .fa-box::before,
    .fa-box-open::before { content: "📦" !important; }
    .fa-users::before { content: "👥" !important; }
    .fa-user::before { content: "👤" !important; }
    .fa-user-plus::before { content: "👤+" !important; }
    .fa-user-edit::before { content: "👤✏️" !important; }
    .fa-user-slash::before { content: "👤✕" !important; }
    .fa-chart-line::before,
    .fa-chart-bar::before { content: "📊" !important; }
    .fa-calendar::before { content: "📅" !important; }
    .fa-clipboard-check::before,
    .fa-clipboard-list::before,
    .fa-clipboard::before,
    .fa-tasks::before { content: "📋" !important; }
    .fa-cogs::before,
    .fa-cog::before { content: "⚙️" !important; }
    .fa-file-import::before { content: "📥" !important; }
    .fa-file-export::before { content: "📤" !important; }
    .fa-tools::before { content: "🔧" !important; }
    .fa-wrench::before,
    .fa-hammer::before { content: "🔧" !important; }
    .fa-sign-out-alt::before,
    .fa-sign-out::before { content: "🚪" !important; }
    .fa-sign-in-alt::before,
    .fa-sign-in::before { content: "🚪" !important; }
    .fa-times::before { content: "✕" !important; }
    .fa-times-circle::before { content: "✕" !important; }
    .fa-plus::before,
    .fa-plus-circle::before,
    .fa-plus-square::before { content: "+" !important; }
    .fa-minus::before,
    .fa-minus-circle::before { content: "−" !important; }
    .fa-edit::before,
    .fa-pencil::before,
    .fa-pencil-alt::before { content: "✏️" !important; }
    .fa-trash::before,
    .fa-trash-alt::before { content: "🗑️" !important; }
    .fa-search::before { content: "🔍" !important; }
    .fa-filter::before { content: "⚡" !important; }
    .fa-download::before { content: "⬇️" !important; }
    .fa-upload::before { content: "⬆️" !important; }
    .fa-check::before,
    .fa-check-circle::before,
    .fa-check-square::before { content: "✓" !important; }
    .fa-exclamation-circle::before,
    .fa-exclamation-triangle::before { content: "⚠️" !important; }
    .fa-info-circle::before { content: "ℹ️" !important; }
    .fa-arrow-left::before { content: "←" !important; }
    .fa-arrow-right::before { content: "→" !important; }
    .fa-arrow-up::before { content: "↑" !important; }
    .fa-arrow-down::before { content: "↓" !important; }
    .fa-chevron-left::before { content: "‹" !important; }
    .fa-chevron-right::before { content: "›" !important; }
    .fa-chevron-down::before { content: "▼" !important; }
    .fa-chevron-up::before { content: "▲" !important; }
    .fa-angle-left::before { content: "‹" !important; }
    .fa-angle-right::before { content: "›" !important; }
    .fa-angle-down::before { content: "▼" !important; }
    .fa-angle-up::before { content: "▲" !important; }
    .fa-print::before { content: "🖨️" !important; }
    .fa-save::before { content: "💾" !important; }
    .fa-file-excel::before { content: "📊" !important; }
    .fa-file-pdf::before { content: "📄" !important; }
    .fa-file-csv::before,
    .fa-file::before { content: "📄" !important; }
    .fa-shopping-cart::before,
    .fa-shopping-bag::before { content: "🛒" !important; }
    .fa-image::before,
    .fa-images::before { content: "🖼️" !important; }
    .fa-folder::before,
    .fa-folder-open::before { content: "📁" !important; }
    .fa-sync-alt::before,
    .fa-sync::before,
    .fa-refresh::before { content: "🔄" !important; }
    .fa-eye::before { content: "👁️" !important; }
    .fa-eye-slash::before { content: "👁️" !important; }
    .fa-lock::before { content: "🔒" !important; }
    .fa-lock-open::before { content: "🔓" !important; }
    .fa-at::before { content: "@" !important; }
    .fa-exchange-alt::before,
    .fa-exchange::before { content: "🔄" !important; }
    .fa-layer-group::before { content: "📊" !important; }
    .fa-route::before { content: "🛣️" !important; }
}

.hamburger-btn:hover {
    background: #005a9e;
    transform: scale(1.05);
}

.hamburger-btn:active {
    transform: scale(0.95);
}

.hamburger-btn i {
    font-size: 20px;
}

/* === Sidebar Mobile Styles === */
.sidebar-mobile {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.sidebar-mobile.sidebar-open {
    transform: translateX(0);
}

/* Desktop sidebar - always visible */
@media (min-width: 1024px) {
    .sidebar-mobile {
        position: relative;
        transform: none;
        width: 256px !important;
        min-width: 256px;
        transition: width 0.3s ease, min-width 0.3s ease;
    }
    .sidebar-mobile.collapsed {
        width: 60px !important;
        min-width: 60px !important;
    }
    .sidebar-mobile.collapsed .sidebar-text,
    .sidebar-mobile.collapsed .sidebar-link span,
    .sidebar-mobile.collapsed .sidebar-logout span {
        display: none !important;
    }
    .sidebar-mobile.collapsed .sidebar-link,
    .sidebar-mobile.collapsed .sidebar-logout {
        justify-content: center;
        padding: 0.5rem;
    }
    .sidebar-mobile.collapsed .sidebar-link i,
    .sidebar-mobile.collapsed .sidebar-logout i {
        margin: 0 !important;
    }
    .mobile-header {
        display: none !important;
    }
}

/* Show mobile header on mobile and tablet */
@media (max-width: 1023px) {
    .mobile-header {
        display: flex !important;
    }
    
    .hamburger-btn {
        display: flex !important;
    }
}

/* === Mobile Overlay === */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.overlay-active {
    display: block;
    opacity: 1;
}

/* === Main Content Adjustment === */
@media (max-width: 1023px) {
    main {
        padding-top: 56px !important;
    }

    /* Add padding-top to any content wrapper */
    .p-6 {
        padding: 16px !important;
    }

    .bg-white.border-b {
        padding-top: 72px !important;
        padding-bottom: 16px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* === Touch-friendly Buttons === */
@media (max-width: 1023px) {
    button,
    .btn,
    a.btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
        font-size: 14px;
    }

    /* Larger touch targets for important actions */
    .win-btn-primary,
    .win-btn-secondary {
        min-height: 48px;
        padding: 12px 24px;
    }

    /* Form inputs - larger touch target */
    input,
    select,
    textarea {
        min-height: 48px;
        padding: 12px 16px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    /* Checkboxes and radios */
    input[type="checkbox"],
    input[type="radio"] {
        width: 24px;
        height: 24px;
    }

    /* Links */
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 8px 12px;
    }
}

/* === Responsive Grid Adjustments === */
@media (max-width: 1023px) {
    /* Dashboard grid - single column on mobile */
    .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-4 {
        grid-template-columns: 1fr;
    }

    .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
        grid-template-columns: 1fr;
    }

    /* Reduce gaps on mobile */
    .gap-6 {
        gap: 16px;
    }

    .gap-4 {
        gap: 12px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === Responsive Typography === */
@media (max-width: 1023px) {
    h1 {
        font-size: 24px !important;
    }

    h2 {
        font-size: 20px !important;
    }

    h3 {
        font-size: 18px !important;
    }

    .text-2xl {
        font-size: 20px !important;
    }

    .text-xl {
        font-size: 18px !important;
    }

    .text-lg {
        font-size: 16px !important;
    }

    /* Reduce margins */
    .mb-8 {
        margin-bottom: 24px !important;
    }

    .mb-6 {
        margin-bottom: 16px !important;
    }

    .mb-4 {
        margin-bottom: 12px !important;
    }

    .mt-4 {
        margin-top: 12px !important;
    }

    .p-6 {
        padding: 16px !important;
    }
}

/* === Responsive Cards === */
@media (max-width: 1023px) {
    .bg-white.rounded-lg.shadow.p-6 {
        padding: 16px;
        border-radius: 12px;
        margin-bottom: 12px;
    }

    /* Dashboard cards - more compact on mobile */
    .card-hover:hover {
        transform: none;
    }
}

/* === Responsive Tables - Card View === */
@media (max-width: 767px) {
    /* Hide table headers */
    .win-table thead {
        display: none;
    }

    /* Convert table to card layout */
    .win-table tbody,
    .win-table tr,
    .win-table td {
        display: block;
        width: 100%;
    }

    .win-table tbody tr {
        margin-bottom: 16px;
        border: 1px solid #e5e5e5;
        border-radius: 8px;
        background: #ffffff;
        padding: 12px;
    }

    .win-table tbody tr:hover {
        background: #f9f9f9;
    }

    .win-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 4px;
        border-bottom: 1px solid #f0f0f0;
    }

    .win-table td:last-child {
        border-bottom: none;
    }

    /* Add label before each cell */
    .win-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #616161;
        font-size: 12px;
        text-transform: uppercase;
        flex-shrink: 0;
        margin-right: 12px;
    }

    /* Last cell (actions) - full width */
    .win-table td:last-child {
        justify-content: center;
        padding-top: 12px;
    }

    /* === Tailwind-style tables (items list) === */
    table.min-w-full {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table.min-w-full thead {
        display: none;
    }

    table.min-w-full tbody,
    table.min-w-full tr,
    table.min-w-full td {
        display: block;
        width: 100%;
    }

    table.min-w-full tbody tr {
        margin-bottom: 12px;
        border: 1px solid #e5e5e5;
        border-radius: 8px;
        background: #ffffff;
        padding: 8px;
    }

    table.min-w-full tbody tr:hover {
        background: #f9fafb;
    }

    table.min-w-full td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 8px;
        border-bottom: 1px solid #f3f4f6;
        min-height: 44px;
    }

    table.min-w-full td:last-child {
        border-bottom: none;
        padding-top: 8px;
    }

    /* Action buttons in mobile card view */
    table.min-w-full td:last-child .flex {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    table.min-w-full td:last-child button,
    table.min-w-full td:last-child a {
        min-width: 36px;
        min-height: 36px;
        padding: 6px 8px;
    }

    /* Image cell */
    table.min-w-full td:first-child {
        justify-content: center;
        padding-bottom: 4px;
    }
}

/* === Responsive Tables - Scroll on Tablet === */
@media (min-width: 768px) and (max-width: 1023px) {
    .win-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* === Responsive Flash Messages === */
@media (max-width: 767px) {
    #flash-messages {
        left: 16px;
        right: 16px;
        top: 72px !important;
    }

    .flash-message {
        font-size: 14px;
        padding: 12px 16px;
    }
}

/* === Responsive Sidebar Items === */
@media (max-width: 1023px) {
    .sidebar-link {
        padding: 12px 16px;
        min-height: 48px;
    }

    .sidebar-link i {
        font-size: 18px;
    }

    .sidebar-logout {
        padding: 12px 16px;
        min-height: 48px;
    }

    /* Show icons in mobile sidebar */
    .sidebar-link span {
        display: inline !important;
        margin-left: 12px;
    }
}

/* === Responsive Modal === */
@media (max-width: 767px) {
    .modal-responsive {
        max-width: calc(100vw - 32px) !important;
        max-height: calc(100vh - 32px) !important;
        margin: 16px !important;
    }

    .modal-header {
        padding: 16px !important;
        font-size: 18px !important;
    }

    .modal-body {
        padding: 16px !important;
    }

    .modal-footer {
        padding: 12px 16px !important;
        flex-direction: column-reverse;
    }

    .modal-footer button,
    .modal-footer a {
        width: 100%;
        margin-bottom: 8px;
    }

    .modal-footer button:last-child,
    .modal-footer a:last-child {
        margin-bottom: 0;
    }
}

/* === Responsive Forms === */
@media (max-width: 767px) {
    .form-grid-responsive {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    /* Stack form groups */
    .form-row {
        flex-direction: column;
    }

    /* Full width inputs */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    select,
    textarea {
        width: 100%;
    }

    /* Labels on top */
    label {
        display: block;
        margin-bottom: 6px;
        font-weight: 500;
        color: #616161;
        font-size: 14px;
    }
}

/* === Responsive Pagination === */
@media (max-width: 767px) {
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .pagination button {
        min-width: 40px;
        min-height: 40px;
        padding: 8px;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
        margin-bottom: 8px;
    }
}

/* === Responsive Search === */
@media (max-width: 767px) {
    .search-form {
        flex-direction: column;
        gap: 12px;
    }

    .search-form input {
        width: 100%;
    }

    .search-form button {
        width: 100%;
    }
}

/* === Responsive Badges === */
@media (max-width: 767px) {
    .badge,
    .px-3.py-1 {
        padding: 4px 8px;
        font-size: 12px;
    }

    .status-badge {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* === Responsive Navigation Links === */
@media (max-width: 767px) {
    .nav-links,
    .tab-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .nav-links a,
    .tab-nav a {
        white-space: nowrap;
        padding: 10px 16px;
    }
}

/* === Body overflow control when sidebar is open === */
body.sidebar-open {
    overflow: hidden;
}

/* === Responsive Action Buttons Group === */
@media (max-width: 767px) {
    .action-buttons {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .action-buttons button,
    .action-buttons a {
        width: 100%;
        justify-content: center;
    }
}

/* === Responsive Tabs === */
@media (max-width: 767px) {
    .tabs {
        flex-direction: column;
        border-bottom: none;
    }

    .tabs button {
        border: 1px solid #e5e5e5;
        border-radius: 8px;
        margin-bottom: 8px;
        text-align: left;
    }

    .tabs button.active {
        border-color: #0067c0;
        background: #e8f4ff;
    }
}

/* === Empty State === */
@media (max-width: 767px) {
    .empty-state {
        padding: 32px 16px;
        text-align: center;
    }

    .empty-state i {
        font-size: 48px;
        margin-bottom: 16px;
    }
}

/* === iOS Safe Area Support === */
@supports (padding: max(0px)) {
    @media (max-width: 1023px) {
        .mobile-header {
            padding-left: max(16px, env(safe-area-inset-left));
            padding-right: max(16px, env(safe-area-inset-right));
        }

        main {
            padding-bottom: max(16px, env(safe-area-inset-bottom));
        }
    }
}

/* === Print Styles - Hide Mobile Elements === */
@media print {
    .mobile-header,
    .sidebar-mobile,
    .sidebar-overlay,
    .hamburger-btn {
        display: none !important;
    }
}

/* ==========================================
   АДМИН СТРАНИЦЫ — КОМПЛЕКСНАЯ АДАПТАЦИЯ
   ========================================== */

/* === Admin Page Headers === */
@media (max-width: 767px) {
    .bg-blue-50,
    .bg-purple-50,
    .bg-green-50 {
        padding: 16px !important;
    }

    .bg-blue-50 h1,
    .bg-purple-50 h1,
    .bg-green-50 h1 {
        font-size: 18px !important;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .bg-blue-50 h1 i,
    .bg-purple-50 h1 i,
    .bg-green-50 h1 i {
        font-size: 20px;
    }

    .bg-blue-50 p,
    .bg-purple-50 p,
    .bg-green-50 p {
        font-size: 12px;
    }
}

/* === User Cards (admin users page) === */
@media (max-width: 1023px) {
    #users-container {
        grid-template-columns: 1fr !important;
    }

    .user-card {
        padding: 16px !important;
    }

    .user-card .flex.items-start.justify-between {
        flex-direction: column;
        gap: 12px;
    }

    .user-card .flex.items-center.gap-3 {
        justify-content: flex-start;
    }

    .user-card .w-12.h-12 {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .user-card h3 {
        font-size: 16px;
    }

    .user-card .flex.gap-2.mt-4 {
        flex-direction: column;
    }

    .user-card .flex.gap-2.mt-4 button,
    .user-card .flex.gap-2.mt-4 form button {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .user-card .workstation-chips {
        flex-wrap: wrap;
    }

    .user-card .workstation-chips span {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* === Reports/Export Cards Grid === */
@media (max-width: 767px) {
    .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3.gap-4,
    .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-4.gap-4 {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .bg-white.rounded-lg.shadow-md.p-5 {
        padding: 16px !important;
    }

    .bg-white.rounded-lg.shadow-md.p-5 .flex.items-start.gap-3 {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .bg-white.rounded-lg.shadow-md.p-5 .w-10.h-10 {
        width: 40px;
        height: 40px;
    }

    .bg-white.rounded-lg.shadow-md.p-5 h3 {
        font-size: 15px;
    }

    .bg-white.rounded-lg.shadow-md.p-5 p {
        font-size: 12px;
    }

    .bg-white.rounded-lg.shadow-md.p-5 a,
    .bg-white.rounded-lg.shadow-md.p-5 button {
        width: 100%;
        margin-top: 12px;
        min-height: 44px;
    }
}

/* === Planning Page - Order Cards === */
@media (max-width: 1023px) {
    .order-card {
        padding: 16px !important;
    }

    .order-card .flex.items-start.justify-between {
        flex-direction: column;
        gap: 12px;
    }

    .order-card .flex.items-center.space-x-3 {
        flex-wrap: wrap;
    }

    .order-card .flex.items-center.space-x-3.mb-2 {
        margin-bottom: 12px;
    }

    .order-card h3 {
        font-size: 14px;
        word-break: break-word;
    }

    .order-card .px-2.py-1 {
        font-size: 11px;
        padding: 2px 6px;
    }

    .order-card .grid.grid-cols-2.md\:grid-cols-4.gap-4 {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .order-card .grid.grid-cols-2.md\:grid-cols-4.gap-4 > div {
        padding: 4px 0;
    }

    .order-card .grid.grid-cols-2.md\:grid-cols-4.gap-4 .text-gray-500 {
        font-size: 10px;
    }

    .order-card .grid.grid-cols-2.md\:grid-cols-4.gap-4 .font-semibold {
        font-size: 13px;
    }

    .order-card .inline-flex.items-center.space-x-1 {
        flex-wrap: wrap;
        gap: 4px;
    }

    .order-card .inline-flex.items-center.space-x-1 button,
    .order-card .inline-flex.items-center.space-x-1 a {
        min-width: 32px;
        min-height: 32px;
        padding: 4px 6px;
    }

    /* Schedule items */
    .order-card .mt-1 .flex.items-center {
        flex-wrap: wrap;
        gap: 4px;
    }

    .order-card .mt-1 .flex.items-center .font-medium {
        font-size: 12px;
    }

    .order-card .mt-1 .flex.items-center .text-gray-500,
    .order-card .mt-1 .flex.items-center .text-gray-400 {
        font-size: 10px;
    }

    .order-card .mt-1 .flex.items-center .ml-1,
    .order-card .mt-1 .flex.items-center .mx-1 {
        display: none;
    }

    .order-card .mt-2.text-sm {
        font-size: 12px;
        margin-top: 8px !important;
    }
}

@media (max-width: 640px) {
    .order-card .grid.grid-cols-2.md\:grid-cols-4.gap-4 {
        grid-template-columns: 1fr !important;
    }

    .order-card .px-2.py-1.bg-purple-600,
    .order-card .px-2.py-1.bg-blue-600 {
        display: inline-block;
        margin-bottom: 4px;
    }
}

/* === Stats Cards === */
@media (max-width: 767px) {
    .grid.grid-cols-1.md\:grid-cols-3.gap-4 {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .bg-white.rounded-lg.shadow.p-4 {
        padding: 16px !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .bg-white.rounded-lg.shadow.p-4 .text-3xl {
        font-size: 24px;
    }

    .bg-white.rounded-lg.shadow.p-4 .text-2xl {
        font-size: 20px;
    }
}

/* === Filters & Search Bars === */
@media (max-width: 767px) {
    .bg-white.border-b.border-gray-200.px-4,
    .bg-white.border-b.border-gray-200.px-6,
    .bg-white.rounded-lg.shadow.p-4,
    .bg-white.shadow.p-4 {
        padding: 12px !important;
    }

    .flex.flex-col.gap-3,
    .flex.items-center.space-x-4,
    .flex.items-center.justify-between {
        flex-direction: column;
        align-items: stretch;
    }

    .flex.items-center.space-x-4 > * {
        width: 100%;
    }

    .flex.gap-2 button,
    .flex.gap-2 a {
        flex: 1;
        min-height: 44px;
    }

    input[type="search"],
    input[type="text"],
    select {
        width: 100% !important;
    }

    /* Action bar buttons */
    .flex.space-x-2 {
        flex-wrap: wrap;
        gap: 8px;
    }

    .flex.space-x-2 a,
    .flex.space-x-2 button {
        flex: 1 1 calc(50% - 4px);
        min-height: 44px;
        justify-content: center;
        font-size: 13px;
    }
}

/* === Admin Modals === */
@media (max-width: 767px) {
    .bg-white.rounded-lg.shadow-xl.max-w-2xl,
    .bg-white.rounded-lg.shadow-xl.max-w-md,
    .bg-white.rounded-lg.shadow-xl.w-\[450px\],
    .bg-white.rounded-lg.shadow-xl.w-\[600px\],
    .bg-white.rounded-lg.shadow-xl.w-\[750px\] {
        width: calc(100% - 32px) !important;
        max-width: 100% !important;
        margin: 16px !important;
        max-height: calc(100vh - 32px) !important;
    }

    .bg-white.rounded-lg.shadow-xl .p-6 {
        padding: 16px !important;
    }

    .bg-white.rounded-lg.shadow-xl h3 {
        font-size: 16px;
    }

    /* Edit user modal */
    .bg-white.rounded-lg.shadow-xl .text-center.mb-6 .w-20.h-20 {
        width: 64px;
        height: 64px;
        font-size: 32px;
    }

    /* Form inside modals */
    .bg-white.rounded-lg.shadow-xl form .space-y-4 > div {
        margin-bottom: 16px;
    }

    .bg-white.rounded-lg.shadow-xl form label {
        font-size: 14px;
        margin-bottom: 6px;
        display: block;
    }

    .bg-white.rounded-lg.shadow-xl form input,
    .bg-white.rounded-lg.shadow-xl form select,
    .bg-white.rounded-lg.shadow-xl form textarea {
        width: 100%;
        min-height: 44px;
        font-size: 16px;
    }

    /* Screen permissions groups */
    .border.border-gray-200.rounded-lg {
        margin-bottom: 8px;
    }

    .border.border-gray-200.rounded-lg .px-3.py-2 {
        padding: 12px !important;
    }

    .border.border-gray-200.rounded-lg .space-y-1 {
        padding: 12px !important;
    }

    /* Modal buttons */
    .bg-white.rounded-lg.shadow-xl .flex.gap-3.pt-4,
    .bg-white.rounded-lg.shadow-xl .flex.space-x-2,
    .bg-white.rounded-lg.shadow-xl .flex.gap-3 {
        flex-direction: column;
    }

    .bg-white.rounded-lg.shadow-xl .flex.gap-3.pt-4 button,
    .bg-white.rounded-lg.shadow-xl .flex.space-x-2 button,
    .bg-white.rounded-lg.shadow-xl .flex.gap-3 button,
    .bg-white.rounded-lg.shadow-xl .flex.gap-3 a {
        width: 100%;
        min-height: 48px;
        justify-content: center;
    }
}

/* === Schedule Dialogs === */
@media (max-width: 767px) {
    #schedule-dialog,
    #coop-dialog,
    #conflict-dialog,
    #move-dialog,
    #restoreModal {
        padding: 16px;
    }

    #schedule-dialog .bg-white.rounded-lg.shadow-xl,
    #coop-dialog .bg-white.rounded-lg.shadow-xl,
    #conflict-dialog .bg-white.rounded-lg.shadow-xl,
    #move-dialog .bg-white.rounded-lg.shadow-xl {
        width: 100% !important;
        max-width: 100% !important;
    }

    .bg-white.rounded-lg.shadow-xl.p-6 {
        padding: 16px !important;
    }

    #schedule-dialog h3,
    #coop-dialog h3,
    #conflict-dialog h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    #schedule-dialog input[type="date"],
    #move-dialog input[type="date"] {
        width: 100%;
        min-height: 48px;
    }

    /* Coop dialog operations list */
    #coop-operations-list .bg-purple-50 {
        padding: 12px !important;
        margin-bottom: 8px;
    }

    #coop-operations-list .grid.grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }

    /* Conflict dialog */
    .conflict-row {
        padding: 12px !important;
    }

    .conflict-row .flex.items-start.justify-between {
        flex-direction: column;
    }

    .conflict-row .ml-4.w-56 {
        margin-left: 0 !important;
        width: 100% !important;
        margin-top: 12px;
    }
}

/* === Toast Notifications === */
@media (max-width: 767px) {
    #toast {
        left: 16px;
        right: 16px;
        bottom: 24px;
        padding: 12px 16px;
    }
}

/* === Loading Overlay === */
@media (max-width: 767px) {
    #loading-overlay .bg-white.rounded-lg.shadow-xl.p-8 {
        padding: 24px 16px !important;
        width: calc(100% - 32px) !important;
        max-width: 280px !important;
    }

    #loading-overlay .text-4xl {
        font-size: 32px;
    }
}

/* === Empty States === */
@media (max-width: 767px) {
    .bg-white.rounded-lg.shadow.p-12,
    .bg-white.rounded-lg.shadow.p-6 {
        padding: 24px 16px !important;
    }

    .bg-white.rounded-lg.shadow.p-12 i,
    .bg-white.rounded-lg.shadow.p-6 i {
        font-size: 48px !important;
    }

    .bg-white.rounded-lg.shadow.p-12 p,
    .bg-white.rounded-lg.shadow.p-6 p {
        font-size: 14px;
    }
}

/* === Touch Improvements for Admin === */
@media (max-width: 1023px) {
    /* All buttons get minimum touch target */
    button,
    a.btn,
    a.px-4,
    button.px-4,
    .sidebar-link,
    .nav-btn,
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Smaller icon buttons */
    .p-1\.5,
    .p-1,
    .p-2 {
        min-width: 36px;
        min-height: 36px;
        padding: 6px 8px;
    }

    /* Table action buttons */
    table button,
    table a {
        min-width: 32px;
        min-height: 32px;
        padding: 4px 8px;
    }

    /* Links that look like buttons */
    a[href="/items/export-order"],
    a[href*="/export/"],
    a[href*="/import/"] {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* === Scrollable Areas === */
@media (max-width: 767px) {
    .max-h-48,
    .max-h-32,
    .max-h-\[90vh\] {
        max-height: 200px !important;
    }

    .overflow-y-auto {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* === Better focus states for mobile === */
@media (max-width: 1023px) {
    *:focus {
        outline: 2px solid #0067c0;
        outline-offset: 2px;
    }

    button:focus-visible,
    a:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible {
        outline: 2px solid #0067c0;
        outline-offset: 2px;
    }
}

/* === Hide non-essential on very small screens === */
@media (max-width: 380px) {
    .text-xs.text-gray-500 {
        display: none;
    }

    .inline-block.px-3.py-1.rounded-full {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* === Transactions Page === */
@media (max-width: 767px) {
    /* Export section */
    .bg-white.rounded-lg.shadow.p-4 .flex.flex-wrap.gap-3 {
        flex-direction: column;
    }

    .bg-white.rounded-lg.shadow.p-4 .flex.flex-wrap.gap-3 a {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    /* Filter tabs */
    .bg-white.rounded-lg.shadow.p-4 .flex.space-x-4 {
        flex-wrap: wrap;
        gap: 8px;
    }

    .bg-white.rounded-lg.shadow.p-4 .flex.space-x-4 a {
        flex: 1 1 calc(50% - 4px);
        text-align: center;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Table adjustments */
    .min-w-full thead th {
        font-size: 10px;
        padding: 8px 4px;
    }

    .min-w-full tbody td {
        padding: 8px 4px;
        font-size: 12px;
    }

    /* Transaction type badges */
    .px-2.py-1.rounded-full.text-xs {
        font-size: 9px;
        padding: 2px 4px;
    }
}

/* === Details List Page === */
@media (max-width: 767px) {
    .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-3.xl\:grid-cols-4 {
        grid-template-columns: 1fr !important;
    }
}

/* === Routes Page === */
@media (max-width: 767px) {
    .route-card {
        padding: 12px !important;
    }

    .route-card .flex.items-center.justify-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .route-operations-list {
        max-height: 150px;
        overflow-y: auto;
    }

    .operation-item {
        padding: 8px;
        margin-bottom: 4px;
    }
}

/* === Equipment List === */
@media (max-width: 767px) {
    .equipment-grid {
        grid-template-columns: 1fr !important;
    }

    .equipment-card {
        padding: 16px !important;
    }

    .equipment-card .flex.items-center.gap-4 {
        flex-direction: column;
        align-items: flex-start;
    }

    .equipment-card .w-16.h-16 {
        width: 48px;
        height: 48px;
    }
}

/* === Import/Excel Page === */
@media (max-width: 767px) {
    .import-section {
        padding: 16px !important;
    }

    .file-drop-zone {
        padding: 32px 16px !important;
        min-height: 150px;
    }

    .mapping-table {
        font-size: 12px;
    }

    .mapping-table th,
    .mapping-table td {
        padding: 8px 4px;
    }

    /* Progress bar */
    .w-full.bg-gray-200.rounded-full.h-2\.5 {
        height: 8px;
    }
}

/* === Calendar & Gantt === */
@media (max-width: 767px) {
    .calendar-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .gantt-chart {
        min-width: 600px;
    }

    .fc-toolbar {
        flex-direction: column;
        gap: 8px;
    }

    .fc-toolbar-title {
        font-size: 16px !important;
    }

    .fc-button-group {
        flex-wrap: wrap;
    }
}
