main > .container {
    padding: 70px 15px 20px;
}

.footer {
    background-color: #f5f5f5;
    font-size: .9em;
    height: 60px;
}

.footer > .container {
    padding-right: 15px;
    padding-left: 15px;
}

.not-set {
    color: #c55;
    font-style: italic;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
    content: '';
    left: 3px;
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
    background: transparent;
}

a.asc:after {
    border-bottom: solid 7px #212529;
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px #212529;
    border-bottom-width: 0;
}

.grid-view th {
    white-space: nowrap;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: #999;
}

.error-summary {
    color: #a94442;
    background: #fdf7f7;
    border-left: 3px solid #eed3d7;
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

/* align the logout "link" (button in form) of the navbar */
.nav li > form > button.logout {
    padding-top: 7px;
    color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 767px) {
    .nav li > form > button.logout {
        display: block;
        text-align: left;
        width: 100%;
        padding: 10px 0;
    }
}

.nav > li > form > button.logout:focus,
.nav > li > form > button.logout:hover {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.75);
}

.nav > li > form > button.logout:focus {
    outline: none;
}

.form-group {
    margin-bottom: 1rem;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    animation: spin 0.8s linear infinite;
    margin-left: 6px;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin {
    0% {
        transform: rotate(0)
    }
    100% {
        transform: rotate(360deg)
    }
}

/* Дезигн */
/* ===== Общий фон и текст ===== */
body {
    background-color: #F8F9FA; /* светло-серый фон */
    color: #212529; /* тёмный текст */
}

/* ===== Шапка (металлический бронзовый градиент) ===== */
.navbar-dark.bg-dark {
    background: linear-gradient(90deg, #7C4F35, #C19A6B) !important;
}

/* Текст и иконки в шапке */
.navbar-dark .navbar-brand,
.navbar-dark .nav-link,
.navbar-dark .navbar-toggler-icon {
    color: #fff !important;
}

/* ===== Кнопки (золотистый акцент) ===== */
.btn-outline-secondary {
    color: #B08D57;
    border-color: #B08D57;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background-color: #B08D57;
    color: #fff;
    border-color: #B08D57;
}

/* ===== Заголовки с мягким золотистым оттенком ===== */
h1, h2, h3, h4, h5 {
    color: #A98467;
}

/* ===== Цитата на главной ===== */
.quote {
    color: #B08D57;
    font-style: italic;
}

/* ===== Ссылки ===== */
a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== Цвет фокуса у инпутов/селектов/текстовых полей ===== */
.form-control:focus,
.form-select:focus {
    border-color: #B08D57;
    box-shadow: 0 0 0 0.25rem rgba(176, 141, 87, 0.25);
}

.amount-input {
    font-size: 28px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    letter-spacing: .5px;
}

.total-total {
    font-size: 20px;
}

/* чекбоксы в стиле бренда */
.form-check-input {
    border-color: #B08D57;
}

.form-check-input:checked {
    background-color: #B08D57;
    border-color: #B08D57;
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(176, 141, 87, 0.25);
    border-color: #B08D57;
}

/* системам с поддержкой accent-color — ещё точнее */
@supports (accent-color: auto) {
    .form-check-input {
        accent-color: #B08D57;
    }
}

/* Общие мелочи */
.alert {
    border-radius: .6rem;
}

.alert .btn-close {
    opacity: .4;
}

.alert .btn-close:hover {
    opacity: .7;
}

/* SUCCESS: бронзовая пастель в стиле твоего UI */
.alert-success {
    color: #7C4F35; /* тёплый коричневый текст */
    background: linear-gradient(90deg, #FFF5E9, #F3E3CF); /* мягкий фон */
    border: 1px solid #B08D57; /* бронзовая рамка */
    box-shadow: 0 0 0 .25rem rgba(176, 141, 87, .10);
}

/* DANGER: более пастельный красный */
.alert-danger, .alert-error {
    color: #7B3A3F;
    background-color: #F8DDE0; /* светлый фон */
    border: 1px solid #E9A7AE;
    box-shadow: 0 0 0 .25rem rgba(233, 167, 174, .10);
}

/* NAVBAR: центрируем список пунктов и выравниваем на всех брейкпоинтах */
.navbar .navbar-collapse {
    justify-content: center !important;
}

.navbar .navbar-nav {
    margin: 0 auto !important;
    justify-content: center;
    text-align: center;
}

.navbar .navbar-nav .nav-link {
    padding-left: .75rem;
    padding-right: .75rem;
}

/* FOOTER: центрируем копирайт на всех экранах */
footer, footer .container {
    text-align: center;
}

/* CTA-кнопки (например, "Сканировать по камере"): центр и адекватная ширина */
.cta-row {
    display: flex;
    justify-content: center;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* На телефонах кнопки во всю ширину, на планшетах/десктопах — авто, но с минимальной шириной для красоты */
@media (max-width: 575.98px) {
    .btn-cta {
        width: 100%;
    }
}

@media (min-width: 576px) {
    .btn-cta {
        width: auto;
        min-width: 260px;
    }
}

/* На случай, если где-то остался .text-end на колонке с кнопкой — переопределим */
.cta-row.text-end {
    text-align: initial !important;
}

.link-brand {
    color: #A98467; /* фирменный тёплый */
    text-decoration: none;
}

.link-brand:hover {
    color: #7C4F35; /* тёмный акцент */
    text-decoration: underline;
}

.link-brand:active, .link-brand:focus {
    color: #7C4F35;
    outline: none;
}

.entry-badge {
    background: linear-gradient(90deg, #7C4F35, #C19A6B);
    color: #fff;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.95rem;
}

.purchase-entry-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .055);
}

.free-input-panel {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .055);
}

.shopping-session-panel {
    background: transparent;
}

.session-heading-category {
    font-size: 1.05rem;
    font-weight: 650;
}

.session-heading-store {
    margin-top: 3px;
    color: #6c757d;
    font-size: .92rem;
}

.shopping-session-header {
    padding: 0 4px;
}

.shopping-progress {
    padding: 0 4px;
}

.shopping-progress .progress {
    height: 6px;
    background: #ece8e4;
    border-radius: 999px;
}

.shopping-progress .progress-bar {
    background: #9a6a48;
    border-radius: 999px;
    transition: width .25s ease;
}

#shopping-list-add {
    width: auto;
}

#shopping-list-add .form-control {
    min-height: 44px;
    border: 0;
    border-radius: 12px 0 0 12px;
    background: #f4f2f0;
    box-shadow: none;
}

.shopping-list-add-button {
    width: 46px;
    border: 0;
    border-radius: 0 12px 12px 0;
    background: #f4f2f0;
    color: #7c4f35;
    font-size: 1.5rem;
    line-height: 1;
}

.shopping-session-list {
    border-radius: 16px;
}

.shopping-swipe-wrap {
    position: relative;
    overflow: hidden;
    min-height: 58px;
    margin-bottom: 8px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .055);
}

.shopping-swipe-actions {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
}

.shopping-swipe-edit-label,
.shopping-swipe-delete-label {
    opacity: 0;
    transition: opacity .12s ease;
}

.shopping-swipe-wrap.show-edit {
    background: #9a6a48;
}

.shopping-swipe-wrap.show-delete {
    background: #c05d5d;
}

.shopping-swipe-wrap.show-edit .shopping-swipe-edit-label,
.shopping-swipe-wrap.show-delete .shopping-swipe-delete-label {
    opacity: 1;
}

.shopping-session-item {
    position: relative;
    z-index: 1;
    min-height: 58px;
    background: #fff;
    touch-action: pan-y;
}

.shopping-session-scan {
    min-width: 0;
    white-space: normal;
    border: 0;
    border-radius: 0;
    padding: 14px 16px;
    font-size: 1rem;
    color: #212529;
    transition: transform .2s ease, background-color .15s ease;
}

.shopping-session-scan:hover,
.shopping-session-scan:focus {
    background: #f8f6f3;
    color: #212529;
}

.scan-secondary-actions .btn-link {
    padding: 6px 4px;
    color: #777;
    font-size: .9rem;
    text-decoration: none;
}

.fixed-session-total {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1020;
    padding: 11px 16px calc(11px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, .09);
    text-align: center;
    backdrop-filter: blur(10px);
}

#scan-root.has-fixed-session-total {
    padding-bottom: 88px;
}

@media (max-width: 575.98px) {
    .shopping-session-panel {
        margin-left: -12px;
        margin-right: -12px;
    }

    .shopping-session-header,
    .shopping-progress,
    #shopping-list-add {
        margin-left: 12px;
        margin-right: 12px;
    }

    .shopping-session-list {
        padding: 0 12px;
    }
}

.list-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
}

/* =========================================================
   MOBILE SHOPPING LIST (FINAL, SWIPE VERSION)
   ========================================================= */

/* --- wrapper --- */
.alice-swipe-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    margin-bottom: 12px;
}

/* --- swipe backgrounds --- */
.swipe-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-weight: 600;
    color: #fff;
    z-index: 0;
    pointer-events: none;
}

.swipe-bg-left {
    justify-content: flex-start;
    background: #3b82f6; /* закрепить */
}

.alice-swipe-wrap[data-pinned="1"] .swipe-bg-left {
    background: #22c55e; /* открепить */
}

.swipe-bg-right {
    justify-content: flex-end;
    background: #ef4444; /* удалить */
}

/* --- card --- */
.alice-card {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform .25s ease;
}

/* --- row --- */
.alice-row-mobile {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 14px 14px;
    min-height: 56px;
}

/* --- done toggle --- */
.alice-row-mobile .done-toggle {
    width: 36px;
    height: 36px;
    border-radius: 10px;

    border: 2px solid #c49a6c;
    background: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 700;
    flex-shrink: 0;
}

.alice-row-mobile .done-toggle .check {
    visibility: hidden;
    font-size: 16px;
}

.alice-row-mobile .done-toggle.is-done {
    background: #e6f6ec;
    border-color: #4caf50;
    color: #4caf50;
}

.alice-row-mobile .done-toggle.is-done .check {
    visibility: visible;
}

/* --- title input --- */
.alice-row-mobile .alice-title-input {
    flex: 1;
    border: none;
    outline: none;

    background: transparent;
    font-size: 16px;
    line-height: 1.3;
    padding: 0;

    color: #212529;
}

.alice-row-mobile .alice-title-input:focus {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 2px 4px;
}

/* --- done items --- */
.alice-swipe-wrap.opacity-75 {
    opacity: .65;
}

/* --- section titles --- */
.list-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 14px 0 6px;
}

/* --- undo bar --- */
.undo-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;

    background: #333;
    color: #fff;

    padding: 12px 16px;
    border-radius: 12px;

    display: flex;
    gap: 12px;
    align-items: center;
}

.undo-bar button {
    background: transparent;
    border: none;
    color: #4ade80;
    font-weight: 600;
}
/* по умолчанию подложки скрыты */
.alice-swipe-wrap .swipe-bg {
    opacity: 0;
    transition: opacity .15s ease;
}

/* показываем нужную */
.alice-swipe-wrap.show-left .swipe-bg-left {
    opacity: 1;
}

.alice-swipe-wrap.show-right .swipe-bg-right {
    opacity: 1;
}
.pin-flash {
    animation: pinFlash .3s ease;
}

@keyframes pinFlash {
    0% { box-shadow: 0 0 0 rgba(0,0,0,0); }
    50% { box-shadow: 0 0 0 4px rgba(59,130,246,.25); }
    100% { box-shadow: 0 0 0 rgba(0,0,0,0); }
}

/* обёртка */
.alice-select-wrap {
    position: relative;
}

/* сам селект — отступ слева под иконку */
.alice-select {
    padding-left: 42px;
}

/* шестерёнка "внутри" селекта */
.alice-select-gear {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);

    color: #6c757d;
    text-decoration: none;
    font-size: 18px;
    line-height: 1;

    z-index: 2;
}

.alice-select-gear:hover {
    color: #212529;
}
/* === DONE CHECK FIX (GLOBAL) === */
.done-toggle .check {
    display: none !important;
}

.done-toggle.is-done .check {
    display: inline !important;
}
/* ===== DESKTOP DONE TOGGLE (TABLE) ===== */
.table .done-toggle {
    width: 34px;
    height: 34px;
    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;
    line-height: 1;
}

.table .done-toggle .check {
    font-size: 16px;
}
/* ===== DESKTOP DONE TOGGLE (TABLE) ===== */
.table .done-toggle {
    width: 34px;
    height: 34px;
    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;
    line-height: 1;
}

.table .done-toggle .check {
    font-size: 16px;
}

#camera-wrapper {
    position: relative;
}

#zoom-overlay {
    position: absolute;
    inset: 0;
    display: none;
    pointer-events: none;

    background-repeat: no-repeat;
    background-size: 200%;
    background-position: center;
}


.history-row:hover {
    background:#f5f7fa;
}
.card.history-row:hover{
    transform:translateY(-2px);
    transition:.15s;
}
.cursor-pointer{
    cursor:pointer;
}
.history-row:active{
    transform:scale(.998);
}
