/* Admin-v4 shell chrome. Cut from super_admin_dashboard_v4.html. */
        body { font-family: 'Inter', sans-serif; }
        .sidebar-item.active { background-color: #FEF2F2; color: #DC2626; border-right: 3px solid #DC2626; }
        
        /* Custom Scrollbar - Thicker & Visible */
        .custom-scrollbar::-webkit-scrollbar { width: 12px; height: 12px; }
        .custom-scrollbar::-webkit-scrollbar-track { background: #F1F5F9; border-radius: 6px; }
        .custom-scrollbar::-webkit-scrollbar-thumb { background-color: #CBD5E1; border-radius: 6px; border: 3px solid #F1F5F9; }
        .custom-scrollbar::-webkit-scrollbar-thumb:hover { background-color: #94A3B8; }
        
        .dropdown-menu { animation: fadeIn 0.1s ease-out; }
        @keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
        
        /* Sticky Table Headers */
        .sticky-header thead {
            position: sticky;
            top: 0;
            z-index: 10;
            background-color: #F9FAFB;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        }
        
        .sticky-header thead th {
            position: sticky;
            top: 0;
            background-color: #F9FAFB;
        }

        /* Partner food embed mode: hide admin shell, keep only content area */
        html.embed-partner-food body > aside { display: none !important; }
        html.embed-partner-food body > main > header {
            display: flex !important;
            height: 52px !important;
            background: #ffffff !important;
            border-bottom: 1px solid #E5E7EB !important;
            align-items: center !important;
            justify-content: flex-start !important;
            padding: 0 14px !important;
        }
        html.embed-partner-food body > main > header > * {
            display: none !important;
        }
        html.embed-partner-food body > main > header::before {
            content: "Управляется IbrandAI";
            font-size: 13px;
            font-weight: 700;
            color: #111827;
            letter-spacing: 0.01em;
        }
        html.embed-partner-food body > main > header::after {
            content: "";
            width: 7px;
            height: 7px;
            margin-left: 8px;
            border-radius: 999px;
            background: linear-gradient(135deg, #DC2626, #F97316);
        }
        html.embed-partner-food body > main {
            width: 100% !important;
            max-width: none !important;
            flex: 1 1 auto !important;
        }
        html.embed-partner-food body > main > .flex-1 {
            padding: 12px !important;
        }

        /*
         * Partner / wizard food iframe: в разметке section-legal без .hidden — до hash_router/CDN
         * успевает отрисоваться «Юрлица». Прячем все workspace-секции и показываем только еду до JS.
         */
        html.embed-partner-food #admin-workspace-content > div[id^="section-"] {
            display: none !important;
        }
        html.embed-partner-food #admin-workspace-content > #section-food-products {
            display: block !important;
        }

        /* Визард шаг 4 (ритейл): iframe admin-v4?embedded_shop=1 — только товары, без левого меню карточки ТМ */
        body.admin-v4-embedded-shop-catalog #modal-trademark-details {
            z-index: 60;
        }
        body.admin-v4-embedded-shop-catalog #modal-trademark-details #tm-details-sidebar {
            display: none !important;
        }
        body.admin-v4-embedded-shop-catalog #modal-trademark-details #tm-details-main {
            flex: 1 1 100%;
            min-width: 0;
            padding: 1rem 1.25rem;
        }
        body.admin-v4-embedded-shop-catalog #modal-trademark-details #tm-tab-content {
            max-width: none;
            margin-left: 0;
            margin-right: 0;
        }
        body.admin-v4-embedded-shop-catalog #modal-trademark-details .tm-embed-shop-hide-header {
            display: none !important;
        }
        /* workspace-focus-* → /static/css/workspace_focus_mode.css */
        /* Липкая шапка таблиц с горизонтальным скроллом (admin-v4 sticky hscroll) */
        [data-admin-sticky-hscroll] table thead th {
            position: sticky;
            top: 0;
            z-index: 21;
            background-color: #f9fafb;
            box-shadow: inset 0 -1px 0 #e5e7eb;
        }
        body.service-admin-dense > main > header {
            height: 56px;
            padding-left: 18px;
            padding-right: 18px;
        }
        body.service-admin-dense #page-title {
            font-size: 16px;
            line-height: 1.25;
        }
        body.service-admin-dense #admin-workspace-content {
            padding: 16px;
        }
        body.service-admin-dense #admin-workspace-content .space-y-6 > :not([hidden]) ~ :not([hidden]) {
            margin-top: 14px;
        }
        body.service-admin-dense #admin-workspace-content .mb-6 {
            margin-bottom: 14px;
        }
        body.service-admin-dense #admin-workspace-content .mt-8 {
            margin-top: 20px;
        }
        body.service-admin-dense #admin-workspace-content .rounded-2xl {
            border-radius: 14px;
        }
        body.service-admin-dense #admin-workspace-content .p-8 {
            padding: 16px !important;
        }
        body.service-admin-dense #admin-workspace-content .p-6 {
            padding: 14px !important;
        }
        body.service-admin-dense #admin-workspace-content .p-5 {
            padding: 12px !important;
        }
        body.service-admin-dense #admin-workspace-content .p-4 {
            padding: 10px !important;
        }
        body.service-admin-dense #admin-workspace-content .px-6 {
            padding-left: 14px !important;
            padding-right: 14px !important;
        }
        body.service-admin-dense #admin-workspace-content .py-4 {
            padding-top: 10px !important;
            padding-bottom: 10px !important;
        }
        body.service-admin-dense #admin-workspace-content .py-3 {
            padding-top: 8px !important;
            padding-bottom: 8px !important;
        }
        body.service-admin-dense #admin-workspace-content .text-3xl {
            font-size: 1.5rem !important;
            line-height: 1.75rem !important;
        }
        body.service-admin-dense #admin-workspace-content .text-2xl {
            font-size: 1.25rem !important;
            line-height: 1.55rem !important;
        }
        body.service-admin-dense #admin-workspace-content .text-lg {
            font-size: 0.98rem !important;
            line-height: 1.3rem !important;
        }
        body.service-admin-dense #admin-workspace-content .text-sm {
            font-size: 12.5px !important;
            line-height: 1.25rem !important;
        }
        body.service-admin-dense #admin-workspace-content .text-xs {
            font-size: 11px !important;
        }
        body.service-admin-dense #admin-workspace-content table {
            font-size: 12px;
        }
        body.service-admin-dense #admin-workspace-content thead th {
            font-size: 10px !important;
            line-height: 1.1rem !important;
            letter-spacing: 0.04em;
        }
        body.service-admin-dense #admin-workspace-content tbody td {
            padding-top: 8px !important;
            padding-bottom: 8px !important;
        }
        body.service-admin-dense #section-finance .grid.grid-cols-1.md\:grid-cols-2.xl\:grid-cols-6,
        body.service-admin-dense #section-installments .grid.grid-cols-1.md\:grid-cols-2.xl\:grid-cols-6 {
            gap: 10px;
        }
        body.service-admin-dense #section-finance .grid.grid-cols-1.md\:grid-cols-3.lg\:grid-cols-5,
        body.service-admin-dense #section-finance .grid.grid-cols-1.md\:grid-cols-4,
        body.service-admin-dense #section-finance .grid.grid-cols-1.md\:grid-cols-3,
        body.service-admin-dense #section-installments .grid.grid-cols-1.md\:grid-cols-3.lg\:grid-cols-5,
        body.service-admin-dense #section-installments .grid.grid-cols-1.md\:grid-cols-4,
        body.service-admin-dense #section-installments .grid.grid-cols-1.md\:grid-cols-3 {
            gap: 10px;
        }

/* Native Windows file input paints a white bar inside TM/wizard cards; keep picker off-viewport. */
#tm-gen-svc-certificate-image-file,
#svc-certificate-image-file,
.tm-gen-whs-file,
.wizard-whs-file,
#tm-gen-logo-file,
#tm-gen-cover-file,
.tm-gen-nativeless-file,
#modal-trademark-details input[type="file"].absolute,
#modal-trademark-details input[type="file"].opacity-0 {
    position: fixed !important;
    left: -10000px !important;
    top: 0 !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
}

/*
  TM feat cards: do not use Tailwind peer-checked:[&_…] — Play CDN breaks and
  Windows then paints leftover file inputs as a half-screen white bar.
*/
.tm-gen-feat-label {
    position: relative;
    display: block;
    cursor: pointer;
    user-select: none;
}
.tm-gen-feat-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.tm-gen-feat-card {
    padding: 0.75rem;
    border-radius: 1rem;
    border: 2px solid #e5e7eb;
    background: #fff;
    min-height: 108px;
    height: 100%;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.tm-gen-feat-card .tm-gen-feat-on { display: none; }
.tm-gen-feat-card .tm-gen-tick-ico {
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.tm-gen-feat-label > .tm-gen-feat-input:checked + .tm-gen-feat-card .tm-gen-tick-ico {
    opacity: 1;
    transform: scale(1);
}
.tm-gen-feat-label > .tm-gen-feat-input:checked + .tm-gen-feat-card .tm-gen-feat-off { display: none; }
.tm-gen-feat-label > .tm-gen-feat-input:checked + .tm-gen-feat-card .tm-gen-feat-on { display: inline; }
.tm-gen-feat-label > .tm-gen-feat-input:checked + .tm-gen-feat-card--installment {
    border-color: #f59e0b;
    background: linear-gradient(to bottom right, #fffbeb, #fefce8);
}
.tm-gen-feat-label > .tm-gen-feat-input:checked + .tm-gen-feat-card--installment .tm-gen-feat-tick {
    border-color: #d97706;
    background: #f59e0b;
    color: #fff;
}
.tm-gen-feat-label > .tm-gen-feat-input:checked + .tm-gen-feat-card--coupon {
    border-color: #9333ea;
    background: linear-gradient(to bottom right, #faf5ff, #fdf4ff);
}
.tm-gen-feat-label > .tm-gen-feat-input:checked + .tm-gen-feat-card--coupon .tm-gen-feat-tick {
    border-color: #9333ea;
    background: #9333ea;
    color: #fff;
}
.tm-gen-feat-label > .tm-gen-feat-input:checked + .tm-gen-feat-card--cert {
    border-color: #0284c7;
    background: linear-gradient(to bottom right, #f0f9ff, #eff6ff);
}
.tm-gen-feat-label > .tm-gen-feat-input:checked + .tm-gen-feat-card--cert .tm-gen-feat-tick {
    border-color: #0369a1;
    background: #0284c7;
    color: #fff;
}
.tm-gen-feat-label > .tm-gen-feat-input:checked + .tm-gen-feat-card--invite {
    border-color: #4f46e5;
    background: linear-gradient(to bottom right, #eef2ff, #f5f3ff);
}
.tm-gen-feat-label > .tm-gen-feat-input:checked + .tm-gen-feat-card--invite .tm-gen-feat-tick {
    border-color: #4338ca;
    background: #4f46e5;
    color: #fff;
}
