/**
 * Единый файл стилей для всего приложения
 * Объединяет: style.css, sidebar.css, club.css, documents.css, modals.css, toast.css
 * и стили рабочего места администратора
 */

/* ============================================
   БАЗОВЫЕ СТИЛИ (из style.css)
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

body.has-sidebar {
    padding: 0;
    background: #f7fafc;
    margin: 0;
    overflow: hidden;
    height: 100vh;
}

.container {
    margin: 0 auto;
    max-width: none; /* на десктопе контент на всю ширину; ограничение только на узких экранах */
}

body.has-sidebar .container {
    max-width: 100%;
}

/* На небольших экранах — ограничиваем ширину контента, чтобы не упираться в края */
@media (max-width: 992px) {
    .container {
        max-width: 100%;
        box-sizing: border-box;
    }
}

.header {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body.has-sidebar .header {
    margin-top: 0;
}

.header h1 {
    font-size: 32px;
    color: #2d3748;
    margin-bottom: 8px;
}

.subtitle {
    color: #718096;
    font-size: 16px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clubs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    text-align: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #2d3748;
    padding: 10px 20px;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
}

.no-clubs {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    color: #718096;
}

/* Стили для страницы клуба */
.stats-section,
.navigation-section,
.info-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stats-section h2,
.navigation-section h2,
.info-section h2 {
    font-size: 24px;
    color: #2d3748;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 24px;
    color: white;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 40px;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

.top-spent-section {
    margin-top: 24px;
}

.top-spent-section h2 {
    margin-bottom: 16px;
}

.top-spent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-spent-item {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #f7fafc;
    border-radius: 8px;
    font-size: 15px;
}

.top-spent-item:nth-child(1) { background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%); color: #5a4a00; }
.top-spent-item:nth-child(2) { background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%); color: #4a4a4a; }
.top-spent-item:nth-child(3) { background: linear-gradient(135deg, #cd7f32 0%, #e8a857 100%); color: #4a3000; }
.top-spent-item:nth-child(n+4) { background: #edf2f7; color: #2d3748; }

.top-spent-rank {
    font-weight: 700;
    font-size: 18px;
    text-align: center;
}

.top-spent-login {
    font-weight: 500;
}

.top-spent-amount {
    font-weight: 700;
    color: inherit;
}

/* Таблицы */
.table-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f7fafc;
}

th {
    padding: 8px;
    text-align: left;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 2px solid #e2e8f0;
}

td {
    padding: 8px;
    border-bottom: 1px solid #f7fafc;
    color: #4a5568;
}

.workplace-container table th,
.workplace-container table td {
    padding: 8px;
}

tr:hover {
    background: #f7fafc;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2d3748;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input[type="datetime-local"],
.form-group input[data-type="date"],
.form-group input[data-type="time"],
.form-group input[data-type="datetime"] {
    font-family: inherit;
}

/* Demo banner - вынесен из inline стилей */
.demo-banner {
    background: #ffc107;
    color: #000;
    padding: 12px 20px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    border: 2px solid #ff9800;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.demo-banner a {
    color: #b45309;
    font-weight: 600;
    text-decoration: underline;
}
.demo-banner a:hover {
    color: #8b3d07;
}

.demo-banner-info {
    background: #e3f2fd;
    color: #1565c0;
    padding: 12px 20px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    border: 2px solid #2196f3;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ============================================
   БОКОВОЕ МЕНЮ (из sidebar.css)
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #2d3748 0%, #1a202c 100%);
    color: white;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-nav {
    padding: 10px 0;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-title {
    padding: 12px 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
}

.nav-link {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: #667eea;
}

.nav-link.active {
    background: rgba(102, 126, 234, 0.2);
    color: white;
    border-left-color: #667eea;
    font-weight: 500;
}

.main-content {
    margin-left: 280px;
    padding: 24px;
    min-height: 100vh;
    background: #f7fafc;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Панель вкладок открытых страниц */
.main-content > .tabs-bar {
    flex-shrink: 0;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    margin: -24px -24px 0 -24px;
    padding: 0 8px 0 0;
    min-height: 40px;
    display: flex;
    align-items: stretch;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
    direction: ltr;
}
.main-content > .tabs-bar-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    direction: ltr;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    min-width: 0;
}
.main-content > .tabs-bar-inner::-webkit-scrollbar {
    height: 4px;
}
.main-content > .tabs-bar-inner .tab-btn {
    display: inline-flex;
    flex-direction: row;
    flex-shrink: 0;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    white-space: nowrap;
    max-width: 180px;
    min-width: 0;
    transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1), transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.main-content > .tabs-bar-inner .tab-btn .tab-btn-label {
    overflow: hidden;
    text-overflow: ellipsis;
}
.main-content > .tabs-bar-inner .tab-btn:hover {
    background: #e2e8f0;
    color: #475569;
}
.main-content > .tabs-bar-inner .tab-btn.active {
    background: #fff;
    color: #0f172a;
    border-color: #e2e8f0;
    border-bottom: 2px solid #64748b;
    margin-bottom: -2px;
    padding-bottom: 6px;
    font-weight: 500;
}
.main-content > .tabs-bar-inner .tab-btn-close {
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
}
.main-content > .tabs-bar-inner .tab-btn-close:hover {
    color: #64748b;
    background: #e2e8f0;
}
.main-content > .tabs-panes {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}
.main-content > .tabs-panes > .tab-pane {
    display: none;
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    flex-direction: column;
    overflow: auto;
    transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1), transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.main-content > .tabs-panes > .tab-pane.active {
    display: flex;
}
.main-content > .tabs-panes > .tab-pane.tab-pane-closing-overlay {
    display: flex !important;
    position: absolute;
    inset: 0;
    z-index: 3;
    background: #f7fafc;
}
.main-content > .tabs-panes > .tab-pane.tab-pane-closing-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0);
    transition: background 1s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}
.main-content > .tabs-bar-inner .tab-btn.tab-btn-closing,
.sidebar.sidebar-1c .sidebar-tabs-wrap .tab-btn.tab-btn-closing {
    opacity: 0;
    transform: translateY(-2px) scale(0.985);
    pointer-events: none;
}
.main-content > .tabs-panes > .tab-pane.tab-pane-closing {
    opacity: 0;
    transform: scale(0.96);
    pointer-events: none;
}
.main-content > .tabs-panes > .tab-pane.tab-pane-closing.tab-pane-closing-overlay::after {
    background: rgba(15, 23, 42, 0);
}
.main-content > .tabs-panes > .tab-pane {
    position: relative;
}

.main-content > .tabs-panes > .tab-pane .tab-pane-iframe {
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    width: 100%;
    border: none;
    display: block;
    transition: opacity 0.15s ease-out;
}

.main-content > .tabs-panes > .tab-pane .tab-pane-drag-handle {
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    height: 20px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(180deg, rgba(100, 116, 139, 0.12) 0%, transparent 100%);
    border-radius: 12px 12px 0 0;
}

.main-content > .tabs-panes > .tab-pane .tab-pane-drag-handle:hover {
    background: linear-gradient(180deg, rgba(100, 116, 139, 0.2) 0%, transparent 100%);
}

.main-content > .tabs-panes > .tab-pane .tab-pane-drag-target {
    position: absolute;
    left: 0;
    right: 52px;
    top: 0;
    bottom: 0;
    cursor: move;
    pointer-events: auto;
}

.main-content > .tabs-panes > .tab-pane .tab-pane-drag-handle .tab-pane-close-mask {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-content > .tabs-panes > .tab-pane .tab-pane-drag-handle .tab-pane-close-mask-icon {
    font-size: 24px;
    line-height: 1;
    font-weight: 400;
    color: #64748b;
    transform: translateY(-3px);
}

.main-content > .tabs-panes > .tab-pane .tab-pane-resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 24px;
    height: 24px;
    cursor: nwse-resize;
    z-index: 2;
    background: linear-gradient(135deg, transparent 50%, rgba(100, 116, 139, 0.35) 50%);
    border-radius: 4px 0 0 0;
}

.main-content > .tabs-panes > .tab-pane .tab-pane-resize-handle:hover {
    background: linear-gradient(135deg, transparent 50%, rgba(100, 116, 139, 0.5) 50%);
}

.main-content > .tabs-panes > .tab-pane .tab-pane-resize-overlay {
    pointer-events: all;
}
.main-content > .tabs-panes > .tab-pane.tab-pane-initial-loading .tab-pane-iframe {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.main-content > .tabs-panes > .tab-pane.tab-pane-loading .tab-pane-iframe {
    opacity: 0.7;
    pointer-events: none;
}
.main-content > .tabs-panes > .tab-pane.tab-pane-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: rgba(0, 0, 0, 0.35);
    border-radius: 50%;
    animation: tab-pane-spin 0.6s linear infinite;
}
@keyframes tab-pane-spin {
    to { transform: rotate(360deg); }
}

/* Контент, загруженный во вкладке (iframe): без сайдбара, фрейм на всю высоту */
html.in-tab-frame, body.in-tab-frame { height: 100%; min-height: 100%; margin: 0; overflow: hidden; }
body.in-tab-frame .main-content {
    flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; height: 100%;
}
/* Форма документа во вкладке: main-content на всю высоту фрейма, скролл при длинном контенте */
body.in-tab-frame .main-content:has(.doc-form) {
    height: 100% !important;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}
body.in-tab-frame .main-content:has(.doc-form) .page-content-card {
    flex: 1 1 0;
    min-height: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
}
body.in-tab-frame .main-content:has(.doc-form) .page-content-card > .container {
    flex: 1 1 0;
    min-height: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
}
body.in-tab-frame .doc-form form:has(.doc-table-card) .doc-table-card .doc-form-table-scroll {
    flex: 1 1 0; min-height: 0; overflow: auto;
}
/* Карточка не скроллится целиком — высота передаётся вниз, скролл только у таблицы */
body.in-tab-frame .page-content-card {
    flex: 1 1 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column;
}
body.in-tab-frame .page-content-card > .container {
    flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
}
/* Списки: таблица на всю доступную высоту */
body.in-tab-frame .doc-list { flex: 1 1 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
body.in-tab-frame .doc-list .doc-table-wrap { flex: 1 1 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
body.in-tab-frame .doc-list .doc-list-table-scroll { flex: 1 1 0; min-height: 0; overflow: auto; }
body.in-tab-frame .doc-list .doc-list-table-totals-wrap { min-height: 0; }
/* Отчёты во вкладке: та же цепочка — таблица на всю высоту */
body.in-tab-frame .main-content:has(.report-page.report-1c) .page-content-card,
body.in-tab-frame .main-content:has(.report-page.report-1c) .page-content-card > .container { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
body.in-tab-frame .main-content:has(.report-page.report-1c) .club-stats-page { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
body.in-tab-frame .report-page.report-1c { flex: 1 1 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
body.in-tab-frame .report-page.report-1c .report-content-wrap { flex: 1 1 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
body.in-tab-frame .report-page.report-1c .report-content-wrap .doc-table-wrap { flex: 1 1 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
body.in-tab-frame .report-page.report-1c .doc-list-table-scroll { flex: 1 1 0; min-height: 0; overflow: auto; }
/* Форма документа во вкладке (списки): контейнер на всю высоту */
body.in-tab-frame .main-content:has(.doc-list) .page-content-card > .container {
    flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
}
body.in-tab-frame .sidebar,
body.in-tab-frame .sidebar-overlay,
body.in-tab-frame .sidebar-toggle,
body.in-tab-frame .main-content > .tabs-bar {
    display: none !important;
}
body.tab-autoclose-pending .alert-success {
    display: none !important;
}
body.in-tab-frame .main-content {
    margin-left: 0 !important;
}
body:has(.sidebar.sidebar-1c).in-tab-frame .main-content {
    margin-left: 0 !important;
}

/* Карточка контента страницы — на всю рабочую область с отступами со всех сторон */
.page-content-card {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    box-sizing: border-box;
}

/* Контент внутри карточки занимает всё доступное место, отступы сверху/снизу/по бокам */
.page-content-card > .container {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 24px;
}
/* Область с таблицей (платежи и др.) — на всю ширину карточки, таблица растягивается */
.page-content-card > .container > .table-container {
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    width: 100%;
    overflow: auto;
}
.page-content-card > .container > .table-container table {
    width: 100%;
}

/* На club.php контент уже в одной карточке — секции не дублируем карточным видом */
.page-content-card .stats-section,
.page-content-card .info-section,
.page-content-card .navigation-section {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    margin-bottom: 0;
    padding: 24px;
}
.page-content-card .stats-section:not(:first-child),
.page-content-card .info-section:not(:first-child),
.page-content-card .navigation-section:not(:first-child) {
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}
.page-content-card .info-section:last-child {
    padding-bottom: 24px;
}

/* ============================================
   БОКОВОЕ МЕНЮ — стиль "разделы как в 1С"
   ============================================ */

/* Левое меню ~254px (увеличено на ~15% для гармонии) */
body:has(.sidebar.sidebar-1c) .main-content {
    margin-left: 290px;
}

.sidebar.sidebar-1c {
    width: 290px;
    overflow: visible;
    display: flex;
    flex-direction: row;
    flex-shrink: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
    border: none;
}

.sidebar.sidebar-1c .sidebar-1c-rail {
    width: 290px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 12px;
    box-sizing: border-box;
    flex-shrink: 0;
    background: #fff;
}

/* Кнопка «Закрыть» в рейле — по умолчанию скрыта (на десктопе меню не закрывают) */
.sidebar-1c-close-btn {
    display: none;
    width: 100%;
    margin: 0;
    padding: 14px 18px;
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    background: #f8fafc;
    color: #475569;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    flex-shrink: 0;
    min-height: 48px;
    align-items: center;
    box-sizing: border-box;
}
.sidebar-1c-close-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

/* Главные разделы — прижаты к верху */
.sidebar.sidebar-1c .sidebar-1c-sections {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex-shrink: 0;
    justify-content: flex-start;
}

/* Область вкладок в сайдбаре: отступ сверху, затем список вкладок */
.sidebar.sidebar-1c .sidebar-tabs-wrap {
    flex: 1 1 0;
    min-height: 0;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.sidebar.sidebar-1c .sidebar-tabs-wrap .tabs-bar {
    flex: 1 1 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}
.sidebar.sidebar-1c .sidebar-tabs-wrap .tabs-bar-inner {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-x: visible;
    overflow-y: auto;
    flex-wrap: nowrap;
    direction: ltr;
    align-items: stretch;
}
.sidebar.sidebar-1c .sidebar-tabs-wrap .tab-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 12px;
    color: #64748b;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    transition: opacity 1.5s cubic-bezier(0.22, 1, 0.36, 1), transform 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.sidebar.sidebar-1c .sidebar-tabs-wrap .tab-btn .tab-btn-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}
.sidebar.sidebar-1c .sidebar-tabs-wrap .tab-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #374151;
}
.sidebar.sidebar-1c .sidebar-tabs-wrap .tab-btn.active {
    background: #fff;
    color: #1e293b;
    border-color: rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid #64748b;
    margin-bottom: 0;
    padding-bottom: 5px;
    font-weight: 500;
}
.sidebar.sidebar-1c .sidebar-tabs-wrap .tab-btn-close {
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
}
.sidebar.sidebar-1c .sidebar-tabs-wrap .tab-btn-close:hover {
    color: #64748b;
    background: rgba(0, 0, 0, 0.06);
}

.sidebar.sidebar-1c .sidebar-1c-bottom {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 0;
    border-top: none;
    flex-shrink: 0;
}

/* Разделы — без полосок; справа стрелка «можно развернуть» */
.sidebar.sidebar-1c .sidebar-1c-section-btn {
    position: relative;
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #374151;
    cursor: pointer;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
    user-select: none;
}

.sidebar.sidebar-1c .sidebar-1c-section-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #facc15;
    border-radius: 6px 0 0 6px;
    opacity: 0;
    transition: opacity 0.12s ease;
}

.sidebar.sidebar-1c .sidebar-1c-section-btn:hover::before,
.sidebar.sidebar-1c .sidebar-1c-section-btn.active::before {
    opacity: 1;
}

.sidebar.sidebar-1c .sidebar-1c-section-btn::after {
    content: '›';
    font-size: 18px;
    font-weight: 700;
    color: #9ca3af;
    margin-left: auto;
    flex-shrink: 0;
    transition: color 0.12s ease, transform 0.12s ease;
}

.sidebar.sidebar-1c .sidebar-1c-section-btn:hover::after {
    color: #6b7280;
    transform: translateX(2px);
}

.sidebar.sidebar-1c .sidebar-1c-section-btn:hover {
    background: #fff;
    color: #1e293b;
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.sidebar.sidebar-1c .sidebar-1c-section-btn.active {
    background: #fff;
    color: #374151;
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* Кнопка — часть формы: при открытой панели кнопка без правой границы, форма примыкает вплотную */
.sidebar.sidebar-1c.panel-open .sidebar-1c-section-btn.active {
    border-right: none;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: none;
}

.sidebar.sidebar-1c .sidebar-1c-section-btn.active::after {
    color: #6b7280;
}

.sidebar.sidebar-1c .sidebar-1c-section-icon {
    font-size: 20px;
    line-height: 1;
}

.sidebar.sidebar-1c .sidebar-1c-section-label {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    text-align: left;
}

.sidebar.sidebar-1c .sidebar-1c-section-btn .sidebar-1c-section-icon {
    flex-shrink: 0;
}

/* Панель — вторая часть одной "формы": одна общая обводка кнопка → полоска → панель */
.sidebar.sidebar-1c .sidebar-1c-panel {
    position: absolute;
    left: 0;
    top: 0;
    height: auto;
    max-height: min(90vh, calc(100vh - 24px));
    min-height: 44px;
    width: min(460px, calc(100vw - 100px));
    max-width: 90vw;
    margin-right: 12px;
    margin-bottom: 12px;
    background: #fff;
    color: #374151;
    border: 1px solid rgba(0,0,0,0.08);
    border-left: none;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transform-origin: left center;
    transform: scaleX(0);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease-out, transform 0.22s ease-out;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    z-index: 1001;
}

.sidebar.sidebar-1c .sidebar-1c-panel.open {
    transform: scaleX(1);
    opacity: 1;
    pointer-events: auto;
}

.sidebar.sidebar-1c .sidebar-1c-panel.panel-general.open {
    width: min(740px, calc(100vw - 100px));
}

.sidebar-1c-panel-back {
    display: none;
    width: 100%;
    margin: 0;
    padding: 14px 18px;
    border: none;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    background: #f8fafc;
    color: #475569;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    flex-shrink: 0;
    min-height: 48px;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}
.sidebar-1c-panel-back:hover {
    background: #f1f5f9;
    color: #334155;
}

.sidebar.sidebar-1c .sidebar-1c-panel-body {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 20px 18px;
    background: #fff;
    border-radius: 14px;
}

.sidebar.sidebar-1c .sidebar-1c-panel-section {
    display: none;
}

.sidebar.sidebar-1c .sidebar-1c-panel-section.active {
    display: block;
}

/* Общий раздел: только когда активен; grid без дублирования с другими разделами */
.sidebar.sidebar-1c .sidebar-1c-panel-section.active[data-section="general"] {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.sidebar.sidebar-1c .sidebar-1c-general-content {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 24px;
    align-items: start;
}
.sidebar.sidebar-1c .sidebar-1c-general-col {
    min-width: 0;
    overflow: hidden;
}
.sidebar.sidebar-1c .sidebar-1c-general-col-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #6b7280;
    text-transform: uppercase;
    padding: 0 0 8px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    line-height: 1.3;
}

.sidebar.sidebar-1c .sidebar-1c-panel-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #6b7280;
    text-transform: uppercase;
    padding: 10px 0 8px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    margin: 0;
    background: transparent;
}

/* Подпункты — аккуратные ссылки с иконками, без квадратных кнопок */
.sidebar.sidebar-1c .sidebar-1c-panel-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Много пунктов в подразделе — в несколько колонок вправо */
.sidebar.sidebar-1c .sidebar-1c-panel-items.sidebar-1c-panel-items-cols {
    column-width: 200px;
    column-gap: 20px;
    column-fill: balance;
}
.sidebar.sidebar-1c .sidebar-1c-panel-items.sidebar-1c-panel-items-cols .sidebar-1c-item {
    break-inside: avoid;
    page-break-inside: avoid;
}

.sidebar.sidebar-1c .sidebar-1c-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    background: transparent;
    transition: color 0.15s ease, background 0.15s ease;
    min-height: 0;
    box-sizing: border-box;
}

.sidebar.sidebar-1c .sidebar-1c-item:hover {
    color: #111827;
    background: rgba(0,0,0,0.04);
}

.sidebar.sidebar-1c .sidebar-1c-item.active {
    color: #374151;
    font-weight: 600;
}

.sidebar.sidebar-1c .sidebar-1c-item.active:hover {
    color: #111827;
}

.sidebar.sidebar-1c .sidebar-1c-item-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: rgba(0,0,0,0.05);
    display: grid;
    place-items: center;
    flex: 0 0 22px;
    font-size: 14px;
    transition: background 0.15s ease;
}

.sidebar.sidebar-1c .sidebar-1c-item:hover .sidebar-1c-item-icon {
    background: rgba(0,0,0,0.08);
}

.sidebar.sidebar-1c .sidebar-1c-item-label {
    font-size: 13px;
    font-weight: 500;
    color: inherit;
    flex: 1;
    text-align: left;
}

.sidebar.sidebar-1c .sidebar-1c-profile-card {
    padding: 12px 14px;
    border: none;
    border-top: 1px solid rgba(0,0,0,0.08);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    border-radius: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
}

.sidebar.sidebar-1c .sidebar-1c-profile-name {
    font-weight: 700;
    color: #374151;
}

.sidebar.sidebar-1c .sidebar-1c-logout {
    text-decoration: none;
    color: #dc2626;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 0;
    background: transparent;
    border: 1px solid rgba(220,38,38,0.18);
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: #5568d3;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

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

/* ============================================
   ДОПОЛНИТЕЛЬНЫЕ СТИЛИ КЛУБА (из club.css)
   ============================================ */

.actions-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #c6f6d5;
    color: #22543d;
}

.badge-danger {
    background: #fed7d7;
    color: #742a2a;
}

.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #48bb78;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #f56565;
}

.alert-info {
    background: #bee3f8;
    color: #2c5282;
    border-left: 4px solid #4299e1;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #fbbf24;
}

/* ============================================
   МОДАЛЬНЫЕ ОКНА (из modals.css)
   ============================================ */

.modal:not(.active):not(.show),
.doc-period-modal:not(.show) {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: auto;
    margin: 0;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.modal,
.doc-period-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    overflow: auto;
    margin: 0;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    box-sizing: border-box;
}

.modal.active,
.modal.show,
.doc-period-modal.show {
    display: flex;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.modal-content,
.doc-period-modal .modal-box {
    background: #ffffff;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
    width: auto;
    max-width: 600px;
    min-width: 450px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    margin: 40px auto;
    align-self: center;
    justify-self: center;
    z-index: 10001;
    display: block;
    box-sizing: border-box;
    color: #2d3748;
}

.doc-period-modal .modal-box {
    max-width: 500px;
    background: white;
}

.modal-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    padding-top: 16px;
    border-bottom: 2px solid #e2e8f0;
    min-height: 60px;
    width: 100%;
    box-sizing: border-box;
}

.modal-header h3 {
    margin: 0;
    font-size: 24px;
    color: #2d3748;
    font-weight: 600;
    line-height: 1.5;
    padding: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.modal-close {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 20px;
    font-weight: 400;
    cursor: pointer;
    color: #64748b;
    padding: 0;
    width: 36px;
    height: 36px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    opacity: 1;
    margin-left: 16px;
    order: 2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.modal-close:hover {
    color: #1e293b;
    background: #f1f5f9;
    border-color: #cbd5e0;
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-close:active {
    transform: scale(0.95);
}

.modal-form-group,
.doc-period-modal .step {
    margin-bottom: 20px;
}

.modal-form-group label,
.doc-period-modal .step label {
    display: block;
    margin-bottom: 8px;
    color: #2d3748;
    font-weight: 500;
    font-size: 14px;
}

.modal-form-group input,
.modal-form-group select,
.modal-form-group textarea,
.doc-period-modal .step input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
    box-sizing: border-box;
    background: #ffffff;
}

.modal-form-group input:focus,
.modal-form-group select:focus,
.modal-form-group textarea:focus,
.doc-period-modal .step input:focus {
    outline: none;
    border-color: #667eea;
}

.modal-form-group textarea,
.modal-content textarea,
#closeShiftModal textarea,
.modal textarea {
    resize: vertical;
    min-height: 80px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
    box-sizing: border-box;
    background: #ffffff;
}

.modal-form-group textarea:focus,
.modal-content textarea:focus,
#closeShiftModal textarea:focus,
.modal textarea:focus {
    outline: none;
    border-color: #667eea;
}

.modal-form-group input:disabled,
.doc-period-modal .step input:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.doc-period-modal .modal-hint {
    margin: 0 0 24px 0;
    color: #64748b;
    font-size: 14px;
}

.payment-type-group {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-top: 10px;
    width: 100%;
    align-items: center;
}

.payment-type-radio {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    height: 44px;
    max-height: 44px;
    background-color: #ffffff;
    position: relative;
    user-select: none;
    box-sizing: border-box;
    margin: 0;
}

.payment-type-radio > div {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
}

.payment-type-radio input[type="radio"] {
    display: none;
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    visibility: hidden;
}

.payment-type-radio.selected,
label.payment-type-radio.selected,
.modal .payment-type-radio.selected,
.modal-content .payment-type-radio.selected {
    border-color: #667eea;
    background-color: #667eea;
    color: #ffffff;
}

.payment-type-radio.selected > div,
label.payment-type-radio.selected > div,
.modal .payment-type-radio.selected > div,
.modal-content .payment-type-radio.selected > div {
    color: #ffffff;
}

.payment-type-radio:not(.selected),
label.payment-type-radio:not(.selected),
.modal .payment-type-radio:not(.selected),
.modal-content .payment-type-radio:not(.selected) {
    background-color: #ffffff;
    color: #334155;
}

.payment-type-radio:hover:not(.selected),
label.payment-type-radio:hover:not(.selected),
.modal .payment-type-radio:hover:not(.selected),
.modal-content .payment-type-radio:hover:not(.selected) {
    border-color: #cbd5e0;
    background-color: #f8fafc;
}

.payment-type-radio:hover.selected,
label.payment-type-radio:hover.selected,
.modal .payment-type-radio:hover.selected,
.modal-content .payment-type-radio:hover.selected {
    border-color: #5568d3;
    background-color: #5568d3;
}

.modal-actions,
.doc-period-modal .modal-actions {
    margin-top: 28px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.modal-actions .btn,
.modal-actions button,
.doc-period-modal .modal-actions .btn {
    padding: 12px 24px;
    font-size: 15px;
    min-width: 120px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-actions .btn-modal-primary,
.modal-actions button[type="submit"] {
    background: #667eea;
    color: white;
}

.modal-actions .btn-modal-primary:hover:not(:disabled),
.modal-actions button[type="submit"]:hover:not(:disabled) {
    background: #5568d3;
}

.modal-actions .btn-modal-secondary,
.modal-actions button[type="button"].btn-secondary,
.modal-actions .btn-secondary {
    background: #e2e8f0;
    color: #2d3748;
}

.modal-actions .btn-modal-secondary:hover,
.modal-actions button[type="button"].btn-secondary:hover,
.modal-actions .btn-secondary:hover {
    background: #cbd5e0;
}

/* ============================================
   TOAST УВЕДОМЛЕНИЯ (из toast.css)
   ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: #fff;
    border-radius: 8px;
    padding: 14px 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease-out;
    border-left: 4px solid;
    min-width: 300px;
    max-width: 400px;
}

.toast.toast-error {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.toast.toast-warning {
    border-left-color: #ffc107;
    background: #fffef0;
}

.toast.toast-success {
    border-left-color: #28a745;
    background: #f0fff4;
}

.toast.toast-info {
    border-left-color: #17a2b8;
    background: #f0f9ff;
}

.toast-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast.toast-error .toast-icon {
    color: #dc3545;
}

.toast.toast-warning .toast-icon {
    color: #ffc107;
}

.toast.toast-success .toast-icon {
    color: #28a745;
}

.toast.toast-info .toast-icon {
    color: #17a2b8;
}

.toast-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #333;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

.toast.toast-removing {
    animation: toastSlideOut 0.3s ease-in forwards;
}

/* ============================================
   СТИЛИ ДОКУМЕНТОВ (из documents.css)
   ============================================ */

.main-content:has(.doc-form) {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
}

.main-content:has(.doc-form) .page-content-card {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.main-content:has(.doc-form) .container.doc-form-full {
    max-width: none;
    width: 100%;
    padding: 24px;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    justify-content: flex-start;
}

.main-content:has(.doc-form) .container.doc-form-full > .alert {
    flex-shrink: 0;
}

/* Список документов: занимает весь экран по высоте, таблица и подвал прижаты */
.main-content:has(.doc-list) {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

.main-content:has(.doc-list) .page-content-card {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.main-content:has(.doc-list) .container {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: none;
    padding-left: 24px;
    padding-right: 24px;
    overflow: hidden;
}

.doc-list {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
}

.doc-list .doc-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.doc-list .doc-toolbar .doc-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

.doc-list .doc-table-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Область скролла: контент от верха, таблица на всю ширину, при пустом списке — блок занимает высоту */
.doc-list .doc-list-table-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
    display: block;
    width: 100%;
}
.doc-list .doc-list-table-scroll .doc-table {
    width: 100%;
}

/* Область скролла — только таблица; итоговая строка вынесена из скролла и прижата к низу */
.doc-list .doc-list-table-totals-wrap {
    width: 100%;
    min-width: 0;
    display: block;
}

.doc-list .doc-list-table-totals-wrap .doc-table {
    width: 100%;
}

/* Итоговая строка — прямой потомок doc-table-wrap, прижата к низу, не скроллится */
.doc-list .doc-table-wrap > .doc-list-totals-bar {
    flex-shrink: 0;
}

.doc-list .doc-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: auto;
}

.doc-list .doc-table th {
    text-align: left;
    padding: 8px 12px;
    background: #f8fafc;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: 0 1px 0 0 #e2e8f0;
    white-space: nowrap;
    min-width: 7rem;
}

.doc-list .doc-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #334155;
    min-width: 7rem;
}

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

.doc-list .doc-table tbody tr:hover {
    background: #f8fafc;
}

.doc-list .doc-table .doc-list-empty {
    text-align: center;
    padding: 48px 20px;
    color: #94a3b8;
    font-size: 15px;
}

/* Фрейм отчётов = как список документов «Приходная накладная»: таблица разворачивается до низа экрана */
.main-content:has(.report-page.report-1c) {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}
.main-content:has(.report-page.report-1c) .page-content-card {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}
.main-content:has(.report-page.report-1c) .container {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: none;
    overflow: hidden;
}
.main-content:has(.report-page.report-1c) .club-stats-page {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

.report-page.report-1c {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
}
.report-page.report-1c .doc-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    flex-shrink: 0;
}
.report-page.report-1c .doc-toolbar .doc-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}
.report-page.report-1c .doc-table-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.report-page.report-1c .doc-list-table-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
    display: block;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}
.report-page.report-1c .doc-list-table-scroll .doc-table {
    width: 100%;
}
.report-page.report-1c .doc-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: auto;
}
.report-page.report-1c .doc-table .doc-list-empty {
    text-align: center;
    padding: 48px 20px;
    color: #94a3b8;
    font-size: 15px;
}
.report-page.report-1c .report-toolbar {
    flex-shrink: 0;
}
.report-page.report-1c .report-content-wrap {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}
.report-page.report-1c .report-content-wrap .stats-dashboard,
.report-page.report-1c .report-content-wrap .report-summary {
    flex-shrink: 0;
}
.report-page.report-1c .report-content-wrap .doc-table-wrap {
    flex: 1 1 0;
    min-height: 0;
}
.report-page.report-1c .report-content-wrap.report-content-wrap-scroll {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* Палитра отчётов = как у списков документов (.doc-list): светлые таблицы, без тёмных шапок */
.report-page.report-1c .doc-table th,
.report-page.report-1c .report-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 0 0 #e2e8f0;
}
.report-page.report-1c .doc-table td,
.report-page.report-1c .report-table td {
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}
.report-page.report-1c .doc-table tbody tr:hover,
.report-page.report-1c .report-table tbody tr:hover {
    background: #f8fafc;
}
.report-page.report-1c .report-table .report-row-total,
.report-page.report-1c .report-table .report-row-total td {
    background: #f8fafc !important;
    color: #334155 !important;
    font-weight: 700;
    border-bottom: 1px solid #e2e8f0;
}
.report-page.report-1c .report-table .report-group-header {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
}
.report-page.report-1c .report-table .report-row-subtotal {
    background: #f8fafc;
    font-weight: 600;
}
.report-page.report-1c .report-table .report-row-subtotal td {
    border-top: 1px solid #e2e8f0;
}
.report-page.report-1c .report-shift-header,
.report-page.report-1c .report-contractor-header {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    font-weight: 600;
}
.report-page.report-1c .report-shift-header:hover,
.report-page.report-1c .report-contractor-header:hover {
    background: #f1f5f9;
}
.report-page.report-1c .report-shift-summary {
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    color: #475569;
}
.report-page.report-1c .report-contractor-block {
    background: #fff;
    border: 1px solid #e2e8f0;
}
.report-page.report-1c .report-table .report-income { color: #166534; }
.report-page.report-1c .report-table .report-expense { color: #b91c1c; }
.report-page.report-1c .stats-dashboard {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.report-page.report-1c .stats-dashboard h2 { color: #334155; }
.report-page.report-1c .stats-kpi-card {
    background: #fff;
    border: 1px solid #e2e8f0;
}
.report-page.report-1c .stats-kpi-card .stats-kpi-label { color: #64748b; }
.report-page.report-1c .stats-kpi-card .stats-kpi-value { color: #334155; }
.report-page.report-1c .stats-kpi-card.income .stats-kpi-value { color: #166534; }
.report-page.report-1c .stats-kpi-card.expense .stats-kpi-value { color: #b91c1c; }
.report-page.report-1c .report-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}
.report-page.report-1c .report-summary-item .label { color: #64748b; }
.report-page.report-1c .report-summary-item .value { color: #334155; }
.report-page.report-1c .report-summary-item.income .value { color: #166534; }
.report-page.report-1c .report-summary-item.expense .value { color: #b91c1c; }
.report-page.report-1c .report-summary-item.balance .value { color: #334155; }

/* Отчёты (report-1c): мобильная адаптация */
@media (max-width: 768px) {
    .main-content:has(.report-page.report-1c) .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    .report-page.report-1c .doc-toolbar { margin-bottom: 12px; }
    .report-page.report-1c .doc-toolbar .doc-title { font-size: 1.25rem; word-break: break-word; }
    .report-page.report-1c .report-toolbar { gap: 10px; margin-bottom: 12px; }
    .report-page.report-1c .report-toolbar form { width: 100%; }
    .report-page.report-1c .report-period { width: 100%; font-size: 13px; }
    .report-page.report-1c .report-actions { flex-wrap: wrap; }
    .report-page.report-1c .stats-dashboard { margin-top: 16px; padding: 14px; }
    .report-page.report-1c .stats-dashboard h2 { font-size: 16px; margin-bottom: 12px; }
    .report-page.report-1c .stats-kpi { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
    .report-page.report-1c .stats-kpi-card { padding: 10px 12px; }
    .report-page.report-1c .stats-kpi-card .stats-kpi-value { font-size: 16px; }
    .report-page.report-1c .doc-list-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .report-page.report-1c .report-table th,
    .report-page.report-1c .report-table td { padding: 6px 10px; font-size: 13px; }
    .report-page.report-1c .report-shift-header,
    .report-page.report-1c .report-contractor-header { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
    .report-page.report-1c .report-shift-header h3,
    .report-page.report-1c .report-contractor-header > span:not(.report-shift-toggle):not(.report-contractor-toggle) { font-size: 14px; word-break: break-word; flex: 1 1 100%; }
    .report-page.report-1c .report-shift-meta { font-size: 12px; flex: 1 1 100%; opacity: 0.95; }
    .report-page.report-1c .report-shift-summary { padding: 10px 12px; flex-wrap: wrap; gap: 8px; font-size: 12px; }
}

.doc-list .doc-list-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    padding: 12px 0 16px 0;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.doc-list .doc-list-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    flex: 1 1 0;
    min-width: 0;
}

.doc-list .doc-list-search-form .doc-list-create,
.doc-list .doc-list-search-form .doc-list-delete {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 13px;
    height: auto;
    line-height: 1.5;
}

.doc-list .doc-list-search-input {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    height: auto;
    line-height: 1.5;
}

.doc-list .doc-list-search-form .btn {
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.5;
    height: auto;
}

.doc-list .doc-list-search-input:focus {
    border-color: #6366f1;
    outline: none;
}

.doc-list .doc-list-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.doc-list .doc-list-filters label {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    line-height: 1.5;
}

.doc-list .doc-list-filters select {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    height: auto;
    box-sizing: border-box;
    background: #fff;
    color: #334155;
    cursor: pointer;
    transition: border-color 0.2s;
}

.doc-list .doc-list-filters select:focus {
    border-color: #6366f1;
    outline: none;
}

.doc-list .doc-list-filters .btn {
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.5;
    height: auto;
    border-radius: 8px;
}

/* Меню «Фильтры и действия» — на десктопе: первая строка = Создать, Удалить, Поиск, Найти; вторая = фильтры */
.doc-list-filters-with-menu {
    position: relative;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
}

/* Первая строка (полная ширина): Создать, Удалить выделенные, Поиск, Найти */
.doc-list-filters-with-menu .doc-list-search-row {
    order: -1;
    width: 100%;
    margin-bottom: 0;
}

/* На десктопе содержимое выпадающего меню участвует в потоке (вторая строка: триггер + период) */
.doc-list-filters-with-menu .doc-list-filters-dropdown {
    display: contents;
}

.doc-list-filters-trigger {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.doc-list-filters-trigger:hover {
    background: #f8fafc;
    border-color: #cbd5e0;
}

.doc-list-filters-trigger::after {
    content: '';
    border: 5px solid transparent;
    border-top-color: currentColor;
    margin-left: 4px;
    opacity: 0.7;
}

.doc-list-filters-with-menu.is-open .doc-list-filters-trigger::after {
    transform: rotate(180deg);
    border-top-color: transparent;
    border-bottom-color: currentColor;
}

.doc-list .doc-list-period-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.doc-list .doc-list-period-label {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.doc-list .doc-list-period-block {
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-list .doc-list-period-display {
    padding: 6px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
    min-width: 140px;
    height: auto;
    box-sizing: border-box;
}

.doc-list .doc-list-period-display.empty {
    color: #94a3b8;
}

.doc-list .doc-list-period-block .doc-period-btn-icon {
    width: auto;
    min-width: 36px;
    height: auto;
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    font-size: 16px;
    line-height: 1.5;
    cursor: pointer;
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-list .doc-list-period-block .doc-period-btn-icon:hover {
    background: #f1f5f9;
    border-color: #cbd5e0;
}

.doc-list .doc-list-search-row {
    margin-bottom: 16px;
    flex-shrink: 0;
}

.doc-list .doc-list-search-row .doc-list-search-form {
    margin-left: 0;
    width: 100%;
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    align-items: center;
}

.doc-list .doc-list-search-row .doc-list-search-input {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
}

.doc-list .doc-list-th-sort {
    padding: 0;
}

.doc-list .doc-list-th-sort .doc-list-sort-link {
    display: block;
    padding: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    position: relative;
    padding-right: 30px;
    box-sizing: border-box;
}

.doc-list .doc-list-th-sort .doc-list-sort-link::after {
    content: '⇅';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    opacity: 0.6;
    pointer-events: none;
}

.doc-list .doc-table:has(.doc-list-sort-link.active) .doc-list-th-sort .doc-list-sort-link:not(.active)::after {
    content: '';
    display: none;
    opacity: 0;
    pointer-events: none;
}

.doc-list .doc-table:has(.doc-list-sort-link.active) .doc-list-th-sort .doc-list-sort-link:not(.active):hover::after {
    content: '⇅';
    display: block;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    opacity: 1;
    pointer-events: none;
}

.doc-list .doc-table:not(:has(.doc-list-sort-link.active)) .doc-list-th-sort .doc-list-sort-link:hover::after {
    content: '⇅';
    color: #667eea;
    opacity: 1;
    font-weight: 700;
    pointer-events: none;
}

.doc-list .doc-list-th-sort .doc-list-sort-link.active {
    color: #475569;
    font-weight: 600;
    position: relative;
    font-size: 13px;
}

.doc-list .doc-list-th-sort .doc-list-sort-link.active::after {
    content: '▲';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    opacity: 1;
    pointer-events: none;
}

.doc-list .doc-list-th-sort .doc-list-sort-link.active[data-sort-order="desc"]::after,
.doc-list .doc-list-th-sort .doc-list-sort-link.active[data-sort-order="DESC"]::after {
    content: '▼';
}

.doc-list .doc-list-th-sort .doc-list-sort-link.active[data-sort-order="asc"]::after,
.doc-list .doc-list-th-sort .doc-list-sort-link.active[data-sort-order="ASC"]::after {
    content: '▲';
}

.doc-list .doc-list-th-sort .doc-list-sort-link:hover {
    background: transparent;
    color: #475569;
}

.doc-list .doc-list-th-sort .doc-list-sort-link.active:hover {
    background: transparent;
    color: #475569;
}

.doc-list .doc-list-per-page-select {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    margin-left: 6px;
}

.doc-list .doc-list-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px 24px;
    margin-top: auto;
    flex-shrink: 0;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.doc-list .doc-list-pagination-per-page {
    font-size: 13px;
    color: #64748b;
}

.doc-list .doc-list-pagination-info {
    font-size: 13px;
    color: #64748b;
}

.doc-list .doc-list-pagination-links {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* При бесконечной подгрузке: без выбора «На странице» и без ссылок на страницы */
.doc-list[data-infinite-scroll="1"] .doc-list-pagination-links {
    display: none !important;
}
.doc-list[data-infinite-scroll="1"] .doc-list-pagination-per-page {
    display: none !important;
}
.doc-list[data-infinite-scroll="1"] .doc-list-scroll-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.doc-list[data-infinite-scroll="1"] .doc-list-scroll-buttons .btn-scroll-to {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    text-decoration: none;
}
.doc-list[data-infinite-scroll="1"] .doc-list-scroll-buttons .btn-scroll-to:hover {
    background: #f1f5f9;
    border-color: #cbd5e0;
}

.doc-list .doc-list-pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 14px;
    color: #475569;
    text-decoration: none;
    border-radius: 6px;
}

.doc-list .doc-list-pagination-link:hover {
    background: #f1f5f9;
    color: #334155;
}

.doc-list .doc-list-pagination-link.current {
    background: #6366f1;
    color: #fff;
    font-weight: 500;
}

.doc-list .doc-list-actions .btn {
    padding: 6px 12px;
    font-size: 13px;
}

/* Управление лицензиями: единый стиль кнопок и плашки */
.doc-list-actions-licenses {
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.doc-list-actions-licenses .lic-total-sum {
    display: none;
    margin-left: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    background: #48bb78;
    color: #fff;
}
.doc-list-actions-licenses .lic-total-sum.is-visible {
    display: inline-block;
}
.lic-renew-info {
    background: #e6fffa;
    border: 1px solid #81e6d9;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #234e52;
}
.lic-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.doc-list .doc-table .lic-row-actions .btn {
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
}
.doc-list .doc-table .lic-form-inline {
    display: inline-block;
    margin: 0;
}
.doc-list .doc-table .lic-btn-link {
    text-decoration: none;
    width: auto;
    min-width: auto;
    box-sizing: border-box;
}
.doc-list .doc-table .lic-no-bind {
    color: #a0aec0;
    font-size: 13px;
}

.doc-list .doc-table th.doc-list-col-check,
.doc-list .doc-table td.doc-list-col-check {
    width: 40px;
    text-align: center;
    vertical-align: middle;
}

.doc-list .doc-table input[type="checkbox"].doc-list-row-check {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.doc-list .doc-table tbody tr.doc-list-row {
    cursor: pointer;
}

.doc-list .doc-table tbody tr.doc-list-row.selected {
    background: #e0e7ff;
}

.doc-list .doc-table tbody tr.doc-list-row.selected:hover {
    background: #c7d2fe;
}

.doc-list .doc-table tbody tr.doc-list-row.doc-list-row-opened {
    background: #dbeafe;
    box-shadow: inset 0 0 0 2px #3b82f6;
}

.doc-list .doc-table tbody tr.doc-list-row.doc-list-row-opened:hover {
    background: #bfdbfe;
}

.doc-list .doc-table th.doc-list-num,
.doc-list .doc-table td.doc-list-num {
    min-width: 5.5rem;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.doc-list .doc-list-totals-bar {
    flex-shrink: 0;
    border-top: 2px solid #cbd5e0;
    background: #f1f5f9;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.doc-list .doc-list-totals-bar::-webkit-scrollbar {
    display: none;
}

/* Итоги-сводка (регистр продаж и т.п.): не по колонкам, с переносом, побольше места */
.doc-list .doc-list-totals-bar-summary {
    overflow: visible;
    padding: 16px 24px;
}
.doc-list .doc-list-totals-summary-items {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    align-items: baseline;
}
.doc-list .doc-list-totals-summary-item {
    white-space: nowrap;
    font-size: 15px;
}
.doc-list .doc-list-totals-summary-item .doc-list-num {
    font-variant-numeric: tabular-nums;
}
.doc-list .doc-list-totals-bar-summary .doc-list-totals-summary-label {
    color: #64748b;
}

.doc-list .doc-list-totals-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.doc-list .doc-list-totals-table .doc-list-totals-row td {
    min-width: 7rem;
}

.doc-list .doc-list-totals-table .doc-list-totals-row .doc-list-num {
    min-width: 5.5rem;
}

.doc-list .doc-list-totals-table .doc-list-totals-row td {
    padding: 12px 20px;
    font-size: 14px;
    border: none;
    background: #f1f5f9;
}

.doc-list .doc-list-totals-table .doc-list-totals-row .doc-list-num {
    font-weight: 600;
}

.doc-form {
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.doc-form form {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}


/* Документ: реквизиты слева (30%), таблицы справа — строка с таблицей растягивается на доступную высоту */
.doc-form form:has(.doc-table-card) {
    display: grid;
    grid-template-columns: minmax(320px, 30%) minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    gap: 16px;
    align-items: stretch;
    justify-content: stretch;
}
.doc-form form:has(.doc-table-card) .doc-header {
    align-self: start;
}

.doc-form form:has(.doc-table-card) .doc-toolbar {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.doc-form form:has(.doc-table-card) .doc-header {
    grid-column: 1;
    grid-row: 2;
    margin-bottom: 0;
    min-width: 0;
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.doc-form form:has(.doc-table-card) .doc-table-card {
    grid-column: 2;
    grid-row: 2;
    margin-bottom: 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.doc-form form:has(.doc-table-card) .doc-form-actions {
    grid-column: 1 / -1;
    grid-row: 3;
}

@media (max-width: 1100px) {
    .doc-form form:has(.doc-table-card) {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr auto;
    }
    .doc-form form:has(.doc-table-card) .doc-header {
        grid-column: 1;
        grid-row: 2;
    }
    .doc-form form:has(.doc-table-card) .doc-table-card {
        grid-column: 1;
        grid-row: 3;
    }
}

.doc-form .doc-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.doc-form .doc-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 20px 0;
    margin-top: auto;
    flex-shrink: 0;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.doc-form .doc-toolbar .doc-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    order: 2;
    margin-left: auto;
}

.doc-form .doc-toolbar .doc-toolbar-actions a,
.doc-form .doc-toolbar .doc-toolbar-actions button {
    white-space: nowrap;
}

.tab-close-control.tab-close-floating-btn {
    position: fixed !important;
    top: 16px !important;
    right: 16px !important;
    z-index: 1200 !important;
    margin: 0 !important;
}

.tab-close-control.tab-close-icon-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 24px;
    line-height: 1;
    font-weight: 400;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

body.in-tab-frame .tab-close-control.tab-close-icon-btn {
    background: #fff;
    border-color: #d0d7e2;
}

.doc-form .doc-toolbar .doc-title {
    order: 1;
}

.doc-form .doc-toolbar .doc-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

/* Заголовок страницы сверху фрейма скрыт — по вкладке и так понятно */
.doc-title {
    display: none !important;
}

.doc-form .doc-header label .required {
    color: #dc2626;
}

.doc-form .doc-header {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* На формах объекта: реквизиты скроллятся, кнопки прижаты к низу */
.doc-form form .doc-header {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    margin-bottom: 0;
}

.doc-form form:has(.doc-table-card) .doc-header {
    margin-bottom: 0;
}

.doc-form .doc-header .doc-header-field {
    min-width: 0;
}

.doc-form .doc-header .doc-header-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.doc-form .doc-header .doc-header-field-check label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.doc-form .doc-header .doc-header-field-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.doc-form .doc-header .doc-header-field-readonly .doc-field-locked {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #64748b;
    background: #f1f5f9;
    cursor: not-allowed;
    box-sizing: border-box;
}

.doc-form .doc-header .doc-field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #94a3b8;
}

.doc-form .doc-header .doc-header-field input.invalid {
    border-color: #dc2626;
    background: #fef2f2;
}

.doc-form .doc-header .doc-header-field input.invalid:focus {
    border-color: #dc2626;
    outline: 2px solid rgba(220, 38, 38, 0.2);
}

.doc-form .doc-header .doc-header-field .error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #dc2626;
    font-weight: 500;
}

.doc-period-modal .step input.invalid {
    border-color: #dc2626;
    background: #fef2f2;
}

.doc-period-modal .step input.invalid:focus {
    border-color: #dc2626;
    outline: 2px solid rgba(220, 38, 38, 0.2);
}

.doc-period-modal .step .error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #dc2626;
    font-weight: 500;
}

.doc-form .doc-header .doc-header-field input[type="date"],
.doc-form .doc-header .doc-header-field input[type="datetime-local"],
.doc-form .doc-header .doc-header-field input[data-type="date"],
.doc-form .doc-header .doc-header-field input[data-type="time"],
.doc-form .doc-header .doc-header-field input[data-type="datetime"],
.doc-form .doc-header .doc-header-field input[type="text"],
.doc-form .doc-header .doc-header-field input[type="number"],
.doc-form .doc-header .doc-header-field input[type="url"],
.doc-form .doc-header .doc-header-field input[type="password"],
.doc-form .doc-header .doc-header-field select,
.doc-form .doc-header .doc-header-field textarea {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #334155;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.doc-form .doc-header .doc-header-field input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.doc-form .doc-header .doc-header-field input[type="number"]::-webkit-outer-spin-button,
.doc-form .doc-header .doc-header-field input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.doc-form .doc-header .doc-header-field input:focus,
.doc-form .doc-header .doc-header-field select:focus,
.doc-form .doc-header .doc-header-field textarea:focus {
    border-color: #6366f1;
    outline: none;
}

.doc-form .doc-header .doc-header-field select {
    cursor: pointer;
}

.doc-form .doc-header .doc-header-field textarea {
    resize: vertical;
    min-height: 56px;
}

.doc-form .doc-header .doc-header-field-full {
    grid-column: 1 / -1;
}

.doc-form .doc-permissions-fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0;
}

.doc-form .doc-permissions-fieldset legend {
    padding: 0 8px;
    font-weight: 600;
}

.doc-form .doc-permissions-by-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.doc-form .doc-permissions-section {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    background: #fafbfc;
}

.doc-form .doc-permissions-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: #334155;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.doc-form .doc-permissions-section-icon {
    font-size: 1.1em;
}

.doc-form .doc-permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px 16px;
    margin-top: 8px;
}

.doc-form .doc-permissions-section .doc-permissions-grid {
    margin-top: 0;
}

.doc-form .doc-permission-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.doc-form .doc-permission-check input[type="checkbox"] {
    flex-shrink: 0;
}

.doc-form .doc-header .doc-period-block {
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-form .doc-header .doc-period-display {
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #334155;
    min-width: 160px;
    max-width: 260px;
}

.doc-form .doc-header .doc-period-display.empty {
    color: #94a3b8;
}

.doc-form .doc-header .doc-period-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    transition: background 0.15s, border-color 0.15s;
}

.doc-form .doc-header .doc-period-btn-icon:hover {
    background: #f1f5f9;
    border-color: #cbd5e0;
    color: #334155;
}

.doc-form .doc-table-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
}

.doc-form .doc-table-card .doc-form-table-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow: auto;
}

.doc-form .doc-table-card .doc-form-totals-bar {
    flex-shrink: 0;
    border-top: 2px solid #cbd5e0;
    background: #f1f5f9;
}

.doc-form .doc-table-card .doc-form-totals-bar .doc-table {
    width: 100%;
    border-collapse: collapse;
}

.doc-form .doc-table-card .doc-form-totals-bar .doc-totals-row td {
    padding: 8px;
    border: none;
    background: #f1f5f9;
    font-size: 14px;
}

.doc-form .doc-table-card .doc-form-totals-bar .doc-totals-row .num {
    text-align: right;
    font-weight: 600;
}

.doc-form .doc-table-card .doc-table-head {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.doc-form .doc-table-card .doc-form-table-scroll .doc-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f1f5f9;
    box-shadow: 0 1px 0 0 #e2e8f0;
}

.doc-form .doc-table-card .doc-table-head .doc-table-title {
    margin: 0;
    margin-right: 16px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.doc-form .doc-table-card .doc-table-head .btn-add-row,
.doc-form .doc-table-card .doc-table-head .btn-del-selected {
    padding: 6px 12px;
    font-size: 13px;
}

/* Подсказка о контроле остатков в приходной/расходной накладных */
.doc-stock-hint {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 14px;
    cursor: help;
    opacity: 0.85;
}
.doc-stock-hint:hover {
    opacity: 1;
}
.doc-stock-hint::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
    min-width: 260px;
    max-width: 360px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
    color: #fff;
    background: #334155;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10000;
    pointer-events: none;
}
.doc-stock-hint::before {
    content: '';
    position: absolute;
    left: 50%;
    top: calc(100% + 2px);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #334155;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10001;
    pointer-events: none;
}
.doc-stock-hint:hover::after,
.doc-stock-hint:hover::before {
    opacity: 1;
    visibility: visible;
}

.doc-form .doc-table-card .doc-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: auto;
}

.doc-form .doc-table-card .doc-table th {
    text-align: left;
    padding: 8px 12px;
    background: #f1f5f9;
    font-weight: 600;
    font-size: 12px;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
    white-space: nowrap;
    min-width: 7rem;
}

.doc-form .doc-table-card .doc-table td {
    min-width: 7rem;
    padding: 8px 12px;
}

.doc-form .doc-table-card .doc-table td.num,
.doc-form .doc-table-card .doc-table th.num {
    min-width: 5.5rem;
}

.doc-form .doc-table-card .doc-table th.sortable {
    cursor: pointer;
    user-select: none;
    padding-right: 30px;
    box-sizing: border-box;
}

.doc-form .doc-table-card .doc-table.sortable {
    table-layout: auto;
    width: 100%;
}

.doc-form .doc-table-card .doc-table th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    opacity: 0.6;
    pointer-events: none;
}

.doc-form .doc-table-card .doc-table.sortable:has(.sort-asc, .sort-desc) th.sortable:not(.sort-asc):not(.sort-desc)::after {
    content: '';
    display: none;
    pointer-events: none;
}

.doc-form .doc-table-card .doc-table.sortable:has(.sort-asc, .sort-desc) th.sortable:not(.sort-asc):not(.sort-desc):hover::after {
    content: '⇅';
    display: block;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    opacity: 1;
    pointer-events: none;
}

.doc-form .doc-table-card .doc-table.sortable:not(:has(.sort-asc, .sort-desc)) th.sortable:hover::after {
    content: '⇅';
    color: #667eea;
    opacity: 1;
    font-weight: 700;
    pointer-events: none;
}

.doc-form .doc-table-card .doc-table th.sortable.sort-asc::after {
    content: '▲';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    opacity: 1;
    pointer-events: none;
}

.doc-form .doc-table-card .doc-table th.sortable.sort-desc::after {
    content: '▼';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    opacity: 1;
    pointer-events: none;
}

.doc-form .doc-table-card .doc-table th.num {
    text-align: right;
}

.doc-form .doc-table-card .doc-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    text-overflow: ellipsis;
}

.doc-form .doc-table-card .doc-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.doc-form .doc-table-card .doc-table tbody tr:hover {
    background: #f1f5f9;
}

.doc-form .doc-table-card .doc-table tbody tr.selected {
    background: #e0e7ff;
}

.doc-form .doc-table-card .doc-table tbody tr.selected:hover {
    background: #c7d2fe;
}

.doc-form .doc-table-card .doc-table th.doc-col-check,
.doc-form .doc-table-card .doc-table td.doc-col-check {
    width: 40px;
    text-align: center;
    vertical-align: middle;
}

.doc-form .doc-table-card .doc-table input[type="checkbox"].row-select {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.doc-form .doc-table-card .doc-table td.num {
    text-align: right;
}

.doc-form .doc-table-card .doc-table input[type="number"] {
    width: 100%;
    max-width: 110px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-align: right;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-form .doc-table-card .doc-table input[type="number"]:focus {
    border-color: #6366f1;
    outline: none;
}

.doc-form .doc-table-card .doc-table select {
    width: 100%;
    min-width: 160px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-form .doc-table-card .doc-table .doc-row-del {
    padding: 6px 12px;
    font-size: 12px;
}

.doc-form .doc-table-card .doc-table .doc-totals-row {
    background: #f1f5f9;
    font-weight: 600;
    border-top: 2px solid #cbd5e0;
}

.doc-form .doc-table-card .doc-table .doc-totals-row td {
    padding: 8px;
}

/* ============================================
   РАБОЧЕЕ МЕСТО АДМИНИСТРАТОРА (из club_workplace.php)
   ============================================ */

/* Рабочее место: на всех экранах по ширине — на всю область; по высоте — на больших заполнять экран */
.main-content:has(.workplace-container) {
    width: calc(100vw - 280px);
    max-width: none;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
}

body:has(.sidebar.sidebar-1c) .main-content:has(.workplace-container) {
    width: calc(100vw - 254px);
}

/* На больших экранах — фиксируем блок на весь экран (ширина и высота), сайдбар учитывается через left */
@media (min-width: 993px) {
    .main-content:has(.workplace-container) {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 280px;
        width: auto;
        height: auto;
        max-height: none;
        margin-left: 0;
    }
    body:has(.sidebar.sidebar-1c) .main-content:has(.workplace-container) {
        left: 254px;
    }
    /* Во вкладке (iframe) сайдбар скрыт — контент от левого края, без сдвига */
    body.in-tab-frame .main-content:has(.workplace-container) {
        left: 0 !important;
    }
}

/* Во фрейме (вкладка) — на всю ширину и высоту кадра */
body.in-tab-frame .main-content:has(.workplace-container) {
    width: 100% !important;
    max-width: none !important;
}

.main-content:has(.workplace-container) .page-content-card {
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.main-content:has(.workplace-container) .container {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 20px;
    padding-right: 20px;
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.main-content:has(.workplace-container) .demo-banner {
    flex-shrink: 0;
    margin-bottom: 20px;
}

.workplace-container {
    display: grid;
    /* Левая колонка (таблица/списки) — на всю оставшуюся ширину; правая — минимум 240px, максимум 30% */
    grid-template-columns: minmax(0, 1fr) minmax(240px, 30%);
    grid-template-rows: 1fr;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex: 1 1 0;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.workplace-container > .workplace-right {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.workplace-left {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    width: 100%;
    overflow: hidden;
}

.workplace-left .workplace-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.workplace-left #pcs-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    max-height: 100%;
}

.workplace-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.workplace-right .workplace-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    flex: 1 1 0;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.workplace-right .workplace-section h3 {
    flex-shrink: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.workplace-right .workplace-section .search-box {
    flex-shrink: 0;
    margin-bottom: 15px;
}

.workplace-right #products-container {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: auto;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.workplace-right #cart-container {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: auto;
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.workplace-right .products-table,
.workplace-right .cart-table {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    table-layout: fixed;
    min-width: 0;
}

.workplace-right #products-container table,
.workplace-right #cart-container table {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.workplace-right .products-table th,
.workplace-right .products-table td,
.workplace-right .cart-table th,
.workplace-right .cart-table td {
    max-width: 100%;
    box-sizing: border-box;
}

.workplace-right .cart-summary {
    flex-shrink: 0;
    margin-top: 8px;
}

.workplace-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.workplace-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.workplace-section .search-box {
    flex-shrink: 0;
    margin-bottom: 8px;
}

.workplace-section h3:hover {
    color: #4299e1;
}

.collapse-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0 10px;
    color: #718096;
    transition: transform 0.3s, color 0.2s;
}

.collapse-btn:hover {
    color: #4299e1;
}

.workplace-section.collapsed .collapse-btn {
    transform: rotate(-90deg);
}

.workplace-section.collapsed > *:not(h3) {
    display: none;
}

.workplace-section.collapsed {
    min-height: 50px;
    height: auto;
    flex: 0 0 auto;
    max-height: 50px;
}

.workplace-section.collapsed h3 {
    margin-bottom: 0;
    padding-bottom: 10px;
    min-height: 40px;
    max-height: 40px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.workplace-right .workplace-section.collapsed {
    flex: 0 0 auto;
}

.workplace-right .workplace-section:not(.collapsed) {
    flex: 1 1 0;
}

.search-box {
    margin-bottom: 8px;
    position: relative;
    flex-shrink: 0;
}

.search-box input {
    width: 100%;
    padding: 8px 40px 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

.search-box::after {
    content: '🔍';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #718096;
    font-size: 16px;
}

.search-box:has(input:focus)::after {
    color: #667eea;
}

.pc-table, .products-table, .cart-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.pc-table th, .pc-table td,
.products-table th, .products-table td,
.cart-table th, .cart-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workplace-right .products-table th,
.workplace-right .products-table td,
.workplace-right .cart-table th,
.workplace-right .cart-table td {
    padding: 8px;
    font-size: 12px;
}

.workplace-right .products-table th,
.workplace-right .cart-table th {
    font-size: 11px;
    font-weight: 600;
}

#pcs-container, #products-container, #cart-container {
    width: 100%;
    box-sizing: border-box;
}

#pcs-container table, #products-container table, #cart-container table {
    width: 100%;
    min-width: 100%;
}

.pc-table th, .products-table th, .cart-table th {
    background: #f7fafc;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.pc-table tr:hover, .products-table tr:hover, .cart-table tr:hover {
    background: #f7fafc;
}

.pc-free {
    color: #48bb78;
    font-weight: 600;
}

.pc-busy {
    color: #f56565;
}

.cart-summary {
    margin-top: 10px;
    padding: 10px;
    background: #f7fafc;
    border-radius: 6px;
    flex-shrink: 0;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.cart-summary-total {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    border-top: 1px solid #e2e8f0;
    padding-top: 6px;
    margin-top: 6px;
    margin-bottom: 8px;
}

.btn-checkout {
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-checkout:hover {
    background: #5568d3;
}

.btn-checkout:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.action-buttons {
    display: flex;
    gap: 5px;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    position: relative;
}

.btn-small[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.btn-small[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2d3748;
    z-index: 1000;
    margin-bottom: -5px;
}

.table-sortable th {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 30px;
    box-sizing: border-box;
}

.table-sortable th.no-sort {
    cursor: default;
    padding-right: 12px;
}

.table-sortable th.no-sort::after {
    content: '' !important;
    display: none !important;
}

.table-sortable {
    table-layout: fixed;
    width: 100%;
}

.table-sortable th::after {
    content: '⇅';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    opacity: 0.6;
    pointer-events: none;
}

.table-sortable th.sort-asc::after {
    content: '▲';
    color: #667eea;
    opacity: 1;
}

.table-sortable th.sort-desc::after {
    content: '▼';
    color: #667eea;
    opacity: 1;
}

.table-sortable:has(.sort-asc, .sort-desc) th:not(.sort-asc):not(.sort-desc)::after {
    content: '';
    display: none;
    pointer-events: none;
}

.table-sortable:has(.sort-asc, .sort-desc) th:not(.sort-asc):not(.sort-desc):hover::after {
    content: '⇅';
    display: block;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    opacity: 1;
    pointer-events: none;
}

.table-sortable:has(.sort-asc, .sort-desc) th.no-sort:hover::after,
.table-sortable:not(:has(.sort-asc, .sort-desc)) th.no-sort:hover::after {
    content: '' !important;
    display: none !important;
}

.table-sortable:not(:has(.sort-asc, .sort-desc)) th:hover::after {
    content: '⇅';
    color: #667eea;
    opacity: 1;
    font-weight: 700;
    pointer-events: none;
}

@media (max-width: 1200px) {
    .workplace-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        overflow: visible;
    }
}

/* На маленьких экранах разрешаем прокрутку страницы (Управление клубом, Рабочее место и др.) */
@media (max-width: 992px) {
    body.has-sidebar {
        overflow-x: hidden;
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
        -webkit-overflow-scrolling: touch;
    }
    /* Область вкладок (фреймы) — на всю высоту экрана, не обрезать */
    .main-content:has(.tabs-panes) {
        height: 100vh;
        min-height: 100vh;
        overflow: hidden;
    }
    .main-content:has(.tabs-panes) > .tabs-panes {
        flex: 1 1 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    .main-content:has(.tabs-panes) > .tabs-panes > .tab-pane.active {
        flex: 1 1 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    .main-content:has(.tabs-panes) .tab-pane-iframe {
        flex: 1 1 0;
        min-height: 0;
        width: 100%;
    }
    /* На малых экранах убираем полоску перетаскивания и растягиватель фрейма */
    .main-content > .tabs-panes > .tab-pane .tab-pane-drag-handle,
    .main-content > .tabs-panes > .tab-pane .tab-pane-drag-target,
    .main-content > .tabs-panes > .tab-pane .tab-pane-resize-handle {
        display: none !important;
    }
}

/* Формы документов на маленьких экранах: скролл страницы (как рабочее место), видны и шапка и таблица */
@media (max-width: 992px) {
    .main-content:has(.doc-form) {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    body.in-tab-frame .main-content:has(.doc-form) {
        height: auto;
        min-height: 100%;
        overflow-y: auto;
    }
    .main-content:has(.doc-form) .page-content-card,
    .main-content:has(.doc-form) .container.doc-form-full {
        flex: 0 1 auto;
        overflow: visible;
    }
    .main-content:has(.doc-form) .doc-form,
    .main-content:has(.doc-form) .doc-form form {
        flex: 0 1 auto;
        overflow: visible;
    }
    .doc-form form:has(.doc-table-card) {
        display: flex;
        flex-direction: column;
        grid-template-rows: unset;
    }
    .doc-form form:has(.doc-table-card) .doc-header,
    .doc-form form .doc-header {
        flex: 0 0 auto;
        min-height: 0;
        grid-row: unset;
    }
    .doc-form form:has(.doc-table-card) .doc-table-card {
        flex: 0 0 auto;
        min-height: 400px;
        grid-row: unset;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .doc-form form:has(.doc-table-card) .doc-form-actions {
        grid-row: unset;
        flex-shrink: 0;
    }
    .doc-form .doc-table-card .doc-form-table-scroll {
        flex: 1 1 0;
        min-height: 300px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 768px) {
    /* Как на рабочем месте: скролл страницы, и шапка и таблица видны при прокрутке */
    .main-content:has(.doc-form) {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        max-height: none;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    body.in-tab-frame .main-content:has(.doc-form) {
        height: auto;
        min-height: 100%;
        max-height: none;
        overflow-y: auto;
    }
    .main-content:has(.doc-form) .page-content-card,
    .main-content:has(.doc-form) .container.doc-form-full,
    body.in-tab-frame .main-content:has(.doc-form) .page-content-card,
    body.in-tab-frame .main-content:has(.doc-form) .container.doc-form-full {
        flex: 0 1 auto;
        min-height: 0;
        overflow: visible;
    }
    .main-content:has(.doc-form) .doc-form,
    .main-content:has(.doc-form) .doc-form form {
        flex: 0 1 auto;
        min-height: 0;
        overflow: visible;
    }
    /* Форма — обычный поток: шапка по контенту, таблица ниже с минимальной высотой */
    .doc-form form:has(.doc-table-card) {
        display: flex;
        flex-direction: column;
        grid-template-rows: unset;
    }
    .doc-form form:has(.doc-table-card) .doc-header,
    .doc-form form .doc-header {
        flex: 0 0 auto;
        min-height: 0;
        grid-row: unset;
    }
    .doc-form form:has(.doc-table-card) .doc-table-card {
        flex: 0 0 auto;
        min-height: 420px;
        grid-row: unset;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    .doc-form .doc-table-card .doc-form-table-scroll {
        flex: 1 1 0;
        min-height: 320px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    .doc-form form:has(.doc-table-card) .doc-table-card {
        min-height: 380px;
    }
    .doc-form .doc-table-card .doc-form-table-scroll {
        min-height: 280px;
    }
}

/* Списки и статистика: гарантированная высота, чтобы не открывались «пустыми» */
@media (max-width: 992px) {
    .main-content {
        min-height: 70vh;
    }
    .main-content:has(.doc-list) {
        min-height: 80vh;
    }
    .main-content:has(.doc-list) .doc-list {
        min-height: 60vh;
    }
    .main-content .page-content-card {
        min-height: 0;
    }
    /* Отчёты (.report-page.report-1c): как «Приходная накладная» — таблица до низа, не переопределять */
    .main-content:has(.report-page.report-1c) {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        height: 100vh;
        overflow: hidden;
    }
    .main-content:has(.report-page.report-1c) .page-content-card,
    .main-content:has(.report-page.report-1c) .container,
    .main-content:has(.report-page.report-1c) .club-stats-page {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
    }
    /* Статистика клуба и прочие страницы без списка/формы/рабочего места/вкладок/отчётов — контент всегда виден */
    .main-content:not(:has(.doc-list)):not(:has(.report-page.report-1c)):not(:has(.workplace-container)):not(:has(.doc-form)):not(:has(.tabs-panes)) {
        min-height: 80vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .main-content:not(:has(.doc-list)):not(:has(.report-page.report-1c)):not(:has(.workplace-container)):not(:has(.doc-form)):not(:has(.tabs-panes)) .page-content-card {
        flex: none;
        min-height: 60vh;
        overflow: visible;
    }
    .main-content:not(:has(.doc-list)):not(:has(.report-page.report-1c)):not(:has(.workplace-container)):not(:has(.doc-form)):not(:has(.tabs-panes)) .page-content-card > .container {
        flex: none;
        min-height: 50vh;
        overflow: visible;
    }
}

/* Во вкладке (iframe): занимать всю доступную высоту, контент не пустой */
@media (max-width: 992px) {
    /* Не менять height на auto — иначе flex-цепочка ломается и контент «пустой» / таблица не заполняет высоту */
    html.in-tab-frame,
    body.in-tab-frame {
        height: 100% !important;
        min-height: 100% !important;
    }
    body.in-tab-frame .main-content {
        height: 100% !important;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    /* Списки: таблица на всю доступную высоту */
    body.in-tab-frame .main-content:has(.doc-list) .page-content-card,
    body.in-tab-frame .main-content:has(.doc-list) .container {
        flex: 1 1 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    body.in-tab-frame .doc-list {
        flex: 1 1 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    body.in-tab-frame .doc-list .doc-table-wrap {
        flex: 1 1 0;
        min-height: 0;
    }
    body.in-tab-frame .doc-list .doc-list-table-scroll {
        flex: 1 1 0;
        min-height: 0;
        overflow: auto;
    }
    /* Формы во вкладке: фрейм на всю высоту, скролл в main-content (правило задано выше в базовых in-tab-frame) */
    /* Статистика и прочие страницы во вкладке (не отчёты) */
    body.in-tab-frame .main-content:not(:has(.doc-list)):not(:has(.report-page.report-1c)):not(:has(.workplace-container)):not(:has(.doc-form)):not(:has(.tabs-panes)) .page-content-card,
    body.in-tab-frame .main-content:not(:has(.doc-list)):not(:has(.report-page.report-1c)):not(:has(.workplace-container)):not(:has(.doc-form)):not(:has(.tabs-panes)) .page-content-card > .container {
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
    }
}

/* Рабочее место на мобильных и во фрейме: контент помещается или прокручивается */
@media (max-width: 992px) {
    .main-content:has(.workplace-container) {
        height: auto;
        min-height: 100vh;
        max-height: none;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .main-content:has(.workplace-container) .container {
        flex: none;
        min-height: 0;
        max-height: none;
        overflow: visible;
    }
    .main-content:has(.workplace-container) .workplace-container {
        flex: none;
        max-height: none;
        overflow: visible;
        min-height: 0;
    }
    .main-content:has(.workplace-container) .workplace-container {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    .main-content:has(.workplace-container) .workplace-left,
    .main-content:has(.workplace-container) .workplace-right {
        max-height: none;
        min-height: 0;
        width: 100%;
    }
    .main-content:has(.workplace-container) .workplace-right .workplace-section {
        flex: 0 0 auto;
        min-height: 0;
        overflow: visible;
    }
    .main-content:has(.workplace-container) .workplace-right #products-section,
    .main-content:has(.workplace-container) .workplace-right #cart-section {
        min-height: 200px;
    }
    .main-content:has(.workplace-container) .workplace-right #products-container,
    .main-content:has(.workplace-container) .workplace-right #cart-container {
        flex: 0 0 auto;
        max-height: none;
        min-height: 140px;
        overflow-x: auto;
        overflow-y: visible;
    }
    .main-content:has(.workplace-container) .workplace-left #pcs-container {
        max-height: none;
        min-height: 220px;
    }
    /* Таблицы: фиксированная ширина колонок и прокрутка контейнера */
    .main-content:has(.workplace-container) #pcs-container,
    .main-content:has(.workplace-container) #products-container,
    .main-content:has(.workplace-container) #cart-container {
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .main-content:has(.workplace-container) .pc-table,
    .main-content:has(.workplace-container) .products-table,
    .main-content:has(.workplace-container) .cart-table {
        table-layout: fixed;
        min-width: 0;
    }
    .main-content:has(.workplace-container) .pc-table {
        min-width: 820px;
    }
    .main-content:has(.workplace-container) .pc-table th,
    .main-content:has(.workplace-container) .pc-table td {
        min-width: 0;
        box-sizing: border-box;
    }
    .main-content:has(.workplace-container) .pc-table th:nth-child(1),
    .main-content:has(.workplace-container) .pc-table td:nth-child(1) { width: 58px; min-width: 58px; }
    .main-content:has(.workplace-container) .pc-table th:nth-child(2),
    .main-content:has(.workplace-container) .pc-table td:nth-child(2) { width: 62px; min-width: 62px; }
    .main-content:has(.workplace-container) .pc-table th:nth-child(3),
    .main-content:has(.workplace-container) .pc-table td:nth-child(3) { width: 68px; min-width: 68px; }
    .main-content:has(.workplace-container) .pc-table th:nth-child(4),
    .main-content:has(.workplace-container) .pc-table td:nth-child(4) { width: 100px; min-width: 100px; }
    .main-content:has(.workplace-container) .pc-table th:nth-child(5),
    .main-content:has(.workplace-container) .pc-table td:nth-child(5) { width: 80px; min-width: 80px; }
    .main-content:has(.workplace-container) .pc-table th:nth-child(6),
    .main-content:has(.workplace-container) .pc-table td:nth-child(6) { width: 68px; min-width: 68px; }
    .main-content:has(.workplace-container) .pc-table th:nth-child(7),
    .main-content:has(.workplace-container) .pc-table td:nth-child(7) { width: 80px; min-width: 80px; }
    .main-content:has(.workplace-container) .pc-table th:nth-child(8),
    .main-content:has(.workplace-container) .pc-table td:nth-child(8) { width: 96px; min-width: 96px; }
    .main-content:has(.workplace-container) .pc-table th:nth-child(9),
    .main-content:has(.workplace-container) .pc-table td:nth-child(9) { width: 210px; min-width: 210px; }
    .main-content:has(.workplace-container) .products-table {
        min-width: 420px;
    }
    .main-content:has(.workplace-container) .products-table th:nth-child(1),
    .main-content:has(.workplace-container) .products-table td:nth-child(1) { width: 180px; min-width: 180px; }
    .main-content:has(.workplace-container) .products-table th:nth-child(2),
    .main-content:has(.workplace-container) .products-table td:nth-child(2) { width: 82px; min-width: 82px; }
    .main-content:has(.workplace-container) .products-table th:nth-child(3),
    .main-content:has(.workplace-container) .products-table td:nth-child(3) { width: 82px; min-width: 82px; }
    .main-content:has(.workplace-container) .products-table th:nth-child(4),
    .main-content:has(.workplace-container) .products-table td:nth-child(4) { width: 76px; min-width: 76px; }
    .main-content:has(.workplace-container) .cart-table {
        min-width: 440px;
    }
    .main-content:has(.workplace-container) .cart-table th:nth-child(1),
    .main-content:has(.workplace-container) .cart-table td:nth-child(1) { width: 160px; min-width: 160px; }
    .main-content:has(.workplace-container) .cart-table th:nth-child(2),
    .main-content:has(.workplace-container) .cart-table td:nth-child(2) { width: 58px; min-width: 58px; }
    .main-content:has(.workplace-container) .cart-table th:nth-child(3),
    .main-content:has(.workplace-container) .cart-table td:nth-child(3) { width: 90px; min-width: 90px; }
    .main-content:has(.workplace-container) .cart-table th:nth-child(4),
    .main-content:has(.workplace-container) .cart-table td:nth-child(4) { width: 100px; min-width: 100px; }
    .main-content:has(.workplace-container) .cart-table th:nth-child(5),
    .main-content:has(.workplace-container) .cart-table td:nth-child(5) { width: 52px; min-width: 52px; }
    .main-content:has(.workplace-container) .pc-table th,
    .main-content:has(.workplace-container) .pc-table td,
    .main-content:has(.workplace-container) .products-table th,
    .main-content:has(.workplace-container) .products-table td,
    .main-content:has(.workplace-container) .cart-table th,
    .main-content:has(.workplace-container) .cart-table td {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .main-content:has(.workplace-container) .pc-table td.action-buttons,
    .main-content:has(.workplace-container) .products-table td:nth-child(4),
    .main-content:has(.workplace-container) .cart-table td:nth-child(5) {
        white-space: normal;
        overflow: visible;
    }
    /* Компактные строки таблиц рабочего места на маленьких экранах */
    .main-content:has(.workplace-container) .pc-table th,
    .main-content:has(.workplace-container) .pc-table td,
    .main-content:has(.workplace-container) .products-table th,
    .main-content:has(.workplace-container) .products-table td,
    .main-content:has(.workplace-container) .cart-table th,
    .main-content:has(.workplace-container) .cart-table td {
        padding: 4px 8px;
        font-size: 12px;
        line-height: 1.3;
    }
}

/* Во фрейме (вкладка) на маленьких экранах: рабочее место с прокруткой страницы */
@media (max-width: 992px) {
    body.in-tab-frame .main-content:has(.workplace-container) {
        height: auto;
        min-height: 100%;
        max-height: none;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    body.in-tab-frame .main-content:has(.workplace-container) .page-content-card {
        flex: none;
        min-height: 0;
        overflow: visible;
    }
    body.in-tab-frame .main-content:has(.workplace-container) .container {
        flex: none;
        max-height: none;
        overflow: visible;
    }
    body.in-tab-frame .main-content:has(.workplace-container) .workplace-container {
        flex: none;
        max-height: none;
        overflow: visible;
    }
    body.in-tab-frame .main-content:has(.workplace-container) .workplace-left #pcs-container,
    body.in-tab-frame .main-content:has(.workplace-container) .workplace-right #products-container,
    body.in-tab-frame .main-content:has(.workplace-container) .workplace-right #cart-container {
        max-height: none;
        min-height: 180px;
    }
}
@media (max-width: 992px) {
    body.in-tab-frame .main-content:has(.workplace-container) #pcs-container,
    body.in-tab-frame .main-content:has(.workplace-container) #products-container,
    body.in-tab-frame .main-content:has(.workplace-container) #cart-container {
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 768px) {
    .main-content:has(.workplace-container) .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    .main-content:has(.workplace-container) .workplace-container {
        gap: 12px;
    }
    .main-content:has(.workplace-container) .workplace-section {
        padding: 12px;
    }
    .main-content:has(.workplace-container) .workplace-section h3 {
        font-size: 1rem;
        flex-wrap: wrap;
        gap: 8px;
    }
    .main-content:has(.workplace-container) .workplace-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .main-content:has(.workplace-container) .workplace-toolbar-actions {
        flex-wrap: wrap;
    }
    .main-content:has(.workplace-container) .workplace-toolbar-actions .btn {
        flex: 1 1 auto;
        min-width: 120px;
    }
    .main-content:has(.workplace-container) #pcs-container,
    .main-content:has(.workplace-container) #products-container,
    .main-content:has(.workplace-container) #cart-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* Ещё компактнее строки таблиц рабочего места при ≤768px */
    .main-content:has(.workplace-container) .pc-table th,
    .main-content:has(.workplace-container) .pc-table td,
    .main-content:has(.workplace-container) .products-table th,
    .main-content:has(.workplace-container) .products-table td,
    .main-content:has(.workplace-container) .cart-table th,
    .main-content:has(.workplace-container) .cart-table td {
        padding: 3px 6px;
        font-size: 11px;
        line-height: 1.25;
    }
    .main-content:has(.workplace-container) .pc-table .btn-small,
    .main-content:has(.workplace-container) .products-table .btn-small,
    .main-content:has(.workplace-container) .cart-table .btn-small {
        padding: 2px 6px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .main-content:has(.workplace-container) .container {
        padding-left: 8px;
        padding-right: 8px;
    }
    .main-content:has(.workplace-container) .workplace-section {
        padding: 10px;
    }
    .main-content:has(.workplace-container) .workplace-section h3 {
        font-size: 0.95rem;
    }
    /* Максимально компактные строки таблиц рабочего места при ≤480px */
    .main-content:has(.workplace-container) .pc-table th,
    .main-content:has(.workplace-container) .pc-table td,
    .main-content:has(.workplace-container) .products-table th,
    .main-content:has(.workplace-container) .products-table td,
    .main-content:has(.workplace-container) .cart-table th,
    .main-content:has(.workplace-container) .cart-table td {
        padding: 2px 5px;
        font-size: 10px;
        line-height: 1.2;
    }
    .main-content:has(.workplace-container) .pc-table .btn-small,
    .main-content:has(.workplace-container) .products-table .btn-small,
    .main-content:has(.workplace-container) .cart-table .btn-small {
        padding: 2px 5px;
        font-size: 10px;
    }
}

/* На экранах до 992px показываем кнопку «Фильтры и действия» и выпадающее меню; все элементы управления только внутри меню */
@media (max-width: 992px) {
    /* Строка с кнопками/поиском вне меню — скрыть (на маленьких экранах всё должно быть в выпадающем меню) */
    .doc-list > .doc-list-search-row {
        display: none !important;
    }
    
    .doc-list-filters-trigger {
        display: inline-flex;
    }
    
    .doc-list-filters-with-menu {
        position: relative;
    }
    
    /* Компактные строки таблиц — больше помещается на экран */
    .doc-list .doc-table th,
    .doc-list .doc-table td {
        padding: 6px 10px;
        font-size: 13px;
        line-height: 1.35;
    }
    .doc-list .doc-table th.doc-list-col-check,
    .doc-list .doc-table td.doc-list-col-check {
        width: 36px;
        padding-left: 6px;
        padding-right: 6px;
    }
    .doc-list .doc-table input[type="checkbox"].doc-list-row-check {
        width: 16px;
        height: 16px;
    }
    .doc-list .doc-table .doc-list-empty {
        padding: 24px 16px;
        font-size: 14px;
    }
    .doc-list .doc-list-th-sort .doc-list-sort-link {
        padding: 6px 8px;
        padding-right: 26px;
        font-size: 12px;
    }
    .doc-list .doc-list-th-sort .doc-list-sort-link::after {
        right: 6px;
        font-size: 14px;
    }
    .doc-list .doc-list-totals-table .doc-list-totals-row td {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .doc-list-filters-with-menu .doc-list-filters-dropdown {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        margin-top: 8px;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.12);
        padding: 14px;
        z-index: 200;
        min-width: 280px;
        width: max-content;
        max-width: calc(100vw - 24px);
        flex-direction: column;
        gap: 12px;
    }
    
    .doc-list-filters-with-menu.is-open .doc-list-filters-dropdown {
        display: flex !important;
    }
    
    .doc-list-filters-with-menu .doc-list-filters-dropdown .doc-list-period-form {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .doc-list-filters-with-menu .doc-list-filters-dropdown .doc-list-period-block {
        width: 100%;
    }
    
    .doc-list-filters-with-menu .doc-list-filters-dropdown .doc-list-period-display {
        min-width: auto;
    }
    
    .doc-list-filters-with-menu .doc-list-filters-dropdown label {
        margin-top: 4px;
    }
    
    .doc-list-filters-with-menu .doc-list-filters-dropdown select {
        width: 100%;
        max-width: none;
    }
    
    /* Кнопки и строка поиска переносятся на следующую строку при нехватке места */
    .doc-list-filters-with-menu .doc-list-filters-dropdown .doc-list-search-row {
        width: 100%;
        min-width: 0;
    }
    
    .doc-list-filters-with-menu .doc-list-filters-dropdown .doc-list-search-row .doc-list-search-form {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }
    
    .doc-list-filters-with-menu .doc-list-filters-dropdown .doc-list-search-row .doc-list-search-input {
        min-width: 140px;
        flex: 1 1 140px;
    }
    
    .doc-list-filters-with-menu .doc-list-filters-dropdown .btn {
        width: auto;
        flex-shrink: 0;
    }
}

.modal {
    z-index: 10000;
}

.modal:not(.active):not(.show) {
    pointer-events: none;
}

.workplace-container button,
.workplace-container .btn {
    position: relative;
    z-index: 1;
}

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

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .clubs-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        font-size: 32px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .nav-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .nav-card {
        padding: 20px;
    }
    
    .nav-icon {
        font-size: 36px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .table-container {
        padding: 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    th, td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        margin-bottom: 10px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 290px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Когда меню открыто — прячем кнопку «Бургер», чтобы не перекрывала контент меню */
    body:has(.sidebar.open) .sidebar-toggle {
        display: none !important;
    }
    
    body.has-sidebar {
        margin-left: 0;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
        padding-top: 60px;
    }

    body:has(.sidebar.sidebar-1c) .main-content {
        margin-left: 0;
    }

    .sidebar.sidebar-1c {
        width: 290px;
        overflow-y: auto;
    }

    .sidebar.sidebar-1c .sidebar-1c-rail {
        width: 290px;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        padding: 14px 10px;
        padding-bottom: max(14px, env(safe-area-inset-bottom, 0));
        background: #fff;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar.sidebar-1c.open {
        background: #fff;
        box-shadow: 2px 0 16px rgba(0, 0, 0, 0.12);
    }

    .sidebar.sidebar-1c .sidebar-1c-section-btn {
        width: 100%;
        height: auto;
        margin: 0;
        padding: 12px 12px;
        display: flex;
        justify-content: flex-start;
        gap: 10px;
    }

    .sidebar.sidebar-1c .sidebar-1c-section-label {
        position: static;
        width: auto;
        height: auto;
        padding: 0;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
        border: 0;
        font-weight: 700;
        font-size: 14px;
    }

    .sidebar.sidebar-1c .sidebar-1c-panel {
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        max-width: none !important;
        max-height: 85vh;
        transform: translateX(-100%);
        border-radius: 0;
        border-left: 1px solid rgba(0,0,0,0.08);
    }
    .sidebar.sidebar-1c .sidebar-1c-panel.open {
        transform: translateX(0);
    }
    .sidebar.sidebar-1c .sidebar-1c-panel.panel-general.open {
        width: 100% !important;
    }
    .sidebar.sidebar-1c .sidebar-1c-panel-body {
        max-height: 75vh;
        -webkit-overflow-scrolling: touch;
    }
    .sidebar.sidebar-1c .sidebar-1c-section-btn {
        min-height: 48px;
        padding: 14px 12px;
    }
    .sidebar.sidebar-1c .sidebar-1c-item {
        min-height: 44px;
        padding: 12px 0;
    }
    
    .sidebar-1c-close-btn {
        display: flex;
        padding-left: 18px;
        padding-right: 18px;
    }
    
    .sidebar-1c-panel-back {
        display: flex;
        padding-left: 58px;
        padding-right: 18px;
    }
    
    .sidebar.sidebar-1c .sidebar-1c-panel .sidebar-1c-panel-body {
        border-radius: 0;
    }
    
    .sidebar-toggle {
        display: block;
        min-width: 44px;
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .nav-link {
        padding: 14px 15px;
        font-size: 14px;
    }
    
    .nav-section-title {
        padding: 10px 15px;
        font-size: 11px;
    }
    
    .actions-bar {
        flex-direction: column;
        gap: 8px;
    }
    
    .actions-bar .btn {
        width: 100%;
    }
    
    .alert {
        padding: 12px;
        font-size: 14px;
    }
    
    .badge {
        font-size: 11px;
        padding: 3px 10px;
    }
    
    .modal,
    .doc-period-modal {
        padding: 10px;
    }
    
    .modal-content,
    .doc-period-modal .modal-box {
        padding: 20px;
        max-height: 85vh;
    }
    
    .modal-header h3 {
        font-size: 20px;
    }
    
    .modal-actions,
    .doc-period-modal .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn,
    .doc-period-modal .modal-actions .btn {
        width: 100%;
    }
    
    .toast-container {
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
    
    .main-content:has(.doc-form) {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .main-content:has(.doc-form) .container.doc-form-full {
        padding-left: 10px;
        padding-right: 10px;
        overflow-y: auto;
        min-height: min-content;
    }
    
    .main-content:has(.doc-list) .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .doc-list .doc-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .doc-list .doc-toolbar .doc-title {
        font-size: 1.25rem;
    }
    
    .doc-list .doc-list-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .doc-list .doc-list-actions .btn {
        width: 100%;
    }
    
    .doc-list .doc-list-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .doc-list .doc-list-period-form {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
    
    .doc-list .doc-list-period-block {
        width: 100%;
    }
    
    .doc-list .doc-list-period-display {
        width: 100%;
        min-width: auto;
    }
    
    .doc-list .doc-list-search-row {
        width: 100%;
    }
    
    .doc-list .doc-list-search-form {
        width: 100%;
    }
    
    .doc-list .doc-list-search-input {
        width: 100%;
        min-width: auto;
    }
    
    .doc-list .doc-table {
        font-size: 12px;
    }
    
    .doc-list .doc-table th,
    .doc-list .doc-table td {
        padding: 5px 8px;
        font-size: 12px;
        line-height: 1.3;
    }
    .doc-list .doc-table th.doc-list-col-check,
    .doc-list .doc-table td.doc-list-col-check {
        width: 32px;
        padding-left: 4px;
        padding-right: 4px;
    }
    .doc-list .doc-table input[type="checkbox"].doc-list-row-check {
        width: 15px;
        height: 15px;
    }
    .doc-list .doc-table .doc-list-empty {
        padding: 20px 12px;
        font-size: 13px;
    }
    .doc-list .doc-list-th-sort .doc-list-sort-link {
        padding: 5px 6px;
        padding-right: 22px;
        font-size: 11px;
    }
    .doc-list .doc-list-totals-table .doc-list-totals-row td {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .doc-list .doc-list-pagination {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .doc-list .doc-list-pagination-links {
        margin-left: 0;
        justify-content: center;
    }
    
    .doc-form .doc-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .doc-form .doc-toolbar .doc-title {
        margin-left: 0;
        font-size: 1.25rem;
    }
    
    .doc-form .doc-toolbar .doc-toolbar-actions {
        width: 100%;
        flex-direction: column;
        margin-left: 0;
        order: 2;
    }
    
    .doc-form .doc-toolbar .doc-toolbar-actions a,
    .doc-form .doc-toolbar .doc-toolbar-actions button {
        width: 100%;
    }
    
    .doc-form .doc-header {
        max-width: 100%;
        padding: 16px 20px;
    }
    
    .doc-form .doc-header .doc-header-field input[type="date"],
    .doc-form .doc-header .doc-header-field input[type="datetime-local"],
    .doc-form .doc-header .doc-header-field input[data-type="date"],
    .doc-form .doc-header .doc-header-field input[data-type="time"],
    .doc-form .doc-header .doc-header-field input[data-type="datetime"],
    .doc-form .doc-header .doc-header-field input[type="text"],
    .doc-form .doc-header .doc-header-field input[type="number"],
    .doc-form .doc-header .doc-header-field input[type="url"],
    .doc-form .doc-header .doc-header-field input[type="password"],
    .doc-form .doc-header .doc-header-field select,
    .doc-form .doc-header .doc-header-field textarea {
        max-width: 100%;
        font-size: 16px;
    }
    
    .doc-form .doc-header .doc-header-field-readonly .doc-field-locked {
        max-width: 100%;
    }
    
    .doc-form .doc-table-card .doc-table-head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .doc-form .doc-table-card .doc-table-head .btn-add-row,
    .doc-form .doc-table-card .doc-table-head .btn-del-selected {
        width: 100%;
    }
    
    .doc-form .doc-table-card .doc-table th,
    .doc-form .doc-table-card .doc-table td {
        padding: 8px;
        font-size: 13px;
    }
    
    .doc-form .doc-table-card .doc-table input[type="number"] {
        max-width: 100%;
        font-size: 16px;
    }
    
    .doc-form .doc-table-card .doc-table select {
        min-width: auto;
        width: 100%;
        font-size: 16px;
    }
    
    .doc-period-modal {
        padding: 10px;
    }
    
    .doc-period-modal .modal-box {
        padding: 20px 24px;
    }
    
    .doc-period-modal .modal-actions {
        flex-direction: column;
    }
    
    .doc-period-modal .modal-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .main-content:has(.doc-form) {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .header {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .nav-card {
        padding: 16px;
    }
    
    .nav-title {
        font-size: 16px;
    }
    
    .nav-description {
        font-size: 13px;
    }
    
    .sidebar {
        width: 100%;
        max-width: 100vw;
        padding-left: env(safe-area-inset-left, 0);
    }
    
    .sidebar.sidebar-1c {
        width: 100%;
        max-width: 100vw;
    }
    
    .sidebar.sidebar-1c .sidebar-1c-rail {
        width: 100%;
        min-width: 0;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        padding: 12px 10px;
        padding-left: max(12px, env(safe-area-inset-left, 0));
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0));
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar.sidebar-1c .sidebar-1c-sections {
        gap: 2px;
    }
    
    .sidebar.sidebar-1c .sidebar-1c-section-btn {
        min-height: 44px;
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .sidebar.sidebar-1c .sidebar-1c-bottom {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(0,0,0,0.06);
    }
    
    .sidebar.sidebar-1c .sidebar-1c-section-label {
        font-size: 13px;
        white-space: normal;
        line-height: 1.3;
    }
    
    .sidebar.sidebar-1c .sidebar-1c-panel {
        width: 100% !important;
        max-height: 90vh;
        max-height: 90dvh;
    }
    
    .sidebar.sidebar-1c .sidebar-1c-general-content {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .sidebar.sidebar-1c .sidebar-1c-panel-body {
        padding: 12px 14px 16px;
        max-height: 78vh;
        max-height: 78dvh;
    }
    
    .sidebar.sidebar-1c .sidebar-1c-item {
        min-height: 48px;
        padding: 14px 0;
        font-size: 15px;
    }
    
    .sidebar.sidebar-1c .sidebar-1c-item-icon {
        width: 24px;
        height: 24px;
        flex: 0 0 24px;
        font-size: 16px;
    }
    
    .main-content {
        padding: 10px;
        padding-top: 55px;
        padding-left: env(safe-area-inset-left, 10px);
        padding-right: env(safe-area-inset-right, 10px);
    }
    
    .sidebar-toggle {
        top: 10px;
        left: 10px;
        left: max(10px, env(safe-area-inset-left, 10px));
        padding: 12px 14px;
        font-size: 20px;
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-link {
        padding: 12px 15px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .alert {
        padding: 10px;
        font-size: 13px;
    }
    
    .modal-content,
    .doc-period-modal .modal-box {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .main-content:has(.doc-form) .container.doc-form-full {
        padding-left: 8px;
        padding-right: 8px;
        overflow-y: auto;
    }
    
    .main-content:has(.doc-list) .container {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    .doc-list .doc-toolbar .doc-title {
        font-size: 1.1rem;
    }
    
    .doc-list .doc-table th,
    .doc-list .doc-table td {
        padding: 4px 6px;
        font-size: 11px;
        line-height: 1.25;
    }
    .doc-list .doc-table th.doc-list-col-check,
    .doc-list .doc-table td.doc-list-col-check {
        width: 28px;
        padding-left: 4px;
        padding-right: 4px;
    }
    .doc-list .doc-table input[type="checkbox"].doc-list-row-check {
        width: 14px;
        height: 14px;
    }
    .doc-list .doc-table .doc-list-empty {
        padding: 16px 10px;
        font-size: 12px;
    }
    .doc-list .doc-list-th-sort .doc-list-sort-link {
        padding: 4px 5px;
        padding-right: 20px;
        font-size: 10px;
    }
    .doc-list .doc-list-totals-table .doc-list-totals-row td {
        padding: 4px 6px;
        font-size: 11px;
    }
    
    .doc-form .doc-toolbar .doc-title {
        font-size: 1.1rem;
    }
    
    .doc-form .doc-header {
        padding: 12px 16px;
    }
    
    .doc-form .doc-table-card .doc-table th,
    .doc-form .doc-table-card .doc-table td {
        padding: 8px;
        font-size: 12px;
    }
}

