/* Читаемая типографика поверх Tabler; системный шрифт не требует внешних запросов. */
:root {
    --tblr-font-sans-serif: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --tblr-body-font-size: 1rem;
    --tblr-body-line-height: 1.55;
    --tblr-primary: #4263eb;
    --tblr-primary-rgb: 66, 99, 235;
    --tblr-body-bg: #f4f6fa;
    --tblr-secondary: #626f86;
    --tblr-border-radius: .65rem;
}
body { font-size: 1rem; }
.btn { min-height: 44px; font-size: .9375rem; font-weight: 600; gap: .45rem; }
.btn-primary { --tblr-btn-bg: #4263eb; --tblr-btn-border-color: #4263eb; --tblr-btn-hover-bg: #3451cb; }
.form-control, .form-select { min-height: 46px; font-size: 1rem; }
.form-label, .form-check-label { font-size: 1rem; }
.form-label { margin-bottom: .5rem; font-weight: 600; }
.form-check-input { width: 1.15em; height: 1.15em; }
.invalid-feedback, .form-text, .hint-block { font-size: .875rem; }
.invalid-feedback:not(:empty) { display: block; }
.card { border-color: #e2e7ef; border-radius: 14px; box-shadow: 0 2px 5px rgb(18 32 59 / 2%); }
.card-body { padding: 1.5rem; }
.icon { flex-shrink: 0; width: 22px; height: 22px; }
:focus-visible { outline: 3px solid #7d9bff; outline-offset: 3px; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 1100; padding: 1rem; background: white; }
.skip-link:focus { top: 1rem; }

/* Боковая панель на десктопе превращается в раскрываемое меню на телефоне. */
.app-sidebar { background: #172338; border: 0; }
.brand { display: flex; align-items: center; gap: .8rem; color: #fff; font-size: 1.2rem; font-weight: 700; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; background: transparent; color: #fff; border-radius: 12px; font-size: 1rem; letter-spacing: -.04em; }
/* Маска повторяет квадрат внутри GIF 640×640: внешний фон прозрачен, кадры и анимация не меняются. */
.brand-mark img {
    display: block; width: 100%; height: 100%; object-fit: contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'%3E%3Crect x='44' y='44' width='551' height='547' rx='100' fill='white'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.brand small { display: block; color: #a6b3c8; font-size: .75rem; font-weight: 400; margin-top: .3rem; }
.app-sidebar.navbar-vertical .navbar-brand.brand { padding: 1.7rem 1.3rem; justify-content: flex-start; width: auto; margin: 0; }
.app-sidebar .navbar-collapse { padding: 0 1rem; }
.nav-section-label { color: #9aaac1; font-size: .75rem; letter-spacing: .04em; padding: 1rem .75rem .6rem; }
.app-sidebar .nav-link { border: 0; background: transparent; min-height: 50px; gap: .75rem; padding: .8rem .85rem; margin-bottom: .3rem; color: #c5cfe0; border-radius: 9px; font-size: 1rem; text-align: left; }
.app-sidebar .nav-link:hover { background: #22324c; color: #fff; }
.app-sidebar .nav-link.active { background: #2b3e63; color: #fff; box-shadow: inset 3px 0 #7d9bff; }
.app-sidebar .nav-link::before { display: none; }
.sidebar-bottom { width: 100%; margin-top: auto; padding: 1.5rem 0 1rem; }
.sidebar-role { display: block; color: #9aaac1; padding: .5rem .85rem; font-size: .8rem; }
.workspace-header { background: #fff; border-bottom: 1px solid #e2e7ef; padding: 1rem 0; font-size: .875rem; }
.current-account { display: flex; align-items: center; gap: .65rem; min-width: 0; max-width: 60%; }
.page-body { margin-top: 2rem; margin-bottom: 2rem; }
/* Внутренний отступ компенсирует отрицательные поля Bootstrap-строк на планшетах. */
.container-xl { padding-left: 1.25rem; padding-right: 1.25rem; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.page-title { font-size: 1.8rem; font-weight: 700; line-height: 1.25; letter-spacing: -.025em; overflow-wrap: anywhere; }
.page-pretitle { font-size: .75rem; letter-spacing: .06em; margin-bottom: .5rem; color: #626f86; }
.breadcrumb { font-size: .875rem; margin-bottom: 1.5rem; }
.breadcrumb-item { max-width: 100%; overflow-wrap: anywhere; }
.footer { padding: 1.25rem 0; font-size: .875rem; }
.stat-value { font-size: 2.5rem; font-weight: 700; line-height: 1.5; letter-spacing: -.04em; }
.link-with-icon { display: inline-flex; align-items: center; gap: .5rem; font-size: .9375rem; font-weight: 600; }
.empty-icon { display: inline-grid; place-items: center; width: 68px; height: 68px; background: #edf1f9; color: #7486a8; border-radius: 18px; }
.empty-icon .icon { width: 34px; height: 34px; }

.error-summary { padding: 1rem; border-radius: 8px; margin-bottom: 1.5rem; background: #fcebec; color: #a12635; }
.error-summary ul { margin-bottom: 0; }
.error-card { max-width: 720px; margin: 2rem auto; }

/* Toastr: сохраняем штатные иконки/анимацию, согласуем размеры и цвета с нашим интерфейсом. */
#toast-container.toast-top-right, .app-notifications {
    position: fixed;
    z-index: 1090;
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    width: min(420px, calc(100vw - max(1rem, env(safe-area-inset-left)) - max(1rem, env(safe-area-inset-right))));
    max-height: calc(100dvh - 2rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    pointer-events: none;
    padding: 3px;
}
#toast-container > .app-toast, .app-notifications > .app-toast {
    width: 100%;
    margin: 0 0 .75rem;
    padding: 1rem 3.5rem 1.25rem 3.25rem;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgb(18 32 59 / 16%);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    opacity: 1;
    pointer-events: auto;
    cursor: default;
}
#toast-container > .toast-success, .app-notifications > .toast-success { background-color: #267568; }
#toast-container > .toast-error, .app-notifications > .toast-error { background-color: #b93845; }
#toast-container > .toast-warning, .app-notifications > .toast-warning { background-color: #896000; }
#toast-container > .toast-info, .app-notifications > .toast-info { background-color: var(--tblr-primary); }
#toast-container .toast-title, .app-notifications .toast-title { font-size: 1rem; margin-bottom: .25rem; overflow-wrap: anywhere; }
#toast-container .toast-message, .app-notifications .toast-message { line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
#toast-container .toast-close-button {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 8px;
    font-size: 1.5rem;
    line-height: 1;
    text-shadow: none;
    color: #fff;
    opacity: .9;
}
#toast-container .toast-close-button:hover, #toast-container .toast-close-button:focus-visible { background: rgb(255 255 255 / 15%); opacity: 1; }
#toast-container .toast-close-button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
#toast-container .toast-progress { height: 4px; background: #fff; opacity: .65; }

/* Вход: брендовая панель и спокойная форма с крупными полями. */
.auth-page { min-height: 100vh; min-height: 100dvh; background: #eef2f8; display: grid; align-items: center; padding: 2.5rem 1.25rem; }
.auth-container { width: 100%; max-width: 1080px; margin: auto; }
.auth-shell { display: grid; grid-template-columns: .95fr 1fr; border-radius: 24px; overflow: hidden; box-shadow: 0 18px 70px rgb(20 40 78 / 10%); background: #fff; }
.auth-brand { background: #172338; color: #fff; padding: 2.75rem; display: flex; flex-direction: column; min-height: 640px; }
.auth-intro { margin: auto 0; padding: 3rem 0; }
.auth-eyebrow { font-size: .8rem; color: #a5b8e0; margin-bottom: 1rem; }
.auth-intro h2 { color: #fff; font-size: 2.7rem; line-height: 1.15; letter-spacing: -.035em; margin-bottom: 1.5rem; }
.auth-intro p { color: #b9c6da; margin-bottom: 2rem; line-height: 1.7; }
.auth-feature { display: flex; align-items: center; gap: .75rem; color: #d4deee; margin-top: 1rem; font-size: .9375rem; }
.auth-feature .icon { color: #8fa9f8; }
.auth-brand-footer { color: #9dacc3; font-size: .8125rem; }
.auth-form-panel { padding: 3rem; display: flex; align-items: center; }
.auth-form-content { width: 100%; max-width: 390px; margin: auto; }
.auth-form-content h1 { font-size: 1.75rem; line-height: 1.25; letter-spacing: -.025em; margin-bottom: .85rem; }
.auth-form-content .form-control { min-height: 50px; }
.auth-form-content .btn { min-height: 50px; }
.auth-form-content .mb-3 { margin-bottom: 1.25rem !important; }
.auth-access-note { color: #626f86; text-align: center; font-size: .8125rem; margin: 1.5rem 0 0; }
.password-field { position: relative; }
.password-field .form-control { padding-right: 100px; }
.password-toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); background: #fff; border: 0; border-radius: 5px; color: #4263eb; min-height: 40px; padding: 0 .6rem; font-size: .8125rem; font-weight: 600; }

@media (min-width: 992px) {
    .app-sidebar .navbar-collapse { align-items: stretch; height: calc(100dvh - 104px); }
    .container-xl { padding-left: 2rem; padding-right: 2rem; }
}
@media (max-width: 991.98px) {
    .app-sidebar .container-fluid { padding: 0 1rem; }
    .app-sidebar.navbar-vertical .navbar-brand.brand { padding: .85rem 0; margin-right: auto; }
    .app-sidebar .navbar-toggler { margin-left: auto; color: white; min-height: 44px; }
    .app-sidebar .navbar-collapse { padding: 0; }
    .nav-section-label { padding-top: .5rem; }
    .sidebar-bottom { padding: .5rem 0; border-top: 1px solid #33415a; margin-top: .5rem; }
    .sidebar-role { display: none; }
    .auth-brand { padding: 2rem; }
    .auth-form-panel { padding: 2rem; }
    .auth-intro h2 { font-size: 2.15rem; }
}
@media (max-width: 767.98px) {
    .auth-page { padding: 1rem; }
    .auth-shell { grid-template-columns: 1fr; border-radius: 18px; max-width: 480px; margin: auto; }
    .auth-brand { min-height: auto; padding: 1.5rem; }
    .auth-intro, .auth-brand-footer { display: none; }
    .auth-form-panel { padding: 1.75rem 1.5rem; }
    .auth-form-content h1 { font-size: 1.55rem; }
    .page-body { margin-top: 1.5rem; }
    .page-heading { align-items: stretch; flex-direction: column; margin-bottom: 1.5rem; }
    .page-title { font-size: 1.6rem; }
    .workspace-header .container-xl > .text-secondary { display: none; }
    .current-account { max-width: 100%; }
    .card-body { padding: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Общие поля и перенос файлов; размеры одинаковы в клиентском и административном кабинетах. */
.app-date-input, input[type="date"], input[type="datetime-local"] { min-height:44px; border:1px solid var(--tblr-border-color,#dce1e7); border-radius:.5rem; padding:.65rem .75rem; background:var(--tblr-bg-forms,#fff); color:inherit; max-width:100%; }
.flatpickr-calendar { box-shadow:0 12px 36px rgba(24,36,51,.14); border:1px solid var(--tblr-border-color,#dce1e7); border-radius:.8rem; }
.upload-dropzone { display:flex; flex-direction:column; gap:.6rem; min-width:0; padding:1rem; border:1px dashed var(--tblr-primary,#4263eb); border-radius:.75rem; background:rgba(66,99,235,.035); transition:background .15s,border-color .15s; }
.upload-dropzone.is-dragging { background:rgba(66,99,235,.12); outline:2px solid var(--tblr-primary,#4263eb); }
.upload-dropzone-hint { font-weight:500; color:var(--tblr-secondary,#667382); }
.upload-dropzone-files { overflow-wrap:anywhere; font-size:.875rem; }
.upload-dropzone input[type="file"] { max-width:100%; }
/* Единые свёрнутые фильтры повторяют спокойную карточку «Вичерпані товари». */
.app-filter-panel { padding:.5rem 1rem; }
.app-filter-panel > summary { min-height:44px; padding:.65rem 0; cursor:pointer; font-weight:600; }
.app-filter-panel > summary:focus-visible { outline:2px solid var(--tblr-primary,#4263eb); outline-offset:2px; border-radius:.35rem; }
.app-filter-panel > .app-filter-content { padding-top:1rem; padding-bottom:.5rem; min-width:0; }
.app-filter-panel .btn { max-width:100%; white-space:normal; }
/* Панель автора внутри фильтров использует общую рамку и не сужает поля на телефоне. */
.app-filter-content > .card.card-body { padding:0; border:0; box-shadow:none; }
.app-filter-panel .commerce-filters { margin-bottom:0; }
/* Полноэкранная кнопка — отдельное действие справа, форма раскрывается на всю ширину. */
.app-filter-toolbar { position:relative; }
.app-filter-toolbar > [data-table-screen-tools] { position:absolute; top:.5rem; right:1rem; }
.app-filter-toolbar .table-screen-tools { margin:0; }
.app-filter-toolbar .table-screen-tools .btn { padding-inline:.5rem; font-size:.875rem; }
.app-filter-toolbar:has(.table-screen-tools) > .app-filter-panel > summary { max-width:calc(100% - 9rem); }
.app-filter-count { font-size:.8rem; font-weight:400; }
.table-screen-tools { display:flex; justify-content:flex-end; gap:.5rem; margin:0 0 1rem; }
.table-fullscreen { display:flex; flex-direction:column; width:100%; height:100%; padding:20px; gap:12px; background:var(--tblr-body-bg,#f6f8fb); }
.table-fullscreen-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.5rem; font-weight:600; }
.table-fullscreen iframe { flex:1; min-height:0; width:100%; border:0; background:transparent; }
.table-frame-body { margin:0 !important; padding:0 !important; min-width:0; background:var(--tblr-body-bg,#f6f8fb); }
.table-frame-content { width:100% !important; max-width:none !important; margin:0 !important; padding:0 !important; }
.table-frame-decoration { display:none !important; }
.table-frame-content .table-responsive, .table-frame-content .commerce-table-wrap { max-height:none; }
@media(max-width:767px) { .table-fullscreen { padding:0; gap:0; } .table-fullscreen-toolbar { padding:8px; } .table-fullscreen-toolbar .btn { font-size:.8rem; } }

/* Кнопка таблицы занимает место в её заголовке, не добавляя пустой ряд над карточкой. */
.table-screen-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.75rem}.table-screen-heading>.table-screen-tools{margin:0 0 0 auto;flex-shrink:0}
/* Подтверждения сохраняют размеры кабинета и помещаются поверх его диалогов. */
.swal2-container { z-index: 1200; }
.app-confirm { border-radius: 1rem; font-family: inherit; }
.app-confirm .swal2-title { font-size: 1.35rem; overflow-wrap: anywhere; }
.app-confirm .swal2-html-container { font-size: 1rem; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.app-confirm .swal2-actions { gap: .75rem; }
.app-confirm .swal2-actions .btn { min-width: 88px; min-height: 44px; }
.app-confirm .swal2-input-label { font-size: 1rem; }
