html {
    scroll-behavior: auto;
}

.dashboard-body {
    display: flex;
    min-height: 100vh;
    background-color: var(--light);
}

[data-theme="dark"] .dashboard-body {
    background-color: var(--bg-body);
}

.bottom-nav {
    display: none;
    position: fixed;
    bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) - 18px));
    left: 12px;
    right: 12px;
    z-index: var(--z-bottom-nav);
    height: 56px;
    padding-bottom: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 28px;
    border: 1px solid transparent;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.02),
        0 8px 24px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(0, 0, 0, 0.03) inset;
    will-change: transform;
    clip-path: inset(0 round 28px);
}

.bottom-nav-indicator {
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 0;
    border-radius: 22px;
    background: rgba(59, 130, 246, 0.14);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transform: translate3d(0, 0, 0);
    transition:
        transform 0.34s cubic-bezier(0.34, 1.35, 0.64, 1),
        width 0.34s cubic-bezier(0.34, 1.35, 0.64, 1),
        opacity 0.18s ease;
    will-change: transform, width;
}

[data-theme="dark"] .bottom-nav-indicator {
    background: rgba(59, 130, 246, 0.22);
}

.bottom-nav-indicator.is-ready {
    opacity: 1;
}

.bottom-nav-indicator.no-transition {
    transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .bottom-nav-indicator {
        transition: opacity 0.12s ease !important;
    }
}

[data-theme="light"] .bottom-nav,
:not([data-theme="dark"]) .bottom-nav {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .bottom-nav {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0px 2px 4px rgba(0, 0, 0, 0.1),
        0px 8px 24px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.bottom-nav-item {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    transition: color 0.2s;
    padding: 4px 0;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item i {
    font-size: 20px;
    line-height: 1;
    transition: color 0.2s, transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.bottom-nav-item:active i {
    transform: scale(0.9);
}

.bottom-nav-item span {
    font-size: 10px;
    line-height: 1;
    margin-top: 1px;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item:hover {
    color: var(--primary);
}

@media (max-width: 480px) {
    .bottom-nav-item span {
        display: none;
    }

    .bottom-nav-item .icon-badge-wrap {
        display: inline-flex;
    }

    .bottom-nav-item .nav-badge {
        display: inline-block;
    }

    .bottom-nav-item .nav-badge.hidden {
        display: none;
    }

    .bottom-nav-item i {
        font-size: 22px;
    }
}

.icon-badge-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--card-bg);
    margin: 0;
}

.nav-badge.hidden {
    display: none;
}

.sidebar {
    width: 280px;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: var(--space-6);
    position: fixed;
    height: 100vh;
    z-index: var(--z-sidebar);
    transition: transform var(--transition-base);
    will-change: transform;
}

@supports not (backdrop-filter: blur(16px)) {
    .sidebar {
        background: var(--light, #ffffff);
    }

    [data-theme="dark"] .sidebar {
        background: #14161a;
    }
}

[data-theme="dark"] .sidebar {
    background: rgba(0, 0, 0, 0.7);
    border-color: var(--border);
}

.sidebar-header {
    margin-bottom: var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-nav {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 2px;
}

.sidebar-nav-indicator {
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 20px;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transform: translate3d(0, 0, 0);
    transition:
        transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.16s ease;
    will-change: transform;
}

.sidebar-nav-indicator.is-ready {
    opacity: 1;
}

.sidebar-nav-indicator.no-transition {
    transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-nav-indicator {
        transition: opacity 0.12s ease !important;
    }
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 11px;
    color: var(--secondary);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    transition: background-color 0.16s ease, color 0.16s ease;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.sidebar-nav .nav-item > i:first-child {
    width: 20px;
    text-align: center;
    font-size: 0.96rem;
    flex-shrink: 0;
    opacity: 0.86;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.nav-item:hover {
    background: rgba(15, 23, 42, 0.055);
    color: var(--text-main);
}

[data-theme="dark"] .nav-item:hover {
    background: rgba(255, 255, 255, 0.065);
    color: #f8fafc;
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.11);
    color: var(--primary);
}

[data-theme="dark"] .nav-item.active {
    background: rgba(59, 130, 246, 0.17);
    color: #60a5fa;
}

.nav-item.active > i:first-child {
    opacity: 1;
}

.nav-ext-icon {
    margin-left: auto;
    font-size: 0.72rem;
    opacity: 0.35;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.nav-item:hover .nav-ext-icon {
    opacity: 0.75;
    transform: translate(1px, -1px);
}

.nav-badge-pill {
    margin-left: auto;
    min-width: 21px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--error);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    flex-shrink: 0;
}

.nav-badge-pill.hidden {
    display: none;
}

.sidebar-footer {
    position: relative;
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

.sidebar-profile-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.55rem 0.65rem;
    border-radius: 13px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    text-align: left;
    color: var(--text-main);
    font: inherit;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.14s ease, box-shadow 0.18s ease;
}

.sidebar-profile-card:active {
    transform: scale(0.985);
}

.sidebar-profile-card:hover,
.sidebar-profile-card.is-open {
    background: rgba(15, 23, 42, 0.05);
    border-color: var(--border);
}

[data-theme="dark"] .sidebar-profile-card:hover,
[data-theme="dark"] .sidebar-profile-card.is-open {
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-profile-card.is-open .sidebar-profile-avatar {
    box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px rgba(59, 130, 246, 0.45);
}

.sidebar-profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.28);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.sidebar-profile-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.sidebar-profile-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-profile-email {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-profile-chevron {
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.26s cubic-bezier(0.22, 1.25, 0.36, 1), color 0.16s ease;
}

.sidebar-profile-card.is-open .sidebar-profile-chevron {
    transform: rotate(180deg);
    color: var(--primary);
}

.sidebar-profile-menu {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 10px);
    padding: 7px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow:
        0 18px 42px -12px rgba(15, 23, 42, 0.22),
        0 6px 16px -6px rgba(15, 23, 42, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    display: flex;
    flex-direction: column;
    gap: 3px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(0, 12px, 0) scale(0.94);
    transform-origin: bottom center;
    transition:
        opacity 0.14s ease-in,
        transform 0.15s ease-in,
        visibility 0.15s ease-in;
    will-change: transform, opacity;
    z-index: 40;
}

[data-theme="dark"] .sidebar-profile-menu {
    background: var(--card-bg);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        0 22px 48px -12px rgba(0, 0, 0, 0.72),
        0 8px 18px -6px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.sidebar-profile-menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(0, 0, 0) scale(1);
    transition:
        opacity 0.2s ease-out,
        transform 0.28s cubic-bezier(0.22, 1.28, 0.36, 1),
        visibility 0s linear 0s;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.48rem 0.6rem;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    opacity: 0;
    transform: translateY(6px);
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        opacity 0.18s ease,
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-profile-menu.is-open .sidebar-menu-item {
    opacity: 1;
    transform: translateY(0);
}

.sidebar-profile-menu.is-open .sidebar-menu-item:nth-of-type(1) { transition-delay: 0.02s; }
.sidebar-profile-menu.is-open .sidebar-menu-item:nth-of-type(2) { transition-delay: 0.045s; }
.sidebar-profile-menu.is-open .sidebar-menu-item:nth-of-type(3) { transition-delay: 0.07s; }
.sidebar-profile-menu.is-open .sidebar-menu-item:nth-of-type(4) { transition-delay: 0.095s; }

.sidebar-profile-menu.is-open .sidebar-menu-item:active {
    transform: scale(0.98);
    transition-delay: 0s;
}

.sidebar-menu-item > i {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.84rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.16s ease;
}

.sidebar-menu-item:hover {
    background: rgba(37, 99, 235, 0.07);
}

[data-theme="dark"] .sidebar-menu-item:hover {
    background: rgba(255, 255, 255, 0.065);
}

.sidebar-menu-item:hover > i {
    background: rgba(59, 130, 246, 0.14);
    color: var(--primary);
    transform: scale(1.04);
}

.sidebar-menu-pill {
    margin-left: auto;
    padding: 0.16rem 0.52rem;
    border-radius: 7px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.14);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-menu-item:hover .sidebar-menu-pill {
    background: rgba(59, 130, 246, 0.14);
    color: var(--primary);
}

.sidebar-menu-divider {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0.4rem;
}

[data-theme="dark"] .sidebar-menu-divider {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-menu-item.is-danger {
    color: var(--error, #ef4444);
}

.sidebar-menu-item.is-danger > i {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error, #ef4444);
}

.sidebar-menu-item.is-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.sidebar-menu-item.is-danger:hover > i {
    background: rgba(239, 68, 68, 0.18);
    color: var(--error, #ef4444);
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-profile-menu,
    .sidebar-profile-menu.is-open,
    .sidebar-menu-item,
    .sidebar-profile-chevron {
        transition: opacity 0.12s ease !important;
        transition-delay: 0s !important;
        transform: none !important;
    }
}

.full-width {
    width: 100%;
    justify-content: center;
}

.main-content {
    margin-left: 280px;
    flex-grow: 1;
    padding: var(--space-10);
    max-width: 1200px;
    transition: margin-left var(--transition-base);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    z-index: 500;
    background: rgba(248, 250, 252, 0.5);
    padding: 0 var(--space-5);
    transition: background var(--transition-base), border-color var(--transition-base);
    isolation: isolate;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-bottom: 1px solid transparent;
    will-change: transform;
}

[data-theme="dark"] .content-header {
    background: rgba(0, 0, 0, 0.5);
}

.content-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    margin: 0;
}

[data-theme="dark"] .content-header h1 {
    color: var(--text-main);
}

#add-item-btn {
    animation: pulseAddBtn 2.5s ease-in-out 3;
}

@keyframes pulseAddBtn {

    0%,
    100% {
        box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
    }

    50% {
        box-shadow: 0 4px 24px rgba(59, 130, 246, 0.55), 0 0 0 6px rgba(59, 130, 246, 0.1);
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-10);
    margin-top: var(--space-8);
}

.stat-card {
    background: var(--white);
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

[data-theme="dark"] .stat-card {
    background: var(--card-bg);
    border-color: var(--border);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.stat-icon.blue {
    background: #eff6ff;
    color: #2563eb;
}

.stat-icon.green {
    background: #dcfce7;
    color: #16a34a;
}

.stat-icon.orange {
    background: #fff7ed;
    color: #ea580c;
}

.stat-icon.red {
    background: #fef2f2;
    color: #dc2626;
}

[data-theme="dark"] .stat-icon.blue {
    background: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
}

[data-theme="dark"] .stat-icon.green {
    background: rgba(22, 163, 74, 0.2);
    color: #4ade80;
}

[data-theme="dark"] .stat-icon.orange {
    background: rgba(234, 88, 12, 0.2);
    color: #fb923c;
}

[data-theme="dark"] .stat-icon.red {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dark);
}

[data-theme="dark"] .stat-value {
    color: var(--text-main);
}

.items-section {
    background: var(--light);
}

[data-theme="dark"] .items-section {
    background: var(--bg-body);
}

.items-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--dark);

}

[data-theme="dark"] .items-section h2 {
    color: var(--text-main);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-6);
}

.items-grid .rotating-loader,
.receipts-grid .rotating-loader {
    grid-column: 1 / -1;
    justify-self: center;
    padding: 60px 20px;
}

.main-content>.rotating-loader {
    min-height: calc(100vh - 250px);
    justify-content: center;
}

.item-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .item-card {
    background: var(--card-bg);
    border-color: rgba(255, 255, 255, 0.08);
}

.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .item-card:hover {
    box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.4);
}

.item-status-badge.none {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    font-size: 0.7rem;
}

[data-theme="dark"] .item-status-badge.none {
    background: rgba(148, 163, 184, 0.15);
}

.tag {
    font-size: 0.75rem;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    background: var(--light);
    color: var(--secondary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

[data-theme="dark"] .tag {
    background: rgba(255, 255, 255, 0.05);
}

.no-warranty-track {
    height: var(--space-2);
    background: repeating-linear-gradient(90deg,
            var(--border) 0px,
            var(--border) 6px,
            transparent 6px,
            transparent 10px);
    border-radius: var(--radius-full);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.no-warranty-track i {
    position: absolute;
    font-size: 0.6rem;
    color: var(--text-secondary);
    background: var(--card-bg);
    padding: 0 6px;
    line-height: 1;
}

[data-theme="dark"] .no-warranty-track {
    background: repeating-linear-gradient(90deg,
            rgba(255, 255, 255, 0.12) 0px,
            rgba(255, 255, 255, 0.12) 6px,
            transparent 6px,
            transparent 10px);
}

[data-theme="dark"] .no-warranty-track i {
    background: var(--card-bg);
}

.days-left-text {
    font-size: 0.95rem;
    font-weight: 700;
}

.days-left-text.active {
    color: var(--success);
}

.days-left-text.warning {
    color: var(--warning);
}

.days-left-text.expired {
    color: var(--error);
}

.days-left-text.none {
    color: var(--secondary);
}

/* ==== "Мои вещи" — карточка товара, добавленного пользователем ==== */

#items-grid-mine,
#items-grid-verified {
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
}

.mine-item-card {
    --accent: var(--secondary);
    --accent-soft: rgba(100, 116, 139, 0.14);
    --accent-strong: var(--secondary);
    --accent-text: #fff;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
}

[data-theme="dark"] .mine-item-card {
    border-color: rgba(255, 255, 255, 0.08);
    --accent-strong: color-mix(in srgb, var(--secondary) 55%, white);
    --accent-text: color-mix(in srgb, var(--secondary) 25%, black);
}

@media (hover: hover) and (pointer: fine) {
    .mine-item-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
        border-color: color-mix(in srgb, var(--accent) 45%, transparent);
    }
}

.mine-item-card.is-active {
    --accent: var(--success);
    --accent-soft: rgba(16, 185, 129, 0.16);
    --accent-strong: color-mix(in srgb, var(--success) 82%, black);
    --accent-text: #fff;
}

.mine-item-card.is-warning {
    --accent: var(--warning);
    --accent-soft: rgba(245, 158, 11, 0.18);
    --accent-strong: color-mix(in srgb, var(--warning) 78%, black);
    --accent-text: #fff;
}

.mine-item-card.is-expired {
    --accent: var(--error);
    --accent-soft: rgba(239, 68, 68, 0.16);
    --accent-strong: color-mix(in srgb, var(--error) 80%, black);
    --accent-text: #fff;
}

[data-theme="dark"] .mine-item-card.is-active {
    --accent-strong: color-mix(in srgb, var(--success) 55%, white);
    --accent-text: color-mix(in srgb, var(--success) 25%, black);
}

[data-theme="dark"] .mine-item-card.is-warning {
    --accent-strong: color-mix(in srgb, var(--warning) 55%, white);
    --accent-text: color-mix(in srgb, var(--warning) 25%, black);
}

[data-theme="dark"] .mine-item-card.is-expired {
    --accent-strong: color-mix(in srgb, var(--error) 55%, white);
    --accent-text: color-mix(in srgb, var(--error) 25%, black);
}

.mine-item-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px 18px;
    background: var(--accent-soft);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--card-bg)), color-mix(in srgb, var(--accent) 10%, var(--card-bg)));
}

.mine-item-icon {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
    color: var(--accent-strong);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mine-item-heading {
    min-width: 0;
    flex: 1;
}

.mine-item-title {
    margin: 0 0 2px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.28;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.mine-item-subrow {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    margin-top: 2px;
}

.mine-item-subrow .service-kind-badge {
    flex-shrink: 0;
}

.mine-item-brand {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--secondary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mine-item-body {
    padding: 20px 24px 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1;
}

.mine-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mine-stat {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--light);
    border: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
    min-width: 0;
}

[data-theme="dark"] .mine-stat {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

.mine-stat.accent {
    background: var(--accent-soft);
}

.mine-stat-icon {
    flex-shrink: 0;
    width: 18px;
    text-align: center;
    color: var(--secondary);
    font-size: 0.76rem;
}

.mine-stat.accent .mine-stat-icon {
    color: var(--accent-strong);
}

.mine-stat-text {
    min-width: 0;
}

.mine-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--secondary);
    opacity: 0.9;
    margin-bottom: 2px;
}

.mine-stat-value {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mine-stat.accent .mine-stat-value {
    color: var(--accent-strong);
}

[data-theme="dark"] .mine-stat.accent .mine-stat-value {
    color: var(--accent);
}

.mine-progress {
    padding-top: 2px;
}

.mine-progress-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}

.mine-progress-top .days-left-text {
    font-size: 0.86rem;
    font-weight: 700;
}

.mine-progress-until {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--secondary);
    white-space: nowrap;
}

.mine-progress-track {
    height: 7px;
    border-radius: var(--radius-full);
    background: var(--light);
    overflow: hidden;
}

[data-theme="dark"] .mine-progress-track {
    background: rgba(255, 255, 255, 0.08);
}

.mine-progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--secondary);
}

.mine-progress-fill.active {
    background: linear-gradient(90deg, color-mix(in srgb, var(--success) 55%, white), var(--success));
}

.mine-progress-fill.warning {
    background: linear-gradient(90deg, color-mix(in srgb, var(--warning) 55%, white), var(--warning));
}

.mine-progress-fill.expired {
    background: var(--error);
}

@media (prefers-reduced-motion: reduce) {
    .mine-progress-fill {
        transition: none;
    }
}

.mine-progress .no-warranty-track {
    margin: 0;
}

.mine-item-actions-wrap {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
}

[data-theme="dark"] .mine-item-actions-wrap {
    border-top-color: rgba(255, 255, 255, 0.07);
}

.mine-item-actions {
    display: flex;
    gap: 8px;
}

.mine-item-actions-wrap .btn-action,
.mine-item-actions .btn-action {
    height: 44px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-main);
    font-size: 0.84rem;
    font-weight: 700;
    padding: 0 15px;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.16s ease;
}

.mine-item-actions-wrap .btn-action:focus-visible,
.mine-item-actions .btn-action:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.mine-item-actions-wrap .btn-calendar-wide {
    width: 100%;
    height: 44px;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.28);
    color: #047857;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.mine-item-actions-wrap .btn-calendar-wide i {
    font-size: 0.92rem;
}

.mine-item-actions-wrap .btn-calendar-wide:hover {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
}

[data-theme="dark"] .mine-item-actions-wrap .btn-calendar-wide {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(52, 211, 153, 0.32);
    color: #4ade80;
}

[data-theme="dark"] .mine-item-actions-wrap .btn-calendar-wide:hover {
    background: rgba(16, 185, 129, 0.28);
    border-color: rgba(74, 222, 128, 0.5);
    color: #86efac;
}

.mine-item-actions .btn-delete-item,
.mine-item-actions .btn-open-linked-receipt {
    flex: 0 0 auto;
    width: 44px;
    padding: 0;
}

.mine-item-actions .btn-edit-item {
    flex: 1;
    background: var(--primary);
    color: var(--white);
}

.mine-item-actions .btn-edit-item:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.mine-item-actions .btn-open-linked-receipt,
.mine-item-actions.verified-actions .btn-download-item-receipt {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.22);
    color: color-mix(in srgb, var(--primary) 88%, black);
}

.mine-item-actions.verified-actions .btn-download-item-receipt {
    flex: 1;
    width: 100%;
    padding: 0 15px;
}

.mine-item-actions .btn-open-linked-receipt:hover:not(:disabled),
.mine-item-actions.verified-actions .btn-download-item-receipt:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.38);
    transform: translateY(-1px);
}

[data-theme="dark"] .mine-item-actions .btn-open-linked-receipt,
[data-theme="dark"] .mine-item-actions.verified-actions .btn-download-item-receipt {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(96, 165, 250, 0.28);
    color: #93c5fd;
}

[data-theme="dark"] .mine-item-actions .btn-open-linked-receipt:hover:not(:disabled),
[data-theme="dark"] .mine-item-actions.verified-actions .btn-download-item-receipt:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.28);
    border-color: rgba(96, 165, 250, 0.45);
}

.mine-item-actions-wrap .btn-action:disabled,
.mine-item-actions .btn-action:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.mine-item-actions .btn-delete-item {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: color-mix(in srgb, var(--error) 88%, black);
}

.mine-item-actions .btn-delete-item:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.36);
    transform: translateY(-1px);
}

[data-theme="dark"] .mine-item-actions .btn-delete-item {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(248, 113, 113, 0.28);
    color: #f87171;
}

[data-theme="dark"] .mine-item-actions .btn-delete-item:hover {
    background: rgba(239, 68, 68, 0.28);
    border-color: rgba(248, 113, 113, 0.44);
}

@media (max-width: 480px) {
    .mine-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ==== Карточка загруженного пользователем чека ==== */

/* ==== Карточка чека от бизнес-партнёра ==== */

.mine-item-card.business .mine-item-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

[data-theme="dark"] .mine-item-card.business .mine-item-icon {
    background: rgba(16, 185, 129, 0.2);
}

.mine-item-actions .btn-download-biz {
    background: rgba(59, 130, 246, 0.14);
    color: color-mix(in srgb, var(--primary) 85%, black);
}

.mine-item-actions .btn-download-biz:hover {
    background: rgba(59, 130, 246, 0.22);
    transform: translateY(-1px);
}

[data-theme="dark"] .mine-item-actions .btn-download-biz {
    background: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
}

[data-theme="dark"] .mine-item-actions .btn-download-biz:hover {
    background: rgba(59, 130, 246, 0.35);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal-overlay);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-overlay.closing .modal-content {
    transform: translateY(40px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-2xl);
    will-change: transform;
    padding: var(--space-8);
    transform: translateY(20px);
    transition: all var(--transition-base);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
}

/* Заголовок вынесен из области прокрутки (не наложен поверх неё), как
   #create-receipt-modal на странице "Для бизнеса" — так у него ровно тот же
   цвет фона, что и у остальной модалки, без наложения полупрозрачных слоёв
   друг на друга. */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: none;
    margin-bottom: var(--space-6);
}

/* Форма — единственная прокручиваемая часть модалки; шапка остаётся
   неподвижной сверху, а не наезжает своим фоном на общий фон модалки. */
.modal-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0 calc(-1 * var(--space-8));
    padding: 0 var(--space-8);
}

.modal-form::-webkit-scrollbar {
    width: 6px;
}

.modal-form::-webkit-scrollbar-track {
    background: transparent;
}

.modal-form::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.modal-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
}

[data-theme="dark"] .modal-header h2 {
    color: var(--text-main);
}

/* Заголовок модалки с иконкой и подзаголовком — тот же паттерн, что и на
   странице "Для бизнеса" (.modal-heading / .modal-heading-icon /
   .modal-heading-text), чтобы модалки "Мои вещи" и "Чеки" выглядели
   единообразно с business.html. */
.modal-heading {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.modal-heading-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    color: var(--primary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(59, 130, 246, 0.04));
    border: 1px solid rgba(59, 130, 246, 0.18);
    border-radius: 13px;
}

.modal-heading-text {
    min-width: 0;
}

.modal-heading-text h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--dark);
}

[data-theme="dark"] .modal-heading-text h2 {
    color: var(--text-main);
}

.modal-heading-text p {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-close {
    background: var(--light);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.3s;
}

[data-theme="dark"] .btn-close {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.btn-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-color: var(--error);
}

/* Единый вид блока подтверждения удаления (иконка + заголовок + текст),
   как на странице "Для бизнеса" (.delete-confirm-card). */
.delete-confirm-card {
    text-align: center;
    padding: 2.5rem 2rem !important;
}

.delete-icon-wrapper {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.delete-confirm-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
    color: var(--dark);
}

[data-theme="dark"] .delete-confirm-card h2 {
    color: var(--text-main);
}

.delete-confirm-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0;
}

.modal-actions.confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.5rem !important;
}

.modal-actions.confirm-actions button {
    flex: none;
}

.input-group {
    margin-bottom: var(--space-5);
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--dark);
}

[data-theme="dark"] .input-group label {
    color: var(--text-main);
}

.input-group input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    background: var(--white);
    color: var(--dark);
}

[data-theme="dark"] .input-group input {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-main);
}

/* Quick Warranty Presets Chips */
.warranty-presets {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.warranty-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1;
    min-height: 22px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

[data-theme="dark"] .warranty-chip {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.warranty-chip:hover {
    border-color: var(--primary);
    color: var(--text-main, var(--dark));
    background: rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .warranty-chip:hover {
    color: #ffffff;
}

.warranty-chip.is-selected {
    border-color: var(--primary);
    background: var(--primary) !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.25);
}

.btn:disabled:has(.fa-spin),
.btn.is-loading {
    opacity: 0.8 !important;
    cursor: wait !important;
}

.modal-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-8);
    justify-content: flex-end;
}

.modal-actions button {
    flex: none;
}

/* Кнопки формы растягиваются поровну на всю ширину футера (50/50). */
.modal-actions:not(.confirm-actions) button {
    flex: 1 1 0;
    padding: var(--space-4) var(--space-6);
}

@media (max-width: 900px) {

    .bottom-nav {
        display: flex;
    }

    .sidebar {
        display: none;
    }

    .sidebar.active {
        display: flex;
        transform: none;
    }

    .main-content {
        margin-left: 0;
        padding: 24px;
        padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    }

    .sidebar-footer {
        display: none !important;
    }

    body.scroll-locked {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow-y: hidden !important;
        overscroll-behavior: none;
    }

    .modal-overlay {
        overflow-y: auto;
        align-items: center;
        padding: 40px 20px calc(72px + env(safe-area-inset-bottom, 0));
        box-sizing: border-box;
    }

    .modal-content {
        width: 100%;
        max-width: 480px;
        max-height: calc(100vh - 8rem);
        margin: auto;
        padding: var(--space-6);
        border-radius: 16px;
        transform: translateY(0);
        opacity: 0;
        transform: scale(0.95);
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .modal-overlay.active .modal-content {
        opacity: 1;
        transform: scale(1);
    }

    .modal-overlay.closing .modal-content {
        opacity: 0;
        transform: scale(0.95);
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    /* Отступы формы под мобильный padding модалки (var(--space-6)). */
    .modal-form {
        margin: 0 calc(-1 * var(--space-6));
        padding: 0 var(--space-6);
    }

    .modal-content::before {
        content: '';
        display: block;
        width: 38px;
        height: 4px;
        background: rgba(255, 255, 255, 0.22);
        border-radius: 2px;
        margin: -0.35rem auto 0.75rem;
        flex-shrink: 0;
    }

    [data-theme="light"] .modal-content::before,
    :not([data-theme="dark"]) .modal-content::before {
        background: rgba(0, 0, 0, 0.18);
    }

    .btn-close {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.15rem;
    }

    .modal-overlay.keyboard-active .modal-heading-icon,
    .modal-content.keyboard-active .modal-heading-icon {
        display: none !important;
    }

    .modal-overlay.keyboard-active .modal-heading-text p,
    .modal-content.keyboard-active .modal-heading-text p {
        display: none !important;
    }

    .modal-overlay.keyboard-active .modal-header,
    .modal-content.keyboard-active .modal-header {
        margin-bottom: 0.35rem !important;
    }

    .modal-overlay.keyboard-active .modal-heading-text h2,
    .modal-content.keyboard-active .modal-heading-text h2 {
        font-size: 0.98rem !important;
    }

    .modal-content input,
    .modal-content select,
    .modal-content textarea,
    .modal-content .custom-select-trigger {
        font-size: 16px !important;
    }

    /* На мобильном кнопки формы складываются в столбец на всю ширину,
       основное действие (submit) — сверху, как на странице "Для бизнеса". */
    .modal-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .modal-actions button {
        width: 100%;
    }

    /* Крупные модалки с формой (добавление/редактирование вещи, загрузка
       чека) раскрываются на весь экран снизу и закрываются тем же слайдом,
       как #create-receipt-modal на странице "Для бизнеса". */
    #add-modal.modal-overlay,
    #edit-modal.modal-overlay,
    #upload-modal.modal-overlay,
    #delete-item-modal.modal-overlay,
    #delete-receipt-modal.modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    #add-modal .modal-content,
    #edit-modal .modal-content,
    #upload-modal .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: calc(100dvh - env(safe-area-inset-bottom, 0) - 15px);
        margin: 0;
        padding: var(--space-6) var(--space-6) calc(var(--space-6) + env(safe-area-inset-bottom, 0));
        border-radius: 22px 22px 0 0;
        transform: translateY(100%);
        opacity: 1;
        display: flex;
        flex-direction: column;
    }

    #add-modal .modal-form,
    #edit-modal .modal-form,
    #upload-modal .modal-form {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    #add-modal .modal-actions,
    #edit-modal .modal-actions,
    #upload-modal .modal-actions {
        border-top: 1px solid var(--border);
        padding: 1rem 0 calc(0.5rem + env(safe-area-inset-bottom, 0));
        margin-top: 1.25rem;
    }

    #delete-item-modal .modal-content,
    #delete-receipt-modal .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 24px 24px 0 0;
        padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0));
        text-align: center;
        transform: translateY(100%);
        opacity: 1;
        margin: 0;
    }

    #delete-item-modal.modal-overlay.active .modal-content,
    #delete-receipt-modal.modal-overlay.active .modal-content {
        transform: translateY(0);
        opacity: 1;
    }

    #delete-item-modal.modal-overlay.closing .modal-content,
    #delete-receipt-modal.modal-overlay.closing .modal-content {
        transform: translateY(100%);
        opacity: 1;
    }

    .modal-actions.confirm-actions {
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
        margin-top: 1.25rem;
    }

    .modal-actions.confirm-actions .btn-danger {
        order: 1;
        min-height: 48px;
        font-size: 0.98rem;
        font-weight: 700;
    }

    .modal-actions.confirm-actions .btn-outline {
        order: 2;
        min-height: 44px;
    }

    #add-modal.modal-overlay.active .modal-content,
    #edit-modal.modal-overlay.active .modal-content,
    #upload-modal.modal-overlay.active .modal-content {
        transform: translateY(0);
        opacity: 1;
    }

    #add-modal.modal-overlay.closing .modal-content,
    #edit-modal.modal-overlay.closing .modal-content,
    #upload-modal.modal-overlay.closing .modal-content {
        transform: translateY(100%);
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .modal-actions.confirm-actions {
        grid-template-columns: 1fr;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .content-header .btn {
        width: 100%;
    }

    .input-row {
        grid-template-columns: 1fr;
    }

    .modal-form .input-row {
        gap: 0;
    }

    .modal-form .input-group {
        margin-bottom: var(--space-4);
    }
}

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--secondary);
    font-size: 1.1rem;
    gap: 12px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 1.1rem;
    grid-column: 1 / -1;
    animation: emptyStateIn 0.5s ease;
}

@keyframes emptyStateIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.empty-icon {
    font-size: 2.75rem;
    margin-bottom: 16px;
    opacity: 0.35;
    color: var(--primary);
}

.empty-state h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.95rem;
    max-width: 380px;
    margin: 0 auto 20px;
    line-height: 1.5;
    color: var(--text-muted);
}

.empty-state-cta {
    margin: 0 auto;
}

.empty-state.error {
    color: var(--error);
}

.controls-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    margin-left: 8px;
}

.circle-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    font-size: 0.9rem;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

[data-theme="dark"] .circle-btn {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

@media (hover: hover) and (pointer: fine) {
    .circle-btn:hover {
        border-color: var(--primary);
        color: var(--primary);
        transform: translateY(-2px);
    }
}

.circle-btn i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.circle-btn:active i {
    transform: rotate(180deg);
}

#logout-btn {
    margin-top: 8px;
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.1);
    justify-content: center;
}

[data-theme="dark"] #logout-btn {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

#logout-btn:hover {
    background: var(--error) !important;
    color: #ffffff !important;
    border-color: var(--error) !important;
    transform: translateY(-2px);
}

.settings-logout {
    display: none;
}

#logout-btn-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

[data-theme="dark"] #logout-btn-mobile {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

#logout-btn-mobile:hover {
    background: var(--error) !important;
    color: #fff !important;
    border-color: var(--error) !important;
}

@media (max-width: 900px) {
    .settings-logout {
        display: block;
    }
}

.input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--white);
    color: var(--dark);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat !important;
    background-position: right 12px center;
    background-size: 16px;
    cursor: pointer;
}

[data-theme="dark"] .input-group select {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.mobile-top-bar {
    display: none;
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    z-index: 1000;

    align-items: center;
    justify-content: space-between;

    padding: 0 20px;
    transition: background 0.3s ease, border-color 0.3s ease;

    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    will-change: transform;
    border-bottom: 1px solid transparent;
}

[data-theme="light"] .mobile-top-bar,
:not([data-theme="dark"]) .mobile-top-bar {
    background: rgba(255, 255, 255, 0.3);
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .mobile-top-bar {
    background: rgba(0, 0, 0, 0.3);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.brand-mobile {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-brand);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 0.06em;
    color: var(--text-main);

    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

@media (max-width: 900px) {
    .mobile-top-bar {
        display: flex;
        position: fixed;

        top: 0;
        left: 0;
        height: 72px;
        will-change: transform;
    }

    .main-content {
        margin-left: 0;
        padding: 24px;
        padding-top: calc(72px + 24px);
        padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
        position: relative;
    }

    .content-header {
        margin-top: 0;
    }
}

@media (max-width: 450px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-view {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    scroll-margin-top: 120px;
}

.dashboard-view.active {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
    animation: fadeIn 0.3s ease forwards;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.notification-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.notification-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.notification-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.notification-card.warning::before {
    background: var(--warning);
}

.notification-card.expired::before {
    background: var(--error);
}

.notification-card.info::before {
    background: #3b82f6;
}

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.warning .notif-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.expired .notif-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.info .notif-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.notif-content h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.notif-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--secondary);
    line-height: 1.4;
}

.notif-time {
    font-size: 0.75rem;
    color: var(--secondary);
    opacity: 0.7;
    margin-top: 8px;
    display: block;
}

@media (max-width: 900px) {
    .content-header {
        position: static;

        background: var(--light);
        backdrop-filter: blur(12px) saturate(180%);
        -webkit-backdrop-filter: blur(12px) saturate(180%);
        will-change: transform;

        width: 100%;
        left: auto;
        height: auto;
        padding: 16px 20px;
        margin-bottom: 24px;
    }

    [data-theme="dark"] .content-header {
        background: var(--bg-body);
    }
}

.receipts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
    gap: 24px;
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 20px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    grid-column: 1 / -1;
    margin-top: 36px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.02);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -4px rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .upload-zone:hover,
[data-theme="dark"] .upload-zone.drag-over {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.12);
    box-shadow: 0 8px 28px -4px rgba(59, 130, 246, 0.25);
}

.upload-zone i {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 12px;
    transition: transform 0.25s ease;
}

.upload-zone:hover i,
.upload-zone.drag-over i {
    transform: translateY(-4px) scale(1.08);
}

.upload-pills {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.upload-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: var(--light);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

[data-theme="dark"] .upload-pill {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

.receipts-summary-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    margin-bottom: 20px;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    color: var(--text-main);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .receipts-summary-strip {
    background: #11141c;
    border-color: rgba(255, 255, 255, 0.08);
}

.receipts-summary-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.receipts-summary-inner .summary-icon {
    color: var(--primary);
    font-size: 0.95rem;
}

.receipts-summary-inner .summary-label {
    color: var(--text-muted);
}

.receipts-summary-inner .summary-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
}

.receipts-summary-inner .summary-divider {
    color: var(--text-muted);
    opacity: 0.5;
}

.receipts-summary-inner .summary-count {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.upload-zone p {
    color: var(--secondary);
    font-weight: 600;
}

.upload-zone span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.btn-action.primary {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.btn-action.primary:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

[data-theme="dark"] .btn-action.primary {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

[data-theme="dark"] .btn-action.primary:hover {
    background: rgba(59, 130, 246, 0.25);
}

.btn-action.secondary {
    background: var(--light);
    color: var(--secondary);
}

.btn-action.secondary:hover {
    background: var(--border);
    color: var(--text-main);
    transform: translateY(-1px);
}

[data-theme="dark"] .btn-action.secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--secondary);
}

[data-theme="dark"] .btn-action.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.settings-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
}

.settings-section h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 var(--space-6) 0;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.settings-section h2 i {
    color: var(--secondary);
    font-size: 1rem;
    width: var(--space-5);
    text-align: center;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

.setting-row.is-disabled .setting-label,
.setting-row.is-disabled .setting-desc {
    opacity: 0.6;
}

.setting-label-row {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.setting-soon-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary, #3b82f6);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .setting-soon-badge {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(96, 165, 250, 0.3);
    color: #93c5fd;
}

.setting-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.setting-desc {
    font-size: 0.8rem;
    color: var(--secondary);
    line-height: 1.4;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
    margin-left: var(--space-4);
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 100px;
    transition: background 0.3s, opacity 0.2s;
}

.toggle-switch input:disabled+.toggle-slider {
    opacity: 0.45;
    cursor: not-allowed;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
    background: #3b82f6;
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

.profile-fields {
    display: grid;
    gap: var(--space-5);
}

.profile-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 8px;
}

.profile-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--white);
    color: var(--dark);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

[data-theme="dark"] .profile-field input {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.profile-field input:focus {
    outline: none;
    border-color: var(--primary);
}

.profile-field input[readonly],
.profile-field input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    caret-color: transparent;
    -webkit-text-fill-color: currentColor;
    user-select: none;
    -webkit-user-select: none;
}

.profile-field input[readonly]:focus,
.profile-field input:disabled:focus {
    border-color: var(--border);
    box-shadow: none;
}

[data-theme="dark"] .profile-field input[readonly]:focus,
[data-theme="dark"] .profile-field input:disabled:focus {
    border-color: rgba(255, 255, 255, 0.1);
}

.email-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.email-row input {
    flex: 1;
    min-width: 0;
}

.email-row .btn-sm {
    flex-shrink: 0;
    padding: 12px 16px;
    white-space: nowrap;
}

.email-change-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.email-change-form input {
    flex: 1;
    min-width: 0;
}

.email-change-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.email-change-actions .btn-sm {
    height: 44px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.email-hint {
    margin-top: 8px;
}

.user-id-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-size: 0.84rem !important;
    letter-spacing: 0.01em;
    opacity: 0.78 !important;
}

.user-id-row .btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.user-id-row .btn-sm.is-copied {
    border-color: var(--success, #10b981);
    color: var(--success, #10b981);
}

.inline-expand-panel {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
    transition: grid-template-rows 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.24s ease,
        margin-top 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.inline-expand-panel.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 14px;
    pointer-events: auto;
}

.inline-expand-inner {
    min-height: 0;
    overflow: hidden;
    padding: 3px;
    margin: -3px;
    transform: translateY(-6px) scale(0.99);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.inline-expand-panel.is-open .inline-expand-inner {
    transform: translateY(0) scale(1);
}

.btn-icon-danger {
    color: var(--error, #ef4444);
    border-color: rgba(239, 68, 68, 0.25);
    padding: 12px 13px !important;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, padding 0.2s ease, transform 0.15s ease;
}

.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.5);
    color: var(--error, #ef4444);
}

[data-theme="dark"] .btn-icon-danger {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}

[data-theme="dark"] .btn-icon-danger:hover {
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(248, 113, 113, 0.55);
    color: #fca5a5;
}

.btn-icon-danger.is-confirming {
    background: var(--error, #ef4444);
    border-color: var(--error, #ef4444);
    color: #fff;
    padding: 12px 14px !important;
    gap: 6px;
    white-space: nowrap;
}

.btn-icon-danger.is-confirming:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

[data-theme="dark"] .btn-icon-danger.is-confirming {
    background: #dc2626;
    border-color: #ef4444;
    color: #fff;
}

[data-theme="dark"] .btn-icon-danger.is-confirming:hover {
    background: #b91c1c;
    border-color: #dc2626;
}

.settings-phone-pair {
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    gap: 8px;
    flex: 1;
    min-width: 0;
    align-items: stretch;
}

.settings-phone-pair .custom-select-wrapper {
    width: 100%;
    min-width: 0;
}

.settings-phone-pair .custom-select-trigger {
    height: 100%;
    min-height: 44px;
    padding: 0 30px 0 10px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.settings-phone-pair .custom-select-arrow {
    right: 9px;
}

.settings-phone-pair input[type="tel"] {
    font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
    .phone-change-form {
        flex-wrap: wrap;
    }

    .settings-phone-pair {
        width: 100%;
        flex-basis: 100%;
        grid-template-columns: 114px minmax(0, 1fr);
    }

    .phone-change-form .email-change-actions {
        width: 100%;
    }

    .phone-change-form .email-change-actions .btn-sm {
        flex: 1;
    }

    .settings-phone-pair .custom-select-trigger {
        padding: 0 28px 0 8px;
        font-size: 0.85rem;
    }

    .settings-phone-pair .custom-select-arrow {
        right: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .inline-expand-panel,
    .btn-icon-danger {
        transition: none !important;
    }
}

.save-bar {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
}

.danger-zone {
    border-color: rgba(239, 68, 68, 0.2);
}

.danger-zone h2 {
    color: var(--error);
}

.danger-zone h2 i {
    color: var(--error);
}

.btn-danger {
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-danger:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.disabled-section {
    position: relative;
    overflow: hidden;
}

.disabled-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 24px;
}

[data-theme="dark"] .disabled-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.disabled-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--secondary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.disabled-badge i {
    font-size: 0.8rem;
    color: var(--primary);
}

.btn-danger.btn-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 480px) {
    .content-header h1 {
        align-self: center;
    }

    .settings-section {
        padding: 24px;
        border-radius: 20px;
    }

    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .toggle-switch {
        margin-left: 0;
    }

    .email-row {
        flex-wrap: wrap;
    }

    .email-row input {
        width: 100%;
    }

    .email-row .btn-sm {
        width: 100%;
        text-align: center;
    }

    .email-change-form {
        flex-wrap: wrap;
    }

    .email-change-form input {
        width: 100%;
    }

    .email-change-actions {
        width: 100%;
    }

    .email-change-actions .btn-sm {
        flex: 1;
        text-align: center;
        justify-content: center;
        border-radius: var(--radius-md);

    }

    .btn-danger {
        width: 100%;
        text-align: center;
    }

    .save-bar .btn {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .upload-zone {
        display: none !important;
    }
}

.upload-zone-mini {
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.upload-zone-mini:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.upload-zone-mini i {
    font-size: 1.5rem;
    color: var(--secondary);
}

.upload-zone-mini span {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.upload-zone-mini.has-file {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.upload-zone-mini.has-file i {
    color: var(--success);
}

.input-with-lock {
    position: relative;
}

.input-with-lock input {
    padding-right: 40px;
}

.lock-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary);
    font-size: 0.75rem;
    opacity: 0.5;
    pointer-events: none;
}

.lock-icon.hidden {
    display: none;
}

.input-with-lock input[readonly] {
    background: rgba(0, 0, 0, 0.03);
    cursor: not-allowed;
    opacity: 0.7;
}

[data-theme="dark"] .input-with-lock input[readonly] {
    background: rgba(255, 255, 255, 0.05);
}

.input-suffix {
    position: relative;
    display: block;
    min-width: 0;
}

.suffix-hint {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.75;
    pointer-events: none;
    white-space: nowrap;
}

.input-suffix input {
    padding-right: 2.7rem;
}

.input-with-lock .lock-icon:not(.hidden)~.suffix-hint {
    display: none;
}

.link-hint {
    margin-top: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.link-hint.locked {
    color: var(--primary);
}

.forgot-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    border-radius: 25%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn i+span {
    margin-left: 8px;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    transform: none !important;
}

.btn:disabled:hover,
.btn[disabled]:hover {
    transform: none !important;
    box-shadow: none !important;
}

.shop-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    width: fit-content;
}

[data-theme="dark"] .shop-badge {
    background: rgba(59, 130, 246, 0.15);
}

.business-section h2 {
    color: var(--primary);
    display: flex;
    align-items: center;
}

.input-group:has([required]) label::after {
    content: ' *';
    color: var(--error);
}

.receipt-items-list {
    margin: 0.4rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.receipt-items-list li {
    list-style: disc;
}

.items-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.items-section-header h2 {
    margin-bottom: 0;
}

.section-toolbar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    max-width: 100%;
}

.receipt-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 260px;
    max-width: 100%;
}

.receipt-search-icon {
    position: absolute;
    left: 0.85rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.16s ease;
}

.receipt-search-input {
    width: 100%;
    height: 40px;
    padding: 0 2.15rem 0 2.3rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.84rem;
    font-weight: 500;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
    box-sizing: border-box;
}

.receipt-search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.85;
}

.receipt-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.receipt-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.receipt-search-box:focus-within .receipt-search-icon {
    color: var(--primary);
}

[data-theme="dark"] .receipt-search-input {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .receipt-search-input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.receipt-search-clear {
    position: absolute;
    right: 0.45rem;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
    .receipt-search-clear:hover {
        color: var(--text-main);
        background: rgba(0, 0, 0, 0.06);
    }

    [data-theme="dark"] .receipt-search-clear:hover {
        background: rgba(255, 255, 255, 0.08);
    }
}

.sort-control-wrap {
    position: relative;
    min-width: 215px;
    flex-shrink: 0;
}

.sort-control-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.78rem;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
    transition: color 0.16s ease;
}

.sort-control-wrap:focus-within .sort-control-icon {
    color: var(--primary);
}

.sort-control-wrap .custom-select-trigger {
    height: 42px;
    padding: 0 34px 0 35px;
    font-size: 0.84rem;
    font-weight: 600;
    background: var(--card-bg);
    border-color: var(--border);
    border-radius: var(--radius-md);
}

[data-theme="dark"] .sort-control-wrap .custom-select-trigger {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .sort-control-wrap .custom-select-trigger:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .sort-control-wrap .custom-select-trigger:focus,
[data-theme="dark"] .sort-control-wrap .custom-select-trigger:focus-visible {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.items-tabs {
    position: relative;
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    gap: 2px;
    padding: 4px;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow-x: auto;
    scrollbar-width: none;
}

.items-tabs::-webkit-scrollbar {
    display: none;
}

[data-theme="dark"] .items-tabs {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.items-tab-indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: 0;
    opacity: 0;
    border-radius: var(--radius-sm, 8px);
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1), width 0.35s cubic-bezier(0.65, 0, 0.35, 1);
    z-index: 0;
    pointer-events: none;
}

[data-theme="dark"] .items-tab-indicator {
    background: rgba(255, 255, 255, 0.1);
}

.items-tab {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.84rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    border-radius: var(--radius-sm, 8px);
    transition: color 0.2s ease;
}

.items-tab:hover {
    color: var(--text-main);
}

.items-tab.active {
    color: var(--text-main);
}

.items-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.14);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    transition: background 0.2s ease, color 0.2s ease;
}

.items-tab.active .items-tab-count {
    background: rgba(37, 99, 235, 0.14);
    color: var(--primary);
}

[data-theme="dark"] .items-tab.active .items-tab-count {
    background: rgba(96, 165, 250, 0.2);
    color: #93c5fd;
}

@media (hover: hover) and (pointer: fine) {
    .mine-item-card.verified:hover {
        border-color: color-mix(in srgb, var(--accent) 45%, transparent);
    }
}

.verified-check {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    box-shadow: 0 0 0 2px var(--card-bg);
}

[data-theme="dark"] .verified-check {
    background: #10b981;
    box-shadow: 0 0 0 2px var(--card-bg);
}

@keyframes gridFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.items-grid.fade-out,
.receipts-grid.fade-out {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.items-grid.fade-in,
.receipts-grid.fade-in {
    animation: gridFadeIn 0.3s ease;
}

@media (max-width: 640px) {
    .items-section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .section-toolbar-controls {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .receipt-search-box {
        width: 100%;
    }

    .sort-control-wrap {
        width: 100%;
        min-width: 0;
    }

    .items-tabs {
        width: 100%;
    }

    .items-tab {
        flex: 1;
        padding: 7px 10px;
        font-size: 0.78rem;
        gap: 5px;
    }

    .receipts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ==== Partner Receipt Lifecycle (Buyer Receipts & Notifications) ==== */

.lifecycle-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.lifecycle-pill.is-voided {
    background: rgba(100, 116, 139, 0.16);
    color: #475569;
}

[data-theme="dark"] .lifecycle-pill.is-voided {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
}

.lifecycle-pill.is-refunded {
    background: rgba(239, 68, 68, 0.14);
    color: var(--error);
}

[data-theme="dark"] .lifecycle-pill.is-refunded {
    background: rgba(239, 68, 68, 0.22);
    color: #fca5a5;
}

.lifecycle-pill.is-partially_refunded {
    background: rgba(245, 158, 11, 0.16);
    color: #d97706;
}

[data-theme="dark"] .lifecycle-pill.is-partially_refunded {
    background: rgba(245, 158, 11, 0.22);
    color: #fcd34d;
}

.mine-item-card.business.lifecycle-voided {
    --accent: #64748b;
    --accent-soft: rgba(100, 116, 139, 0.14);
    opacity: 0.86;
}

.mine-item-card.business.lifecycle-refunded {
    --accent: var(--error);
    --accent-soft: rgba(239, 68, 68, 0.14);
    opacity: 0.88;
}

.mine-item-card.business.lifecycle-partially_refunded {
    --accent: var(--warning);
    --accent-soft: rgba(245, 158, 11, 0.16);
}

.mine-item-card.business.lifecycle-voided .mine-item-icon {
    background: rgba(100, 116, 139, 0.16);
    color: #64748b;
}

.mine-item-card.business.lifecycle-refunded .mine-item-icon {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.mine-item-card.business.lifecycle-partially_refunded .mine-item-icon {
    background: rgba(245, 158, 11, 0.16);
    color: #d97706;
}

.verified-check.is-voided {
    background: #64748b;
}

.verified-check.is-refunded {
    background: var(--error);
}

.verified-check.is-partial {
    background: var(--warning);
}

[data-theme="dark"] .verified-check.is-voided {
    background: #64748b;
}

[data-theme="dark"] .verified-check.is-refunded {
    background: #ef4444;
}

[data-theme="dark"] .verified-check.is-partial {
    background: #f59e0b;
}

.amount-struck {
    text-decoration: line-through;
    opacity: 0.65;
}

.mine-stat.accent-refund {
    background: rgba(245, 158, 11, 0.12);
}

.mine-stat.accent-refund .mine-stat-icon,
.mine-stat.accent-refund .mine-stat-value {
    color: #d97706;
}

[data-theme="dark"] .mine-stat.accent-refund {
    background: rgba(245, 158, 11, 0.16);
}

[data-theme="dark"] .mine-stat.accent-refund .mine-stat-icon,
[data-theme="dark"] .mine-stat.accent-refund .mine-stat-value {
    color: #fcd34d;
}

.item-refund-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.14);
    color: var(--error);
    white-space: nowrap;
}

[data-theme="dark"] .item-refund-pill {
    background: rgba(239, 68, 68, 0.22);
    color: #fca5a5;
}

.item-refund-pill.partial {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

[data-theme="dark"] .item-refund-pill.partial {
    background: rgba(245, 158, 11, 0.22);
    color: #fcd34d;
}

.receipt-lifecycle-meta {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(100, 116, 139, 0.08);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--secondary);
    display: flex;
    flex-direction: column;
    gap: 3px;
    line-height: 1.4;
}

.receipt-lifecycle-meta.is-refunded {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.2);
}

.receipt-lifecycle-meta.is-partially_refunded {
    background: rgba(245, 158, 11, 0.07);
    border-color: rgba(245, 158, 11, 0.22);
}

.receipt-lifecycle-meta strong {
    color: var(--text-main);
    font-weight: 700;
}

/* Lifecycle Notification Cards */

.notification-card.lifecycle-voided::before {
    background: #64748b;
}

.notification-card.lifecycle-voided .notif-icon {
    background: rgba(100, 116, 139, 0.14);
    color: #64748b;
}

[data-theme="dark"] .notification-card.lifecycle-voided .notif-icon {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
}

.notification-card.lifecycle-refunded::before {
    background: var(--error);
}

.notification-card.lifecycle-refunded .notif-icon {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error);
}

.notification-card.lifecycle-partial::before {
    background: var(--warning);
}

.notification-card.lifecycle-partial .notif-icon {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

[data-theme="dark"] .notification-card.lifecycle-partial .notif-icon {
    color: #fcd34d;
}

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-notif-mark-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.btn-notif-mark-all:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-notif-mark-all:disabled {
    opacity: 0.6;
    cursor: default;
}

.btn-notif-mark-all.hidden {
    display: none;
}

.notification-card.receipt-issued::before {
    background: #10b981;
}

.notification-card.receipt-issued .notif-icon {
    background: rgba(16, 185, 129, 0.14);
    color: #10b981;
}

.notification-card.is-unread {
    border-color: rgba(59, 130, 246, 0.35);
    cursor: pointer;
}

.notification-card.is-read {
    opacity: 0.78;
}

.notification-card.is-read:hover {
    opacity: 1;
}

.notif-unread-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 6px;
}

.notif-dismiss-btn {
    margin-left: auto;
    align-self: flex-start;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.18s ease, color 0.18s ease;
}

.notif-dismiss-btn:hover {
    background: rgba(148, 163, 184, 0.16);
    color: var(--text);
}

.notif-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.notif-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.notif-filter-chip:hover {
    border-color: var(--primary);
    color: var(--text);
}

.notif-filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.notif-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.14);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
}

.notif-filter-chip.active .notif-chip-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.notif-chip-count.hidden {
    display: none;
}

.notif-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.notif-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-subtle, rgba(148, 163, 184, 0.08));
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.notif-quick-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.notification-card.weekly-digest::before {
    background: #8b5cf6;
}

.notification-card.weekly-digest .notif-icon {
    background: rgba(139, 92, 246, 0.14);
    color: #8b5cf6;
}

.notification-card.is-swiping {
    transition: none !important;
    user-select: none;
}

/* ==== Redesigned Buyer Receipt Cards (Fintech Document Style) ==== */

.receipt-doc-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.receipt-doc-card:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 12px 28px -10px rgba(15, 23, 42, 0.12);
}

[data-theme="dark"] .receipt-doc-card {
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .receipt-doc-card:hover {
    border-color: rgba(96, 165, 250, 0.32);
    box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.45);
}

.receipt-doc-card.lifecycle-voided,
.receipt-doc-card.lifecycle-refunded {
    opacity: 0.84;
}

.receipt-doc-card.lifecycle-voided:hover,
.receipt-doc-card.lifecycle-refunded:hover {
    opacity: 1;
}

.receipt-doc-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.receipt-doc-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.receipt-doc-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    background: rgba(59, 130, 246, 0.11);
    color: var(--primary);
}

[data-theme="dark"] .receipt-doc-icon {
    background: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
}

.receipt-doc-icon.is-active {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

[data-theme="dark"] .receipt-doc-icon.is-active {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
}

.receipt-doc-icon.is-partially_refunded {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

[data-theme="dark"] .receipt-doc-icon.is-partially_refunded {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}

.receipt-doc-icon.is-refunded {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error);
}

[data-theme="dark"] .receipt-doc-icon.is-refunded {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
}

.receipt-doc-icon.is-voided {
    background: rgba(100, 116, 139, 0.14);
    color: #64748b;
}

[data-theme="dark"] .receipt-doc-icon.is-voided {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
}

.receipt-doc-heading {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.receipt-doc-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}

.receipt-doc-subtitle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    min-width: 0;
}

.receipt-doc-subtitle i {
    font-size: 0.72rem;
    opacity: 0.75;
    flex-shrink: 0;
}

.receipt-doc-subtitle span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.receipt-status-badge,
.receipt-type-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 7px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.25;
}

.receipt-type-badge {
    background: var(--light);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

[data-theme="dark"] .receipt-type-badge {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

.receipt-status-badge.is-active {
    background: rgba(16, 185, 129, 0.11);
    color: #059669;
}

[data-theme="dark"] .receipt-status-badge.is-active {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
}

.receipt-status-badge.is-partially_refunded {
    background: rgba(245, 158, 11, 0.13);
    color: #b45309;
}

[data-theme="dark"] .receipt-status-badge.is-partially_refunded {
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
}

.receipt-status-badge.is-refunded {
    background: rgba(239, 68, 68, 0.11);
    color: #dc2626;
}

[data-theme="dark"] .receipt-status-badge.is-refunded {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
}

.receipt-status-badge.is-voided {
    background: rgba(100, 116, 139, 0.13);
    color: #475569;
}

[data-theme="dark"] .receipt-status-badge.is-voided {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
}

.receipt-doc-hero {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--light);
    border: 1px solid var(--border);
}

.receipt-doc-hero.is-date-only {
    justify-content: flex-start;
}

[data-theme="dark"] .receipt-doc-hero {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

.receipt-doc-amount-wrap {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.receipt-doc-amount {
    font-size: 1.32rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.receipt-doc-amount.is-struck {
    text-decoration: line-through;
    color: var(--text-muted);
    opacity: 0.7;
    font-weight: 700;
}

.receipt-doc-amount-delta {
    font-size: 0.76rem;
    font-weight: 700;
    color: #d97706;
    font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .receipt-doc-amount-delta {
    color: #fbbf24;
}

.receipt-doc-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

.receipt-doc-date i {
    font-size: 0.75rem;
    opacity: 0.75;
}

.receipt-doc-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.receipt-doc-content:empty {
    display: none;
}

.receipt-doc-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.receipt-doc-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.84rem;
}

[data-theme="dark"] .receipt-doc-item-row {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.receipt-doc-item-row:first-child {
    padding-top: 2px;
}

.receipt-doc-item-row:last-child {
    border-bottom: none;
    padding-bottom: 2px;
}

.receipt-doc-item-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.receipt-doc-item-row .item-name {
    font-weight: 600;
    color: var(--text-main);
    word-break: break-word;
}

.receipt-doc-item-row .item-qty {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.receipt-doc-item-warranty {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.receipt-doc-items.is-struck .item-name,
.receipt-doc-items.is-struck .item-qty,
.receipt-doc-items .item-row-refunded .item-name,
.receipt-doc-items .item-row-refunded .item-qty {
    text-decoration: line-through;
    opacity: 0.6;
}

.receipt-doc-linked {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.14);
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 0;
}

[data-theme="dark"] .receipt-doc-linked {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

.receipt-doc-linked i {
    color: var(--primary);
    font-size: 0.74rem;
    flex-shrink: 0;
}

.receipt-doc-linked-label {
    flex-shrink: 0;
}

.receipt-doc-linked-val {
    color: var(--text-main);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.receipt-doc-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

[data-theme="dark"] .receipt-doc-actions {
    border-top-color: rgba(255, 255, 255, 0.06);
}

.receipt-doc-btn {
    height: 40px;
    border-radius: 11px;
    font-family: var(--font-main);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    flex: 1;
    white-space: nowrap;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.14s ease;
}

.receipt-doc-btn i {
    font-size: 0.78rem;
}

.receipt-doc-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.receipt-doc-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.receipt-doc-btn.is-icon {
    flex: 0 0 40px;
    width: 40px;
    padding: 0;
}

.receipt-doc-btn.is-primary {
    background: rgba(37, 99, 235, 0.09);
    border: 1px solid rgba(37, 99, 235, 0.22);
    color: var(--primary);
}

.receipt-doc-btn.is-primary:hover:not(:disabled) {
    background: rgba(37, 99, 235, 0.16);
    border-color: rgba(37, 99, 235, 0.42);
}

[data-theme="dark"] .receipt-doc-btn.is-primary {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

[data-theme="dark"] .receipt-doc-btn.is-primary:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.24);
    border-color: rgba(96, 165, 250, 0.5);
}

.receipt-doc-btn.is-secondary {
    background: var(--light);
    border: 1px solid var(--border);
    color: var(--text-main);
}

.receipt-doc-btn.is-secondary:hover:not(:disabled) {
    background: rgba(15, 23, 42, 0.06);
    border-color: rgba(100, 116, 139, 0.35);
}

[data-theme="dark"] .receipt-doc-btn.is-secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

[data-theme="dark"] .receipt-doc-btn.is-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
}

.receipt-doc-btn.is-danger {
    background: rgba(239, 68, 68, 0.09);
    border: 1px solid rgba(239, 68, 68, 0.22);
    color: var(--error);
}

.receipt-doc-btn.is-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.42);
}

[data-theme="dark"] .receipt-doc-btn.is-danger {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.28);
    color: #f87171;
}

[data-theme="dark"] .receipt-doc-btn.is-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.24);
    border-color: rgba(248, 113, 113, 0.5);
}

@media (max-width: 640px) {
    .receipt-doc-card {
        padding: 16px;
        border-radius: 18px;
    }

    .receipt-doc-amount {
        font-size: 1.2rem;
    }

    .receipt-doc-btn {
        height: 44px;
    }

    .receipt-doc-btn.is-icon {
        flex: 0 0 44px;
        width: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .receipt-doc-card,
    .receipt-doc-btn,
    .items-tab-indicator {
        transition: none;
    }
}


/* === Settings: In-App Password Change === */

#settings-security-section .setting-row {
    border-bottom: none;
    padding-bottom: 0;
}

.password-change-collapse {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease, margin-top 0.28s ease;
    margin-top: 0;
}

.password-change-collapse.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 0.9rem;
}

.password-change-inner {
    overflow: hidden;
    min-height: 0;
}

.password-change-form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1rem 4px 10px;
    border-top: 1px solid var(--border);
}

.password-change-form .password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-change-form .password-wrapper input {
    width: 100%;
    padding: 0.65rem 42px 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.92rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.password-change-form .password-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.pw-eye-btn {
    position: absolute;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.pw-eye-btn:hover {
    color: var(--text-main);
    background: rgba(148, 163, 184, 0.12);
}

.password-change-error {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--error, #ef4444);
    min-height: 0;
}

.password-change-error:empty {
    display: none;
}

.password-change-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 0.25rem;
}

/* Password strength meter & match hint (shared with password-strength.js) */
.ps-wrap {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}

.ps-wrap.ps-visible {
    max-height: 280px;
    opacity: 1;
    margin-top: 10px;
}

.ps-meter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ps-meter-bar {
    flex: 1;
    display: flex;
    gap: 4px;
    height: 6px;
    border-radius: 4px;
}

.ps-segment {
    flex: 1;
    height: 100%;
    border-radius: 3px;
    background: var(--border);
    transition: background 0.25s ease;
}

[data-theme="dark"] .ps-segment {
    background: rgba(255, 255, 255, 0.08);
}

.ps-segment.filled {
    background: var(--segment-color, var(--primary));
}

.ps-meter-label {
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    min-width: 68px;
    text-align: right;
}

.ps-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 14px;
}

@media (max-width: 480px) {
    .ps-list {
        grid-template-columns: 1fr;
    }
}

.ps-req {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.ps-req-passed {
    color: var(--text-main);
}

.ps-req-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.ps-req-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    box-sizing: border-box;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.ps-req-passed .ps-req-circle {
    background: var(--success, #22c55e);
    border-color: var(--success, #22c55e);
}

.ps-req-check {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    color: #fff;
    transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ps-req-passed .ps-req-check {
    opacity: 1;
    transform: scale(1);
}

.ps-match-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 6px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, max-height 0.2s ease;
}

.ps-match-hint.is-visible {
    opacity: 1;
    max-height: 28px;
}

.ps-match-hint.is-match {
    color: var(--success, #22c55e);
}

.ps-match-hint.is-mismatch {
    color: var(--error, #ef4444);
}


/* === Batch Export All Warranties to Calendar Bar === */

.warranty-calendar-bar {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.78rem 1rem;
    margin-bottom: 1.4rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-main);
    font-family: var(--font-main);
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.warranty-calendar-bar:hover {
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.08);
}

.warranty-calendar-bar:active {
    transform: scale(0.99);
}

.warranty-calendar-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.24);
    color: #10b981;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.warranty-calendar-text {
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
    min-width: 0;
    flex: 1;
}

.warranty-calendar-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
}

.warranty-calendar-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.warranty-calendar-action {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.warranty-calendar-bar:hover .warranty-calendar-action {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.35);
}

.warranty-calendar-bar.is-exported .warranty-calendar-action {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

@media (max-width: 640px) {
    .warranty-calendar-bar {
        padding: 0.72rem 0.85rem;
        gap: 0.72rem;
        margin-bottom: 1.15rem;
    }

    .warranty-calendar-icon {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .warranty-calendar-title {
        font-size: 0.88rem;
    }

    .warranty-calendar-sub {
        font-size: 0.74rem;
    }
}


/* === Mobile Receipt Camera Capture & Photo Preview === */

.camera-upload-zone {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border);
    border-radius: 20px;
    padding: 26px 18px;
    margin: 18px 0 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-main);
    font-family: var(--font-main);
    cursor: pointer;
    touch-action: manipulation;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.camera-upload-zone i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.camera-upload-zone p {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.camera-upload-zone span {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.camera-upload-zone:active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
    transform: scale(0.985);
}

@media (max-width: 768px), (hover: none) and (pointer: coarse) {
    .camera-upload-zone {
        display: flex;
    }
}

.receipt-file-picker-row {
    display: flex;
    align-items: stretch;
    gap: 0.55rem;
}

.receipt-file-picker-row .upload-zone-mini {
    flex: 1;
    min-width: 0;
}

.btn-modal-camera {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.55rem 0.9rem;
    border-radius: 12px;
    border: 1px dashed rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary);
    font-family: var(--font-main);
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    touch-action: manipulation;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.btn-modal-camera i {
    font-size: 1.05rem;
}

.btn-modal-camera:active {
    transform: scale(0.96);
}

@media (max-width: 768px), (hover: none) and (pointer: coarse) {
    .btn-modal-camera {
        display: inline-flex;
    }
}

.receipt-photo-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.6rem;
    padding: 0.55rem 0.7rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-body);
}

.receipt-photo-preview img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.receipt-photo-preview-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.receipt-photo-preview-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.receipt-photo-preview-meta {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.receipt-photo-remove-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.receipt-photo-remove-btn:hover {
    color: var(--error, #ef4444);
    border-color: var(--error, #ef4444);
}


/* === Multi-file Receipt Attachments (up to 3) & Viewer Gallery === */

.receipt-files-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.receipt-files-counter {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    background: var(--bg-body);
    border: 1px solid var(--border);
}

.receipt-files-counter.is-full {
    color: var(--primary);
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.08);
}

.receipt-file-picker-row.is-limit-reached {
    opacity: 0.5;
    pointer-events: none;
}

.receipt-files-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.55rem;
}

.receipt-files-list .receipt-photo-preview {
    margin-top: 0;
}

.receipt-photo-pdf-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.receipt-type-badge.is-multi {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary);
    border-color: rgba(59, 130, 246, 0.28);
}

.attachments-viewer-card {
    max-width: 580px;
}

.att-viewer-stage {
    position: relative;
    min-height: 260px;
    max-height: 54dvh;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 0.85rem;
}

.att-viewer-stage img {
    max-width: 100%;
    max-height: 54dvh;
    object-fit: contain;
    display: block;
}

.att-viewer-pdf-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--text-muted);
}

.att-viewer-pdf-box i {
    font-size: 2.6rem;
    color: #ef4444;
}

.att-viewer-pdf-box strong {
    color: var(--text-main);
    font-size: 0.92rem;
    word-break: break-word;
}

.att-viewer-thumbs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.att-viewer-thumb {
    width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 10px;
    border: 2px solid var(--border);
    background: var(--bg-body);
    overflow: hidden;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    font-size: 1.2rem;
    transition: border-color 0.16s ease, transform 0.14s ease;
}

.att-viewer-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.att-viewer-thumb.active {
    border-color: var(--primary);
    transform: scale(1.04);
}

.att-viewer-actions {
    display: flex;
    gap: 0.65rem;
    justify-content: flex-end;
}

.upload-zone-mini.drag-over {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
}

.service-kind-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.42rem;
    margin-left: 0.35rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(139, 92, 246, 0.13);
    color: #7c3aed;
    vertical-align: middle;
}

[data-theme="dark"] .service-kind-badge {
    background: rgba(139, 92, 246, 0.22);
    color: #c4b5fd;
}

/* --- Telegram Phone Verification in Settings --- */
.phone-label-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.phone-label-row label {
    margin-bottom: 0;
}

.phone-verified-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.52rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.13);
    color: #059669;
}

[data-theme="dark"] .phone-verified-pill {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.btn-telegram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: rgba(34, 158, 217, 0.12);
    color: #0284c7;
    border: 1px solid rgba(34, 158, 217, 0.34);
    font-weight: 600;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.btn-telegram:hover:not(:disabled) {
    background: rgba(34, 158, 217, 0.2);
    border-color: rgba(34, 158, 217, 0.55);
}

.btn-telegram:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-telegram i {
    font-size: 0.95rem;
}

[data-theme="dark"] .btn-telegram {
    background: rgba(34, 158, 217, 0.18);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.35);
}

[data-theme="dark"] .btn-telegram:hover:not(:disabled) {
    background: rgba(34, 158, 217, 0.28);
}

.btn-telegram.is-subtle {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}

.btn-telegram.is-subtle:hover:not(:disabled) {
    color: #0284c7;
    border-color: rgba(34, 158, 217, 0.45);
    background: rgba(34, 158, 217, 0.08);
}

[data-theme="dark"] .btn-telegram.is-subtle:hover:not(:disabled) {
    color: #38bdf8;
    background: rgba(34, 158, 217, 0.14);
}

.phone-row-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex-shrink: 0;
}

.phone-display-row .btn-icon-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    padding: 0;
    flex: 0 0 42px;
}

.phone-display-row .btn-icon-danger.is-confirming {
    width: auto;
    flex: 0 0 auto;
    padding: 0 14px;
}

.phone-display-row .btn-telegram {
    justify-content: center;
    padding: 0 14px;
    min-height: 42px;
}

@media (max-width: 600px) {
    .phone-display-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .phone-display-row > input {
        flex: 1 1 100%;
        width: 100%;
    }

    .phone-row-actions {
        width: 100%;
    }

    .phone-row-actions .btn-telegram {
        flex: 1 1 auto;
        width: auto;
    }

    .phone-display-row .btn-icon-danger {
        width: 42px;
        flex: 0 0 42px;
    }

    .phone-display-row .btn-icon-danger.is-confirming {
        width: auto;
        flex: 0 0 auto;
    }
}

.tg-verify-panel {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.6rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(34, 158, 217, 0.28);
    background: rgba(34, 158, 217, 0.06);
    animation: tgPanelIn 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

[data-theme="dark"] .tg-verify-panel {
    background: rgba(34, 158, 217, 0.1);
    border-color: rgba(56, 189, 248, 0.26);
}

@keyframes tgPanelIn {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tg-verify-panel-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
}

.tg-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0ea5e9;
    flex-shrink: 0;
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.55);
    animation: tgPulse 1.6s ease-out infinite;
}

@keyframes tgPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.55);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(14, 165, 233, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
    }
}

.tg-verify-panel-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tg-verify-panel-actions a.btn-telegram {
    text-decoration: none;
}

.tg-ext-icon {
    font-size: 0.7rem !important;
    opacity: 0.75;
}

@keyframes verifiedPillPop {
    0% {
        opacity: 0;
        transform: scale(0.7);
    }
    65% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.phone-verified-pill.is-popping {
    animation: verifiedPillPop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes phoneVerifiedFlash {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
        border-color: rgba(16, 185, 129, 0.7);
    }
    100% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
        border-color: var(--border);
    }
}

#settings-phone.phone-verified-flash {
    animation: phoneVerifiedFlash 0.85s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .tg-verify-panel,
    .tg-pulse-dot,
    .phone-verified-pill.is-popping,
    #settings-phone.phone-verified-flash {
        animation: none !important;
    }
}
