.business-body {
    background-color: var(--bg-body);
    font-family: var(--font-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.business-top-bar {
    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);
    will-change: transform;
    border-bottom: 1px solid transparent;
}

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

.back-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
    background: transparent;
    z-index: 2;
}

.back-link:hover {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.brand-small {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-brand);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--primary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 1;
}

.shop-setup-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.large-icon {
    width: 72px !important;
    height: 72px !important;
    font-size: 2rem !important;
    margin: 0 auto 1.5rem !important;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white !important;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
}

.shop-setup-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: var(--space-3);
    letter-spacing: -0.02em;
}

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

.input-group {
    margin-bottom: var(--space-6);
    position: relative;
}

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

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: var(--space-4) var(--space-4);
    font-family: var(--font-main);
    font-size: 0.95rem;
    color: var(--text-main);
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition-fast);
    box-sizing: border-box;
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

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

.input-group textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.input-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.field-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-1);
    opacity: 0.8;
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    margin-top: var(--space-4);
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
}

.btn-lg:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.4);
}

.btn-lg:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.business-main {
    flex: 1;
    max-width: 1240px;
    margin: 0 auto;
    padding: 2.5rem 24px;
    width: 100%;
    box-sizing: border-box;
}

.view {
    display: none;
}

.view.is-active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

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

.max-w-md {
    max-width: 480px;
    margin: 0 auto;
}

.max-w-lg {
    max-width: 600px;
}

.w-full {
    width: 100%;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

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

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-icon.blue {
    background: #eff6ff;
    color: var(--primary);
}

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

.stat-icon.orange {
    background: #fff7ed;
    color: var(--warning);
}

[data-theme="dark"] .stat-icon.orange {
    background: rgba(245, 158, 11, 0.15);
}

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

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

.stat-icon.purple {
    background: #f3e8ff;
    color: #8b5cf6;
}

[data-theme="dark"] .stat-icon.purple {
    background: rgba(139, 92, 246, 0.2);
}

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

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.content-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.content-header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.continue-draft-btn {
    border-color: rgba(217, 119, 6, 0.42);
    background: rgba(245, 158, 11, 0.08);
    color: #b45309;
    font-weight: 600;
}

.continue-draft-btn:hover {
    border-color: rgba(217, 119, 6, 0.65);
    background: rgba(245, 158, 11, 0.14);
    color: #92400e;
}

[data-theme="dark"] .continue-draft-btn {
    border-color: rgba(251, 191, 36, 0.34);
    background: rgba(251, 191, 36, 0.1);
    color: #fcd34d;
}

[data-theme="dark"] .continue-draft-btn:hover {
    border-color: rgba(251, 191, 36, 0.56);
    background: rgba(251, 191, 36, 0.16);
    color: #fde68a;
}

.continue-draft-btn.is-hidden {
    display: none;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

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

.item-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--secondary);
}

.item-card.status-verified::before {
    background: var(--success);
}

.item-card.status-pending::before {
    background: var(--warning);
}

.item-status-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.item-status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.item-status-badge.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.item-status-badge.expired {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

[data-theme="dark"] .item-status-badge.active {
    background: rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .item-status-badge.warning {
    background: rgba(245, 158, 11, 0.15);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--light);
    padding: 0.4rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.tag i {
    color: var(--primary);
    font-size: 0.7rem;
}

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

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    z-index: var(--z-modal-content);
}

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

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

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

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.modal-overlay.is-hidden .modal-content {
    transform: translateY(40px) scale(0.97);
    opacity: 0;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

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

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

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

.shop-info-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    position: relative;
    z-index: 20;
}

.shop-info-top {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.shop-export-wrap {
    margin-left: auto;
    position: relative;
    flex-shrink: 0;
}

.shop-export-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 40px;
    padding: 0 0.95rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--light);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.14s ease;
}

.shop-export-btn i:first-child {
    color: var(--primary);
    font-size: 0.86rem;
}

.shop-export-caret {
    font-size: 0.68rem;
    color: var(--text-muted);
    transition: transform 0.18s ease;
}

.shop-export-btn[aria-expanded="true"] .shop-export-caret {
    transform: rotate(180deg);
}

.shop-export-btn:hover:not(:disabled),
.shop-export-btn[aria-expanded="true"] {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.36);
    color: var(--primary);
}

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

.shop-export-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

[data-theme="dark"] .shop-export-btn {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-main);
}

[data-theme="dark"] .shop-export-btn i:first-child {
    color: var(--text-muted);
}

[data-theme="dark"] .shop-export-btn:hover:not(:disabled),
[data-theme="dark"] .shop-export-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.24);
    color: var(--text-main);
}

[data-theme="dark"] .shop-export-btn:hover:not(:disabled) i:first-child,
[data-theme="dark"] .shop-export-btn[aria-expanded="true"] i:first-child {
    color: var(--text-main);
}

.export-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 268px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 14px 36px -10px rgba(15, 23, 42, 0.18), 0 4px 12px -4px rgba(15, 23, 42, 0.08);
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.16s ease;
}

.export-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

[data-theme="dark"] .export-dropdown {
    background: var(--card-bg);
    border-color: var(--border);
    box-shadow: 0 18px 42px -12px rgba(0, 0, 0, 0.65);
}

.export-dropdown-header {
    padding: 7px 10px 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

[data-theme="dark"] .export-dropdown-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.export-dropdown-scope {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.export-dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-main);
    font-family: var(--font-main);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.14s ease;
}

.export-dropdown-item:hover:not(:disabled) {
    background: rgba(37, 99, 235, 0.07);
}

.export-dropdown-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

[data-theme="dark"] .export-dropdown-item:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.07);
}

.export-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.export-item-icon.is-xlsx {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

[data-theme="dark"] .export-item-icon.is-xlsx {
    background: rgba(34, 197, 94, 0.16);
    color: #4ade80;
}

.export-item-icon.is-csv {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

[data-theme="dark"] .export-item-icon.is-csv {
    background: rgba(59, 130, 246, 0.16);
    color: #60a5fa;
}

.export-item-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.export-item-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
}

.export-item-desc {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.25;
}

.shop-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: var(--primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

#shop-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.logo-drop-zone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-base);
    background: var(--bg-body);
}

.logo-drop-zone:hover,
.logo-drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.03);
}

.logo-drop-zone.has-image {
    border-style: solid;
    border-color: var(--border);
    padding: 0.75rem;
}

.logo-drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.logo-drop-icon {
    font-size: 2rem;
    color: var(--primary);
    opacity: 0.6;
}

.logo-drop-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
}

.logo-drop-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.logo-drop-preview {
    display: none;
    position: relative;
    justify-content: center;
}

.logo-drop-preview img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 16px;
    border: 2px solid var(--border);
}

.logo-drop-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--error);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}

.logo-drop-remove:hover {
    transform: scale(1.15);
}

[data-theme="dark"] .shop-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.08));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.shop-details {
    flex: 1;
    min-width: 0;
}

.shop-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.shop-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1.5rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

.shop-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 0;
}

.shop-meta .meta-item:not(.meta-item-address):not(#display-contact-email-wrap) {
    white-space: nowrap;
    flex-shrink: 0;
}

#display-contact-email-wrap {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}

.shop-meta .meta-item i {
    font-size: 0.8rem;
    opacity: 0.65;
    flex-shrink: 0;
}

.shop-meta .meta-item-address {
    align-items: flex-start;
}

.shop-meta .meta-item-address i {
    margin-top: 3px;
}

.shop-meta .meta-item-address span {
    word-break: break-word;
    line-height: 1.4;
}

#theme-toggle-btn {
    margin-left: auto;
    z-index: 2;
}

.verify-btn {
    margin-left: 0;
}

@media (max-width: 768px) {
    .business-top-bar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 72px;
        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;
    }

    .brand-small {
        font-size: 1.1rem;
        max-width: 50%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .back-link {
        display: none;
    }

    #theme-toggle-btn {
        margin-left: 0;
        padding: 0.5rem;
    }

    .business-main {
        padding: 1.5rem 1rem;
        padding-top: 96px;
    }

    .content-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .content-header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }

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

    .verify-btn {
        margin-left: 0;
    }

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

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

    .item-card {
        padding: 1.25rem;
    }

    .modal-overlay {
        padding: 2rem 1rem;
        align-items: center;
    }

    .modal-content {
        max-height: calc(100vh - 4rem);

        padding: 1.5rem;
        border-radius: 16px;
        margin-bottom: 0;

    }

    .modal-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

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

    .shop-info-card {
        padding: 1.25rem;
    }

    .shop-export-wrap {
        width: 100%;
        margin-left: 0;
    }

    .shop-export-btn {
        width: 100%;
        height: 42px;
    }

    .export-dropdown {
        left: 0;
        right: 0;
        min-width: 0;
    }

    .shop-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }

    .shop-name {
        font-size: 1rem;
    }

    .shop-meta {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem 0.85rem;
        font-size: 0.82rem;
    }

    .shop-meta .meta-item {
        font-size: 0.82rem;
    }

    .shop-meta .meta-item-tax,
    .shop-meta .meta-item-address {
        grid-column: 1 / -1;
    }

    .large-icon {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.6rem !important;
    }

    .shop-setup-header h1 {
        font-size: 1.5rem;
    }
}

.btn {
    gap: 0.5rem;
}

.content-header .btn {
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
    grid-column: 1 / -1;

    animation: fadeIn 0.5s ease;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
    color: var(--primary);
}

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

.empty-state p {
    font-size: 0.95rem;
    max-width: 400px;
    margin: 0 auto 1.5rem;
    line-height: 1.5;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;

    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-body);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-main);
}

.btn-action.download {
    flex: 1;

    gap: 0.5rem;
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.2);
    color: var(--primary);
}

.btn-action.download:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.btn-action.delete {
    width: 42px;

    flex-shrink: 0;

    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.btn-action.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.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;
}

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

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

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.header-icons {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    padding-right: var(--space-5);
}

#lang-toggle-business {
    min-width: 40px;
    font-weight: 600;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .header-icons {
        display: none;
    }
}

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

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

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

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

.chart-header .section-title {
    margin-bottom: 0;
}

.chart-controls {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 4px;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    isolation: isolate;
}

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

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

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

.chart-period-btn {
    position: relative;
    z-index: 1;
    padding: 7px 14px;
    border-radius: var(--radius-sm, 8px);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 600;
    font-family: var(--font-main);
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease;
}

.chart-period-btn:hover {
    color: var(--text-main);
}

.chart-period-btn.active {
    background: transparent;
    color: var(--text-main);
}

[data-theme="dark"] .chart-period-btn.active {
    color: #ffffff;
}

.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    width: 100%;
    min-width: 0;
}

.chart-box {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-width: 0;
}

.chart-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.chart-box-header-left {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    min-width: 0;
}

.chart-box-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-left: 2px;
    flex-shrink: 0;
}

.chart-period-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-change-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--border);
    color: var(--text-muted);
    white-space: nowrap;
    line-height: 1.4;
}

.chart-change-badge.up {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.chart-change-badge.down {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

[data-theme="dark"] .chart-change-badge.up {
    background: rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .chart-change-badge.down {
    background: rgba(239, 68, 68, 0.2);
}

.chart-wrapper {
    position: relative;
    min-height: 300px;
    height: 300px;
    width: 100%;
}

.chart-wrapper canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
}

.chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
}

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

@media (max-width: 768px) {
    .chart-section {
        padding: var(--space-4);
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chart-grid {
        gap: var(--space-4);
    }

    .chart-wrapper {
        min-height: 200px;
        height: 200px;
    }

    .chart-empty {
        min-height: 180px;
    }
}

.max-w-2xl {
    max-width: 720px;
}

#create-receipt-modal.modal-overlay {
    align-items: center;
}

#create-receipt-modal .modal-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: 720px;
    padding: 1.5rem 1.75rem;
    border-radius: 18px;
    background: var(--card-bg);
}

@keyframes modalRise {
    from {
        opacity: 0;
        transform: translateY(22px) scale(0.98);
    }

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

#create-receipt-modal:not(.is-hidden) .modal-content {
    animation: modalRise 0.34s cubic-bezier(0.16, 1, 0.3, 1);
}

#create-receipt-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex: none;
    margin-bottom: 1.15rem;
}

.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(--text-main);
}

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

#create-receipt-modal .modal-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 0;
    padding-left: 3px;
    padding-right: 14px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    scrollbar-gutter: stable;
}

#create-receipt-modal .modal-body.is-hidden {
    display: none;
}

#create-receipt-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}

#create-receipt-modal .modal-body::-webkit-scrollbar-track {
    background: transparent;
}

#create-receipt-modal .modal-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.receipt-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.receipt-client-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.95rem;
    background: #f0f7ff !important;
    border: 1px solid rgba(59, 130, 246, 0.28);
    border-radius: 12px;
    margin-bottom: 0.85rem;
    animation: fadeIn 0.2s ease;
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.08);
}

[data-theme="dark"] .receipt-client-chip {
    background: #141720 !important;
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.receipt-client-chip.is-hidden {
    display: none;
}

.client-chip-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.client-chip-info i {
    color: var(--success);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.client-chip-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.client-chip-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.client-chip-edit-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
}

.receipt-client-expanded.is-collapsed {
    display: none;
}

.receipt-meta-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    position: relative;
    z-index: 10;
}

.receipt-meta-col .input-group,
.receipt-layout>.input-group {
    margin-bottom: 0;
}

#receipt-pos-group {
    grid-column: 1 / -1;
}

#create-receipt-modal .custom-datepicker-wrapper {
    max-width: none;
}

.input-affix {
    position: relative;
    display: block;
}

.input-affix>i {
    position: absolute;
    top: 50%;
    left: 0.9rem;
    transform: translateY(-50%);
    color: var(--text-muted);
    opacity: 0.65;
    font-size: 0.9rem;
    pointer-events: none;
}

.input-affix input {
    padding-left: 2.4rem;
}

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

.input-suffix .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;
}

.receipt-item-row .input-suffix input {
    padding-right: 2.9rem;
}

.receipt-items {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-body);
    padding: 0.75rem 0.75rem 0.85rem;
}

.receipt-items-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.1rem 0.15rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.items-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    transition: transform 0.2s ease;
}

.items-count-pill.bump {
    animation: pillBump 0.3s ease;
}

#receipt-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.receipt-item-row {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease,
        max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.22s ease, transform 0.22s ease,
        margin 0.22s ease, padding 0.22s ease;
}

.receipt-item-row.is-row-new {
    animation: rowIn 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-remove-item.is-confirming {
    width: auto !important;
    padding: 0 0.65rem !important;
    gap: 0.35rem;
    background: var(--error) !important;
    border-color: var(--error) !important;
    color: #fff !important;
    font-family: var(--font-main);
    font-size: 0.74rem;
    font-weight: 700;
    animation: catalogQtyPop 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.receipt-item-row:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.06);
}

.receipt-item-row:focus-within {
    z-index: 25;
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.receipt-item-row.item-row-flash {
    animation: rowFlash 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rowFlash {
    0% {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
        background: rgba(59, 130, 246, 0.08);
    }
    100% {
        border-color: var(--border);
        box-shadow: none;
        background: var(--card-bg);
    }
}

.receipt-item-row.is-removing {
    opacity: 0;
    transform: scale(0.96) translateX(8px);
    overflow: hidden;
    border-color: transparent;
    box-shadow: none;
    pointer-events: none;
}

.receipt-item-row.is-removing.collapsed {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
}

@keyframes rowIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.97);
    }

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

.receipt-item-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.item-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.12);
    border-radius: 7px;
    flex-shrink: 0;
}

.item-top-hint {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.receipt-item-row .btn-remove-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0 0 0 auto;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.receipt-item-row .btn-remove-item:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--error);
}

.receipt-item-row .btn-remove-item:active {
    transform: scale(0.9);
}

.receipt-item-row .btn-remove-item:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.receipt-item-row .input-group {
    margin-bottom: 0;
    min-width: 0;
}

.receipt-item-row .input-group input {
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
}

.receipt-item-row .input-group .custom-select-trigger {
    padding: 0.45rem 2.1rem 0.45rem 0.6rem;
    font-size: 0.85rem;
}

.receipt-item-row .input-group .custom-select-arrow {
    right: 0.6rem;
    width: 14px;
    height: 14px;
}

.item-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem 0.55rem;
}

.item-fields .input-group {
    margin-bottom: 0;
}

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

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

[data-theme="light"] .warranty-chip,
:not([data-theme="dark"]) .warranty-chip {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-muted);
}

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

.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);
}

.item-subtotal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
    padding-top: 0.55rem;
    border-top: 1px dashed var(--border);
}

.item-subtotal-label {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.item-subtotal-amounts {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
}

.item-subtotal-vat {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.item-subtotal-vat:empty {
    display: none;
}

.item-subtotal strong {
    display: inline-block;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
}

.item-subtotal strong.pop {
    animation: valPop 0.3s ease;
}

@keyframes valPop {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.14);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes pillBump {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.4);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes iconWave {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-14deg);
    }

    55% {
        transform: rotate(10deg);
    }

    80% {
        transform: rotate(-5deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.modal-heading-icon.wave {
    animation: iconWave 0.5s ease;
}

#receipt-total-preview-value.pop {
    display: inline-block;
    animation: valPop 0.32s ease;
}

#add-item-row-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    margin-top: 0.7rem;
    padding: 0.6rem;
    font-family: var(--font-main);
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
    border: 1.5px dashed rgba(59, 130, 246, 0.35);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
}

#add-item-row-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
}

.btn-add-item-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

#add-item-row-btn:hover .btn-add-item-plus {
    transform: scale(1.12) rotate(90deg);
}

#add-item-row-btn:active {
    transform: scale(0.99);
}

.receipt-footer {
    flex: none;
    margin-top: auto;
    padding-top: 1rem;
}

.receipt-total-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.05rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.16);
}

.receipt-total-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.receipt-total-label {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-main);
}

.receipt-total-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.receipt-total-vat {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.receipt-total-vat.has-vat {
    opacity: 1;
    transform: translateY(0);
}

.receipt-total-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.receipt-total-preview strong {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-header-draft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.16s ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-header-draft:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
}

.btn-issue {
    min-width: 210px;
    margin-top: 0;
    white-space: nowrap;
    position: relative;
    line-height: 1.45;
    min-height: 46px;
    padding: 0.65rem 1.25rem;
}

.btn-issue span {
    line-height: 1.45;
}

.btn-issue-content,
.btn-issue-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 0;
    line-height: 1.45;
}

.btn-issue-spinner {
    display: none;
}

.btn-issue-spinner span {
    line-height: 1.45;
    padding-bottom: 2px;
}

.btn-issue.is-loading .btn-issue-content {
    visibility: hidden;
}

.btn-issue.is-loading .btn-issue-spinner {
    display: inline-flex;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    line-height: 1.45;
}

.receipt-section {
    margin-bottom: 0.15rem;
}

.receipt-section-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.85;
    margin-bottom: 0.6rem;
}

.receipt-items-bar .receipt-section-label {
    margin-bottom: 0;
}

.receipt-footer .receipt-section-label {
    margin-bottom: 0.55rem;
}

.field-error {
    display: block;
    min-height: 0;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--error);
    margin-top: 0.35rem;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.18s ease, max-height 0.18s ease, margin-top 0.18s ease;
}

.field-error:not(:empty) {
    opacity: 1;
    max-height: 2.5em;
    margin-top: 0.35rem;
}

.input-group.is-invalid input,
.input-group.is-invalid select {
    border-color: var(--error);
}

.input-group.is-invalid input:focus,
.input-group.is-invalid select:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.receipt-item-row.is-invalid {
    border-color: rgba(239, 68, 68, 0.5);
}

.receipt-item-row.is-invalid [data-item-error] {
    margin-top: 0.15rem;
}

.autocomplete-anchor {
    position: relative;
    z-index: 50;
}

.customer-autocomplete {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 9999 !important;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    background: #ffffff !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
    max-height: 220px;
    overflow-y: auto;
    animation: modalRise 0.16s ease;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

[data-theme="dark"] .customer-autocomplete {
    background: #181818 !important;
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.customer-autocomplete.is-hidden {
    display: none;
}

.customer-autocomplete li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.12s ease;
}

.customer-autocomplete li:hover,
.customer-autocomplete li:focus-visible,
.customer-autocomplete li.is-active {
    background: rgba(59, 130, 246, 0.1);
}

.customer-autocomplete li i.fa-user,
.customer-autocomplete li i.fa-phone {
    color: var(--text-muted);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.customer-autocomplete li>span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-autocomplete li .autocomplete-main {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.customer-autocomplete li .autocomplete-primary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-autocomplete li .autocomplete-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autocomplete-verified {
    color: var(--success);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.contact-mode-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    min-height: 38px;
    flex-wrap: nowrap;
}

.contact-mode-header label {
    margin-bottom: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.contact-mode-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid var(--border);
    border-radius: 10px;
    isolation: isolate;
}

[data-theme="dark"] .contact-mode-switch {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.contact-mode-indicator {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    width: 0;
    border-radius: 7px;
    background: var(--card-bg, #ffffff);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1), width 0.35s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.15s ease;
    will-change: transform, width;
}

[data-theme="dark"] .contact-mode-indicator {
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.contact-mode-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.16s ease;
}

.contact-mode-btn:hover {
    color: var(--text-main);
}

.contact-mode-btn.active {
    background: transparent;
    color: var(--text-main);
    box-shadow: none;
}

[data-theme="dark"] .contact-mode-btn.active {
    background: transparent;
    color: #ffffff;
}

#customer-email-group {
    position: relative;
    z-index: 40;
}

#customer-email-group > .field-hint,
#customer-email-group > .field-error {
    position: relative;
    z-index: 1;
}

.biz-contact-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    position: relative;
    z-index: 40;
}

.biz-contact-panel {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(14px);
    transition: opacity 0.24s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.24s;
}

.biz-contact-panel:first-child {
    transform: translateX(-14px);
}

.biz-contact-panel.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0) !important;
    position: relative;
    z-index: 40;
}

.biz-phone-input-group {
    display: grid;
    grid-template-columns: 124px minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
}

.biz-phone-input-group .custom-select-wrapper {
    width: 100%;
    min-width: 0;
}

.biz-phone-input-group .custom-select-trigger {
    height: 100%;
    min-height: 44px;
    padding: 0 30px 0 10px;
    font-size: 0.88rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.biz-phone-input-group .custom-select-arrow {
    right: 9px;
}

.biz-phone-anchor {
    display: block;
    width: 100%;
    min-width: 0;
}

.biz-phone-anchor input[type="tel"] {
    width: 100%;
    min-width: 0;
    font-variant-numeric: tabular-nums;
}

.ledger-customer-phone {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.ledger-customer-phone i {
    font-size: 0.7rem;
    opacity: 0.75;
}

.modal-guard {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 18px;
    z-index: 60;
}

[data-theme="dark"] .modal-guard {
    background: rgba(10, 10, 10, 0.94);
}

.modal-guard.is-hidden {
    display: none;
}

.modal-guard:not(.is-hidden) {
    animation: guardIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-guard.closing {
    animation: guardOut 0.18s ease forwards;
}

@keyframes guardIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }

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

@keyframes guardOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(10px) scale(0.97);
    }
}

.modal-guard-card {
    width: 100%;
    max-width: 320px;
    text-align: center;
}

.modal-guard-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: 50%;
    animation: iconPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.08s both;
}

[data-theme="dark"] .modal-guard-icon {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.32);
    color: #60a5fa;
}

@keyframes iconPop {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-guard-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

[data-theme="dark"] .modal-guard-card h3 {
    color: #ffffff !important;
}

.modal-guard-card p {
    margin: 0 0 1.35rem;
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
}

[data-theme="dark"] .modal-guard-card p {
    color: #a1a1aa !important;
}

.modal-guard-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.modal-guard-actions #draft-save-btn {
    min-height: 44px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.modal-guard-actions #draft-discard-btn {
    min-height: 44px;
    font-weight: 600;
    background: #f1f5f9;
    color: #1e293b !important;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.16s ease;
}

.modal-guard-actions #draft-discard-btn:hover {
    background: #e2e8f0;
    color: #0f172a !important;
}

[data-theme="dark"] .modal-guard-actions #draft-discard-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #f4f4f5 !important;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

[data-theme="dark"] .modal-guard-actions #draft-discard-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.24);
}

.modal-guard-actions #draft-cancel-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.modal-guard-actions #draft-cancel-btn:hover {
    color: #0f172a;
}

[data-theme="dark"] .modal-guard-actions #draft-cancel-btn {
    color: #71717a;
}

[data-theme="dark"] .modal-guard-actions #draft-cancel-btn:hover {
    color: #ffffff;
}

#create-receipt-modal .modal-content.is-morphing-height {
    transition: height 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

#receipt-modal-body {
    transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#receipt-modal-body.is-exiting {
    opacity: 0;
    transform: translateY(-10px) scale(0.985);
    pointer-events: none;
}

#receipt-modal-body.is-entering {
    animation: receiptBodyEnter 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes receiptBodyEnter {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.receipt-success {
    padding: 0.5rem 0.25rem calc(1.5rem + env(safe-area-inset-bottom, 0));
    text-align: center;
    opacity: 0;
    overflow-y: auto;
    max-height: calc(85dvh - 80px);
    scrollbar-width: thin;
}

.receipt-success.is-hidden {
    display: none;
}

.receipt-success.is-exiting {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
    transition: opacity 0.18s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.receipt-success.is-visible {
    opacity: 1;
    animation: successReveal 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes successReveal {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }

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

@keyframes successItemRise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

@keyframes successRingPulse {
    0% {
        opacity: 0.55;
        transform: scale(0.86);
    }

    100% {
        opacity: 0;
        transform: scale(1.62);
    }
}

@keyframes successCircleDraw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes successCheckDraw {
    to {
        stroke-dashoffset: 0;
    }
}

.receipt-success-icon {
    position: relative;
    width: 66px;
    height: 66px;
    margin: 0.25rem auto 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(16, 185, 129, 0.06));
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 50%;
}

.receipt-success-ring {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid rgba(16, 185, 129, 0.48);
    opacity: 0;
    pointer-events: none;
}

.receipt-success-svg {
    display: block;
    overflow: visible;
}

.receipt-success-circle {
    stroke-dasharray: 145;
    stroke-dashoffset: 145;
    transform: rotate(-90deg);
    transform-origin: 26px 26px;
    opacity: 0.45;
}

.receipt-success-check {
    stroke-dasharray: 42;
    stroke-dashoffset: 42;
}

.receipt-success.is-visible .receipt-success-icon {
    animation: iconPop 0.44s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.receipt-success.is-visible .receipt-success-ring {
    animation: successRingPulse 0.72s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

.receipt-success.is-visible .receipt-success-circle {
    animation: successCircleDraw 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
}

.receipt-success.is-visible .receipt-success-check {
    animation: successCheckDraw 0.34s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

.receipt-success.is-visible h3 {
    animation: successItemRise 0.34s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}

.receipt-success.is-visible .receipt-success-number {
    animation: successItemRise 0.34s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.receipt-success.is-visible .receipt-success-qr-card {
    animation: successItemRise 0.38s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

.receipt-success.is-visible .receipt-success-card {
    animation: successItemRise 0.38s cubic-bezier(0.22, 1, 0.36, 1) 0.19s both;
}

.receipt-success.is-visible .receipt-success-actions {
    animation: successItemRise 0.38s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both;
}

.receipt-success h3 {
    margin: 0 0 0.3rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.receipt-success-number {
    margin: 0 0 1.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}

.receipt-success-grid {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1.15rem;
    align-items: stretch;
    margin-bottom: 1.35rem;
    text-align: left;
    max-width: 100%;
}

.receipt-success-qr-card {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 0.95rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.65rem;
    justify-content: space-between;
    min-width: 0;
}

.receipt-qr-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
}

.receipt-success-qr-box {
    background: #ffffff;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.receipt-success-qr-box:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.receipt-success-qr-img {
    display: block;
    width: 140px;
    height: 140px;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    border-radius: 4px;
}

.receipt-success-qr-hint {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.receipt-success-qr-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    width: 100%;
}

#success-share-btn.is-hidden + #success-copy-url-btn,
#success-open-url-btn {
    grid-column: 1 / -1;
}

.btn-qr-action.is-wa {
    color: #15803d;
    border-color: rgba(22, 163, 74, 0.28);
    background: rgba(22, 163, 74, 0.06);
}

.btn-qr-action.is-tg {
    color: #0369a1;
    border-color: rgba(14, 165, 233, 0.28);
    background: rgba(14, 165, 233, 0.06);
}

[data-theme="dark"] .btn-qr-action.is-wa {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.28);
    background: rgba(74, 222, 128, 0.1);
}

[data-theme="dark"] .btn-qr-action.is-tg {
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.28);
    background: rgba(56, 189, 248, 0.1);
}

.btn-qr-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.45rem 0.4rem;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.btn-qr-action:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-qr-action.copied {
    border-color: var(--success);
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.receipt-success-card {
    text-align: left;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.95rem 1.1rem;
    margin-bottom: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    justify-content: space-between;
    min-width: 0;
    max-width: 100%;
}

.receipt-success-grid .receipt-success-card {
    margin-bottom: 0;
}

@media (max-width: 620px) {
    .receipt-success-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.9rem;
    }

    .receipt-success-qr-img {
        width: 135px;
        height: 135px;
    }
}

.receipt-success-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    font-size: 0.88rem;
    min-width: 0;
}

.receipt-success-row > span {
    color: var(--text-muted);
    flex-shrink: 0;
}

.receipt-success-row strong {
    color: var(--text-main);
    font-weight: 700;
    text-align: right;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#receipt-success-email {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

#receipt-success-email .success-contact-sub {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

.receipt-success-row.receipt-success-total {
    padding-top: 0.6rem;
    border-top: 1px dashed var(--border);
}

.receipt-success-row.receipt-success-total strong {
    font-size: 1.1rem;
    color: var(--primary);
}

.receipt-success-status-value.status-ok {
    color: var(--success) !important;
}

.receipt-success-status-value.status-wait {
    color: var(--warning) !important;
}

.receipt-success-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

@media (min-width: 520px) {
    .receipt-success-actions {
        flex-direction: row-reverse;
        flex-wrap: wrap;
    }

    .receipt-success-actions .btn {
        flex: 1 1 auto;
        min-width: 130px;
        width: auto;
    }
}

.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(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-radius: 28px;
    border: 1px solid transparent;
    will-change: transform;
    clip-path: inset(0 round 28px);
    box-shadow:
        0px 2px 4px rgba(0, 0, 0, 0.02),
        0px 8px 24px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(0, 0, 0, 0.03) inset;
}

[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 {
    position: relative;
    z-index: 1;
    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 {
    position: relative;
    z-index: 1;
    font-size: 10px;
    line-height: 1;
    margin-top: 1px;
}

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

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    inset: 5px 4px;
    border-radius: 22px;
    background: rgba(59, 130, 246, 0.14);
    z-index: 0;
    pointer-events: none;
}

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

.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;
}

/* Stacked sheets visual depth (iOS-style depth layering for nested modals) */
.modal-content.is-stacked-behind {
    transform: scale(0.96) translateY(-8px) !important;
    opacity: 0.6 !important;
    filter: brightness(0.85);
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, filter 0.35s ease !important;
}

@media (max-width: 900px) {
    .bottom-nav {
        display: flex;
    }

    .modal-content.is-stacked-behind {
        transform: translateY(-16px) scale(0.94) !important;
        opacity: 0.55 !important;
        filter: brightness(0.78);
        border-radius: 24px 24px 0 0 !important;
    }

    .business-main {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0));
    }

    .receipt-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    #create-receipt-modal.modal-overlay,
    #receipt-lifecycle-modal.modal-overlay,
    #terminals-modal.modal-overlay,
    #terminal-form-modal.modal-overlay,
    #delete-terminal-modal.modal-overlay,
    #catalog-modal.modal-overlay,
    #catalog-import-modal.modal-overlay,
    #catalog-file-import-modal.modal-overlay,
    #product-form-modal.modal-overlay,
    #catalog-picker-modal.modal-overlay,
    #shop-contacts-modal.modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    #create-receipt-modal .modal-content,
    #receipt-lifecycle-modal .modal-content,
    #terminals-modal .modal-content,
    #terminal-form-modal .modal-content,
    #delete-terminal-modal .modal-content,
    #catalog-modal .modal-content,
    #catalog-import-modal .modal-content,
    #catalog-file-import-modal .modal-content,
    #product-form-modal .modal-content,
    #catalog-picker-modal .modal-content,
    #shop-contacts-modal .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: calc(100dvh - env(safe-area-inset-bottom, 0));
        border-radius: 22px 22px 0 0;
        padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0));
        transform: translateY(0);
        animation: sheetRise 0.38s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .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;
    }

    @keyframes sheetRise {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }

    #create-receipt-modal.modal-overlay.is-hidden .modal-content,
    #create-receipt-modal.modal-overlay.closing .modal-content,
    #receipt-lifecycle-modal.modal-overlay.is-hidden .modal-content,
    #receipt-lifecycle-modal.modal-overlay.closing .modal-content,
    #terminals-modal.modal-overlay.is-hidden .modal-content,
    #terminals-modal.modal-overlay.closing .modal-content,
    #terminal-form-modal.modal-overlay.is-hidden .modal-content,
    #terminal-form-modal.modal-overlay.closing .modal-content,
    #delete-terminal-modal.modal-overlay.is-hidden .modal-content,
    #delete-terminal-modal.modal-overlay.closing .modal-content,
    #catalog-modal.modal-overlay.is-hidden .modal-content,
    #catalog-modal.modal-overlay.closing .modal-content,
    #catalog-import-modal.modal-overlay.is-hidden .modal-content,
    #catalog-import-modal.modal-overlay.closing .modal-content,
    #catalog-file-import-modal.modal-overlay.is-hidden .modal-content,
    #catalog-file-import-modal.modal-overlay.closing .modal-content,
    #product-form-modal.modal-overlay.is-hidden .modal-content,
    #product-form-modal.modal-overlay.closing .modal-content,
    #catalog-picker-modal.modal-overlay.is-hidden .modal-content,
    #catalog-picker-modal.modal-overlay.closing .modal-content,
    #shop-contacts-modal.modal-overlay.is-hidden .modal-content,
    #shop-contacts-modal.modal-overlay.closing .modal-content {
        transform: translateY(100%);
        opacity: 1;
        animation: none;
    }

    #create-receipt-modal .receipt-footer {
        background: transparent;
        border-top: 1px solid var(--border);
        padding-top: 1rem;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0));
        margin-top: 1.25rem;
    }

    #receipt-lifecycle-modal .modal-content {
        display: flex;
        flex-direction: column;
        max-height: calc(100dvh - env(safe-area-inset-bottom, 0) - 15px);
    }

    #receipt-lifecycle-modal .lifecycle-modal-form {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    #receipt-lifecycle-modal .modal-actions.confirm-actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        background: var(--card-bg);
        border-top: 1px solid var(--border);
        padding: 0.9rem 0 calc(0.5rem + env(safe-area-inset-bottom, 0));
        margin-top: auto;
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
    }

    #receipt-lifecycle-modal .modal-actions.confirm-actions .btn-danger {
        order: 1;
        min-height: 48px;
    }

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

    #delete-terminal-modal .modal-content {
        border-radius: 24px 24px 0 0;
        padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0));
        text-align: center;
    }

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

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

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

    #create-receipt-modal .modal-guard {
        border-radius: 22px 22px 0 0;
    }

    #create-receipt-modal .modal-header {
        margin-bottom: 1rem;
    }

    #create-receipt-modal .receipt-items {
        padding: 0.7rem calc(0.7rem + 8px) 0.7rem 0.7rem;
        overflow-y: auto;
        overscroll-behavior: auto;
        min-height: 0;
        max-height: 55dvh;
        scrollbar-gutter: stable;
    }

    #create-receipt-modal .receipt-items::-webkit-scrollbar {
        width: 4px;
    }
}

@media (max-width: 640px) {
    #create-receipt-modal .custom-datepicker-wrapper {
        max-width: none;
    }

    #create-receipt-modal .modal-content {
        padding: 1.1rem 1rem calc(1.1rem + env(safe-area-inset-bottom, 0));
    }

    #create-receipt-modal .modal-heading-text p {
        display: none;
    }

    #create-receipt-modal .modal-actions {
        display: flex;
        flex-direction: column-reverse;
        gap: 0.65rem;
        margin-top: 0.85rem;
    }

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

    #create-receipt-modal .modal-actions .btn-issue {
        width: 100%;
        min-width: 0;
        font-size: 0.95rem;
        font-weight: 700;
        min-height: 48px;
    }

    #create-receipt-modal .modal-actions #cancel-receipt-modal {
        width: 100%;
        min-height: 44px;
        font-size: 0.88rem;
        justify-content: center;
    }

    #create-receipt-modal .receipt-total-preview {
        padding: 0.75rem 0.9rem;
    }

    #create-receipt-modal .item-fields {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem 0.6rem;
    }

    #create-receipt-modal .item-category {
        grid-column: 1 / -1;
    }

    #create-receipt-modal .receipt-item-row {
        padding: 0.75rem 0.85rem;
        border-radius: 14px;
        margin-bottom: 0.65rem;
    }

    #create-receipt-modal .receipt-item-row .input-group label {
        font-size: 0.75rem;
        margin-bottom: 0.2rem;
        color: var(--text-muted);
    }

    #create-receipt-modal .receipt-item-row .input-group input,
    #create-receipt-modal .receipt-item-row .input-group .custom-select-trigger,
    .modal-content input,
    .modal-content select,
    .modal-content textarea {
        font-size: 16px !important;
    }

    #create-receipt-modal .receipt-item-row .input-group input,
    #create-receipt-modal .receipt-item-row .input-group .custom-select-trigger {
        padding: 0.45rem 0.6rem;
        min-height: 40px;
    }
}

@media (max-width: 560px) {
    #create-receipt-modal .receipt-meta-col {
        grid-template-columns: 1fr;
    }

    #create-receipt-modal .receipt-success-card {
        padding: 0.85rem 0.95rem;
    }

    #create-receipt-modal .receipt-success-row {
        font-size: 0.84rem;
    }
}

.app-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 1.5rem;
}

.app-loader.is-hidden {
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 640px) {
    #create-receipt-modal .receipt-meta-col {
        grid-template-columns: 1fr;
    }

    #create-receipt-modal .custom-datepicker-wrapper {
        max-width: none;
    }

    #create-receipt-modal .item-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #create-receipt-modal .item-category {
        grid-column: 1 / -1;
    }
}

.terminals-widget {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.terminals-widget:hover {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.terminals-widget:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.terminals-widget-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #e0f2fe, #dbeafe);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

[data-theme="dark"] .terminals-widget-icon {
    background: rgba(59, 130, 246, 0.18);
}

.terminals-widget-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.terminals-widget-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
}

.terminals-widget-count {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.terminals-widget-arrow {
    margin-left: auto;
    color: var(--text-muted);
    opacity: 0.6;
    font-size: 0.9rem;
    flex-shrink: 0;
}

@media (hover: hover) {
    .terminals-widget:hover .terminals-widget-arrow {
        opacity: 1;
        transform: translateX(2px);
        transition: transform 0.2s ease;
    }
}

.modal-overlay.z-overlay {
    z-index: calc(var(--z-modal-overlay) + 10);
}

.terminals-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.terminal-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    transition: border-color 0.2s ease;
}

.terminal-card.is-inactive {
    opacity: 0.65;
}

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

.terminal-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    flex: 1;
}

.terminal-card-top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.terminal-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.terminal-card-serial {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: "SF Mono", "Menlo", "Consolas", monospace;
}

.terminal-card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.terminal-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.terminal-badge.is-active {
    background: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}

.terminal-badge.is-inactive {
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-muted);
}

.terminal-card .btn-action.delete {
    flex-shrink: 0;
}

/* ==== Receipt Lifecycle (Refund / Void) ==== */

.receipts-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 1.15rem;
}

.receipts-section-header .section-title {
    margin-bottom: 0;
}

.receipts-toolbar-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    max-width: 100%;
}

.receipt-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 280px;
    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: 42px;
    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;
    font-size: 0.78rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.receipt-search-clear:hover {
    background: rgba(100, 116, 139, 0.14);
    color: var(--text-main);
}

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

.receipt-filter-bar::-webkit-scrollbar {
    display: none;
}

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

.receipt-filter-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"] .receipt-filter-indicator {
    background: rgba(255, 255, 255, 0.1);
}

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

.receipt-filter-btn:hover {
    color: var(--text-main);
}

.receipt-filter-btn.active {
    color: var(--text-main);
}

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

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

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

#business-receipts-grid {
    transition: opacity 0.18s ease, transform 0.18s ease;
}

#business-receipts-grid.filter-fade-out {
    opacity: 0;
    transform: translateY(4px);
}

#business-receipts-grid.filter-fade-in {
    opacity: 1;
    transform: translateY(0);
}

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

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

.item-card.lifecycle-partially_refunded::before {
    background: var(--warning);
}

.item-card.lifecycle-voided,
.item-card.lifecycle-refunded {
    opacity: 0.86;
}

.item-status-badge.lifecycle-voided {
    background: rgba(100, 116, 139, 0.14);
    color: #475569;
}

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

.item-status-badge.lifecycle-refunded {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error);
}

[data-theme="dark"] .item-status-badge.lifecycle-refunded {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.item-status-badge.lifecycle-partially_refunded {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

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

.item-refund-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.12);
    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.14);
    color: #d97706;
}

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

.receipt-lifecycle-meta {
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    background: rgba(100, 116, 139, 0.08);
    border: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    line-height: 1.4;
}

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

.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: 600;
}

/* Lifecycle Modal */

.lifecycle-heading-icon {
    color: #d97706 !important;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.05)) !important;
    border-color: rgba(245, 158, 11, 0.26) !important;
}

.lifecycle-modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lifecycle-action-tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.3rem;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.lifecycle-tab-indicator {
    position: absolute;
    top: 0.3rem;
    bottom: 0.3rem;
    left: 0;
    width: 0;
    border-radius: 10px;
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), width 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.16s ease;
    will-change: transform, width;
}

[data-theme="dark"] .lifecycle-tab-indicator {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
}

.lifecycle-tab-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 0.75rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.22s ease, opacity 0.2s ease;
}

.lifecycle-tab-btn:hover:not(:disabled) {
    color: var(--text-main);
}

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

.lifecycle-tab-btn[data-lifecycle-action="void"].active {
    color: var(--error);
}

.lifecycle-tab-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.lifecycle-collapse-wrap,
.lifecycle-refund-section {
    display: grid;
    grid-template-rows: 1fr;
    opacity: 1;
    margin-bottom: 0;
    transition: grid-template-rows 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.22s ease,
                margin-bottom 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.lifecycle-collapse-inner {
    overflow: hidden;
    min-height: 0;
}

.lifecycle-collapse-wrap.is-hidden,
.lifecycle-refund-section.is-hidden {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    margin-bottom: -1rem;
    pointer-events: none;
}

.lifecycle-notice {
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    font-size: 0.82rem;
    line-height: 1.45;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--text-main);
}

.lifecycle-notice.is-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
}

@keyframes lifecycleChipIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lifecycle-reason-presets.is-switching .lifecycle-preset-chip {
    animation: lifecycleChipIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.lifecycle-items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.lifecycle-section-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.lifecycle-text-btn {
    border: none;
    background: none;
    color: var(--primary);
    font-family: var(--font-main);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
}

.lifecycle-text-btn:hover {
    background: rgba(59, 130, 246, 0.1);
}

.lifecycle-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 2px;
}

.lifecycle-item-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-body);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.lifecycle-item-row.is-exhausted {
    cursor: default;
}

.lifecycle-item-row.is-selected {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.05);
}

.lifecycle-item-row.is-exhausted {
    opacity: 0.55;
}

.lifecycle-item-check {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.lifecycle-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.lifecycle-item-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lifecycle-item-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.lifecycle-qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.15rem 0.25rem;
    flex-shrink: 0;
}

.lifecycle-qty-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-main);
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lifecycle-qty-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary);
}

.lifecycle-qty-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.lifecycle-qty-val {
    min-width: 20px;
    text-align: center;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-main);
}

.lifecycle-item-amount {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    flex-shrink: 0;
}

.lifecycle-refund-summary {
    margin-top: 0.75rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.lifecycle-summary-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lifecycle-summary-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.lifecycle-kind-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

.lifecycle-kind-badge.is-full {
    background: rgba(239, 68, 68, 0.12);
    color: var(--error);
}

.lifecycle-kind-badge:empty {
    display: none;
}

.lifecycle-refund-summary strong {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-main);
}

.lifecycle-reason-group {
    margin-bottom: 0;
}

.lifecycle-reason-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.55rem;
}

.lifecycle-preset-chip {
    border: 1px solid var(--border);
    background: var(--bg-body);
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lifecycle-preset-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.lifecycle-preset-chip.active {
    background: rgba(59, 130, 246, 0.12);
    border-color: var(--primary);
    color: var(--primary);
}

.lifecycle-reason-group textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.9rem;
    resize: vertical;
    min-height: 64px;
    box-sizing: border-box;
}

.lifecycle-reason-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.lifecycle-warning-box {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.4;
}

.lifecycle-warning-box i {
    color: var(--error);
    margin-top: 2px;
    flex-shrink: 0;
}

/* ==== POS Receipt Ledger Table ==== */

.receipts-ledger {
    --ledger-cols: minmax(220px, 1.55fr) minmax(165px, 1.05fr) minmax(132px, 0.85fr) minmax(118px, 0.75fr) minmax(212px, auto);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl, 18px);
    overflow-x: auto;
}

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

.receipt-ledger-head {
    display: grid;
    grid-template-columns: var(--ledger-cols);
    gap: 0.85rem;
    align-items: center;
    padding: 0.72rem 1.25rem;
    background: var(--light);
    border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .receipt-ledger-head {
    background: rgba(255, 255, 255, 0.025);
    border-bottom-color: rgba(255, 255, 255, 0.07);
}

.ledger-head-cell {
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.015em;
    white-space: nowrap;
}

.ledger-head-cell.is-right {
    text-align: right;
}

.receipt-ledger-body {
    display: flex;
    flex-direction: column;
}

.receipt-ledger-item+.receipt-ledger-item {
    border-top: 1px solid var(--border);
}

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

.receipt-ledger-summary {
    display: grid;
    grid-template-columns: var(--ledger-cols);
    gap: 0.85rem;
    align-items: center;
    padding: 0.92rem 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.16s ease, opacity 0.16s ease;
}

.receipt-ledger-summary:hover {
    background: rgba(15, 23, 42, 0.025);
}

[data-theme="dark"] .receipt-ledger-summary:hover {
    background: rgba(255, 255, 255, 0.03);
}

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

.receipt-ledger-item.is-expanded>.receipt-ledger-summary {
    background: rgba(37, 99, 235, 0.03);
}

[data-theme="dark"] .receipt-ledger-item.is-expanded>.receipt-ledger-summary {
    background: rgba(59, 130, 246, 0.06);
}

.receipt-ledger-item.lifecycle-voided>.receipt-ledger-summary,
.receipt-ledger-item.lifecycle-refunded>.receipt-ledger-summary {
    opacity: 0.78;
}

.receipt-ledger-item.lifecycle-voided>.receipt-ledger-summary:hover,
.receipt-ledger-item.lifecycle-refunded>.receipt-ledger-summary:hover,
.receipt-ledger-item.lifecycle-voided.is-expanded>.receipt-ledger-summary,
.receipt-ledger-item.lifecycle-refunded.is-expanded>.receipt-ledger-summary {
    opacity: 1;
}

.ledger-col-receipt {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.ledger-chevron {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.68rem;
    flex-shrink: 0;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), color 0.16s ease;
}

.receipt-ledger-summary:hover .ledger-chevron {
    color: var(--text-main);
}

.receipt-ledger-item.is-expanded .ledger-chevron {
    transform: rotate(90deg);
    color: var(--primary);
}

.ledger-receipt-text {
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
    min-width: 0;
}

.ledger-receipt-num {
    font-size: 0.91rem;
    font-weight: 700;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ledger-customer-email {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ledger-col-meta {
    display: flex;
    flex-direction: column;
    gap: 0.14rem;
    min-width: 0;
}

.ledger-date {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ledger-submeta {
    font-size: 0.76rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ledger-dot {
    opacity: 0.55;
    margin: 0 0.18rem;
}

.ledger-col-status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.18rem;
    min-width: 0;
}

.ledger-status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.22rem 0.52rem;
    border-radius: 6px;
    white-space: nowrap;
    line-height: 1.25;
}

.ledger-status-badge.is-linked {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

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

.ledger-status-badge.is-pending {
    background: rgba(245, 158, 11, 0.11);
    color: #b45309;
}

[data-theme="dark"] .ledger-status-badge.is-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

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

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

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

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

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

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

.ledger-status-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding-left: 0.1rem;
    white-space: nowrap;
}

.ledger-col-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.12rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ledger-amount-main {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.ledger-amount-main.is-struck {
    text-decoration: line-through;
    color: var(--text-muted);
    font-weight: 600;
}

.ledger-amount-delta {
    font-size: 0.74rem;
    font-weight: 600;
    color: #d97706;
}

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

.ledger-col-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    white-space: nowrap;
}

.ledger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.38rem;
    height: 34px;
    padding: 0 0.72rem;
    border-radius: 9px;
    font-family: var(--font-main);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.14s ease;
}

.ledger-btn i {
    font-size: 0.76rem;
}

.ledger-btn:active {
    transform: translateY(0);
}

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

.ledger-btn-download {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.22);
    color: var(--primary);
}

.ledger-btn-download:hover {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.42);
}

[data-theme="dark"] .ledger-btn-download {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.28);
    color: #60a5fa;
}

[data-theme="dark"] .ledger-btn-download:hover {
    background: rgba(59, 130, 246, 0.22);
    border-color: rgba(96, 165, 250, 0.5);
    color: #93c5fd;
}

.ledger-btn-refund {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.ledger-btn-refund:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.4);
    color: #b45309;
}

[data-theme="dark"] .ledger-btn-refund {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.ledger-btn-share {
    padding: 0 0.65rem;
    min-width: 34px;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.receipts-load-more-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 0 6px;
}

.receipts-load-more-wrap.is-hidden {
    display: none;
}

.receipts-load-more-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

@media (hover: hover) and (pointer: fine) {
    .ledger-btn-share:hover {
        background: rgba(37, 99, 235, 0.08);
        border-color: rgba(37, 99, 235, 0.35);
        color: var(--primary);
    }
}

[data-theme="dark"] .ledger-btn-share {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

@media (hover: hover) and (pointer: fine) {
    [data-theme="dark"] .ledger-btn-share:hover {
        background: rgba(59, 130, 246, 0.15);
        border-color: rgba(96, 165, 250, 0.45);
        color: #60a5fa;
    }
}

[data-theme="dark"] .ledger-btn-refund:hover {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.38);
    color: #fcd34d;
}

/* Search Counter, Highlights & Smooth Row Enter */

.receipt-search-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: -0.35rem 0 0.75rem;
    padding: 0 0.15rem;
    font-size: 0.8rem;
}

.receipt-search-counter {
    color: var(--text-muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.receipt-search-reset-btn {
    border: none;
    background: transparent;
    color: var(--primary);
    font-family: var(--font-main);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.receipt-search-reset-btn:hover {
    background: rgba(37, 99, 235, 0.08);
}

[data-theme="dark"] .receipt-search-reset-btn {
    color: #60a5fa;
}

[data-theme="dark"] .receipt-search-reset-btn:hover {
    background: rgba(59, 130, 246, 0.14);
}

mark.search-hit {
    background: rgba(59, 130, 246, 0.16);
    color: inherit;
    border-radius: 3px;
    padding: 0 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

[data-theme="dark"] mark.search-hit {
    background: rgba(96, 165, 250, 0.26);
    color: #eff6ff;
}

@keyframes ledgerRowEnter {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

.receipt-ledger-item.is-row-enter {
    animation: ledgerRowEnter 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: var(--row-delay, 0ms);
}

/* Collapsible Drawer — Redesigned Structured Financial View */

.ledger-drawer {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
}

.receipt-ledger-item.is-expanded>.ledger-drawer {
    grid-template-rows: 1fr;
    opacity: 1;
}

.ledger-drawer-inner {
    overflow: hidden;
    min-height: 0;
}

.ledger-drawer-content {
    padding: 1.25rem 1.45rem 1.35rem 2.95rem;
    background: var(--light);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

[data-theme="dark"] .ledger-drawer-content {
    background: rgba(255, 255, 255, 0.022);
    border-top-color: rgba(255, 255, 255, 0.07);
}

/* Drawer Top Bar: Metadata Grid + Quick Actions */

.ledger-drawer-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    flex-wrap: wrap;
}

.ledger-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.75rem;
    min-width: 0;
}

.ledger-meta-cell {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    min-width: 0;
}

.ledger-meta-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.ledger-meta-label i {
    font-size: 0.68rem;
    opacity: 0.75;
}

.ledger-meta-value {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}

.ledger-meta-value.is-tabular {
    font-variant-numeric: tabular-nums;
}

.ledger-quick-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.ledger-quick-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 34px;
    padding: 0 0.78rem;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ledger-quick-btn i {
    font-size: 0.76rem;
    color: var(--text-muted);
    transition: color 0.15s ease;
}

.ledger-quick-btn:hover {
    border-color: rgba(37, 99, 235, 0.38);
    background: rgba(37, 99, 235, 0.06);
    color: var(--primary);
}

.ledger-quick-btn:hover i {
    color: var(--primary);
}

.ledger-quick-btn.is-copied {
    border-color: rgba(22, 163, 74, 0.4);
    background: rgba(22, 163, 74, 0.08);
    color: #15803d;
}

.ledger-quick-btn.is-copied i {
    color: #15803d;
}

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

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

[data-theme="dark"] .ledger-quick-btn:hover {
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
}

[data-theme="dark"] .ledger-quick-btn:hover i {
    color: #93c5fd;
}

[data-theme="dark"] .ledger-quick-btn.is-copied {
    border-color: rgba(74, 222, 128, 0.4);
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

[data-theme="dark"] .ledger-quick-btn.is-copied i {
    color: #4ade80;
}

/* Drawer Items Table */

.ledger-drawer-section {
    display: flex;
    flex-direction: column;
}

.ledger-items-table {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .ledger-items-table {
    border-color: rgba(255, 255, 255, 0.07);
}

.ledger-items-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px 128px 118px;
    gap: 0.75rem;
    align-items: center;
    padding: 0.58rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.ledger-items-head .is-right {
    text-align: right;
}

[data-theme="dark"] .ledger-items-head {
    border-bottom-color: rgba(255, 255, 255, 0.07);
}

.ledger-items-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ledger-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px 128px 118px;
    gap: 0.75rem;
    align-items: center;
    padding: 0.72rem 0.25rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    font-size: 0.86rem;
}

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

.ledger-item-row:last-child {
    border-bottom: none;
}

.ledger-item-col-name {
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
    min-width: 0;
}

.ledger-item-title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    min-width: 0;
}

.ledger-item-row .item-name {
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.35;
}

.ledger-item-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.ledger-item-col-qty {
    text-align: right;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ledger-item-col-warranty {
    text-align: right;
    white-space: nowrap;
}

.ledger-item-warranty {
    font-size: 0.79rem;
    font-weight: 600;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .ledger-item-warranty {
    color: #60a5fa;
}

.ledger-item-warranty.is-none {
    font-weight: 500;
    color: var(--text-muted);
    opacity: 0.72;
}

.ledger-item-col-price {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.ledger-item-price {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
}

.ledger-items-list.is-struck .item-name,
.ledger-items-list.is-struck .ledger-item-col-qty,
.ledger-items-list .item-row-refunded .item-name,
.ledger-items-list .item-row-refunded .ledger-item-col-qty {
    text-decoration: line-through;
    opacity: 0.58;
}

.ledger-items-list.is-struck .ledger-item-price,
.ledger-items-list .item-row-refunded .ledger-item-price {
    text-decoration: line-through;
    color: var(--text-muted);
    opacity: 0.65;
}

/* Drawer Footer: Lifecycle Note + Financial Summary */

.ledger-drawer-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    flex-wrap: wrap;
}

.ledger-drawer-footer-left {
    flex: 1 1 240px;
    min-width: 0;
}

.ledger-drawer-footer-left:empty {
    display: none;
}

.ledger-drawer-content .receipt-lifecycle-meta {
    margin-top: 0;
}

.ledger-summary-box {
    margin-left: auto;
    min-width: 240px;
    max-width: 300px;
    flex: 0 1 270px;
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    font-variant-numeric: tabular-nums;
}

.ledger-summary-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.ledger-summary-row span:last-child {
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
}

.ledger-summary-row.is-refund span:last-child {
    color: #d97706;
}

[data-theme="dark"] .ledger-summary-row.is-refund span:last-child {
    color: #fbbf24;
}

.ledger-summary-row.is-total {
    margin-top: 0.25rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

[data-theme="dark"] .ledger-summary-row.is-total {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.ledger-summary-row.is-total span:last-child {
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.ledger-summary-row.is-total span.is-struck {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Tablet & Mobile Adaptation */

@media (max-width: 1024px) {
    .receipt-ledger-head {
        display: none;
    }

    .receipt-ledger-summary {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "receipt amount"
            "meta status"
            "actions actions";
        gap: 0.55rem 0.75rem;
        padding: 1rem 1.05rem;
        align-items: start;
    }

    .ledger-col-receipt {
        grid-area: receipt;
    }

    .ledger-col-amount {
        grid-area: amount;
    }

    .ledger-col-meta {
        grid-area: meta;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.18rem 0.45rem;
        padding-left: 1.9rem;
    }

    .ledger-col-meta .ledger-date {
        font-size: 0.78rem;
        color: var(--text-muted);
        font-weight: 500;
    }

    .ledger-col-meta .ledger-submeta::before {
        content: "·";
        margin-right: 0.45rem;
        opacity: 0.55;
    }

    .ledger-col-status {
        grid-area: status;
        align-items: flex-end;
    }

    .ledger-col-actions {
        grid-area: actions;
        justify-content: stretch;
        gap: 0.55rem;
        margin-top: 0.25rem;
        padding-top: 0.65rem;
        border-top: 1px solid var(--border);
    }

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

    .ledger-btn {
        flex: 1;
        height: 40px;
        font-size: 0.83rem;
        padding: 0 0.85rem;
    }

    .ledger-drawer-content {
        padding: 1.05rem 1.05rem 1.15rem;
    }
}

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

    .receipts-toolbar-controls {
        width: 100%;
    }

    .receipt-search-box {
        flex: 1 1 220px;
        width: auto;
    }
}

@media (max-width: 640px) {
    .receipts-toolbar-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }

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

    .receipt-filter-bar {
        width: 100%;
    }

    .receipt-filter-btn {
        flex: 1;
        padding: 7px 8px;
        font-size: 0.78rem;
        gap: 5px;
    }

    .receipt-ledger-summary {
        padding: 0.9rem 0.9rem;
    }

    .ledger-col-meta {
        padding-left: 0;
    }

    .ledger-btn {
        height: 44px;
    }

    .ledger-drawer-content {
        padding: 0.85rem;
        gap: 0.7rem;
    }

    .ledger-drawer-top {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0.65rem;
    }

    .ledger-meta-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.55rem 0.85rem;
        width: 100%;
    }

    .ledger-quick-actions {
        width: 100%;
    }

    .ledger-quick-btn {
        flex: 1;
        height: 38px;
    }

    .ledger-items-head {
        display: none;
    }

    .ledger-item-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "name price"
            "warranty qty";
        gap: 0.3rem 0.75rem;
        padding: 0.65rem 0;
    }

    .ledger-item-col-name {
        grid-area: name;
    }

    .ledger-item-col-price {
        grid-area: price;
        align-self: start;
    }

    .ledger-item-col-warranty {
        grid-area: warranty;
        text-align: left;
    }

    .ledger-item-col-qty {
        grid-area: qty;
    }

    .ledger-drawer-footer {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0.65rem;
    }

    .ledger-drawer-footer-left {
        flex: none;
        width: 100%;
    }

    .ledger-summary-box {
        flex: none;
        width: 100%;
        min-width: 0;
        max-width: none;
        margin-left: 0;
    }

    .biz-phone-input-group {
        grid-template-columns: 114px minmax(0, 1fr);
        gap: 6px;
    }

    .biz-phone-input-group .custom-select-trigger {
        padding: 0 28px 0 8px;
        font-size: 0.84rem;
    }

    .biz-phone-input-group .custom-select-arrow {
        right: 8px;
    }

    .lifecycle-action-tabs {
        grid-template-columns: 1fr;
    }
}

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

    .ledger-drawer,
    .ledger-chevron,
    .receipt-ledger-summary,
    .ledger-btn,
    .export-dropdown,
    .shop-export-caret,
    .chart-period-indicator,
    .contact-mode-indicator,
    .receipt-filter-indicator,
    .lifecycle-tab-indicator,
    .lifecycle-collapse-wrap,
    .lifecycle-refund-section,
    .biz-contact-panel,
    #create-receipt-modal .modal-content.is-morphing-height,
    #receipt-modal-body,
    .receipt-success.is-exiting {
        transition: none;
    }

    .lifecycle-reason-presets.is-switching .lifecycle-preset-chip,
    #receipt-modal-body.is-entering,
    .receipt-success.is-visible,
    .receipt-success.is-visible .receipt-success-icon,
    .receipt-success.is-visible .receipt-success-ring,
    .receipt-success.is-visible .receipt-success-circle,
    .receipt-success.is-visible .receipt-success-check,
    .receipt-success.is-visible h3,
    .receipt-success.is-visible .receipt-success-number,
    .receipt-success.is-visible .receipt-success-qr-card,
    .receipt-success.is-visible .receipt-success-card,
    .receipt-success.is-visible .receipt-success-actions {
        animation: none;
    }

    .receipt-success.is-visible .receipt-success-circle,
    .receipt-success.is-visible .receipt-success-check {
        stroke-dashoffset: 0;
    }

    .biz-contact-panel {
        transform: none;
    }

    .receipt-ledger-item.is-row-enter {
        animation: none;
    }
}


/* === Shop Tools Grid (Cash Registers + Product Catalog) === */

.shop-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.shop-tools-grid .terminals-widget {
    margin-bottom: 0;
}

.catalog-widget-icon,
.catalog-heading-icon {
    color: #10b981 !important;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(16, 185, 129, 0.05)) !important;
    border-color: rgba(16, 185, 129, 0.26) !important;
}

@media (max-width: 640px) {
    .shop-tools-grid {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }
}

/* === Receipt Items Actions Row (Add item + From catalog) === */

.receipt-items-actions-row {
    display: flex;
    align-items: stretch;
    gap: 0.65rem;
    margin-top: 0.25rem;
}

.receipt-items-actions-row #add-item-row-btn {
    flex: 1;
    margin-top: 0;
}

.btn-pick-catalog {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    border: 1px dashed rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.06);
    color: #059669;
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

[data-theme="dark"] .btn-pick-catalog {
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(52, 211, 153, 0.35);
}

.btn-pick-catalog:hover {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.65);
}

.btn-pick-catalog:active {
    transform: scale(0.98);
}

@media (max-width: 520px) {
    .receipt-items-actions-row {
        flex-direction: column;
    }
}

/* === Item Name Autocomplete Dropdown === */

.item-name-autocomplete-wrap {
    position: relative;
}

.item-autocomplete-list {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 40;
    max-height: 256px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
    padding: 0.35rem;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.16s ease;
    visibility: visible;
}

[data-theme="dark"] .item-autocomplete-list {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.58);
}

.item-autocomplete-list.is-hidden {
    opacity: 0;
    transform: translateY(-4px);
    visibility: hidden;
    pointer-events: none;
}

.item-ac-option {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.58rem 0.72rem;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--text-main);
    font-family: var(--font-main);
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.12s ease;
}

.item-ac-option:hover,
.item-ac-option.is-active {
    background: rgba(59, 130, 246, 0.1);
}

.item-ac-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.item-ac-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-ac-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.73rem;
    color: var(--text-muted);
}

.item-ac-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.08rem 0.42rem;
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
}

[data-theme="dark"] .item-ac-badge {
    color: #34d399;
}

.item-ac-badge.is-history {
    background: rgba(148, 163, 184, 0.16);
    color: var(--text-muted);
}

.item-ac-price {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
    flex-shrink: 0;
}

/* === Catalog & Picker Modals === */

.catalog-modal-card {
    display: flex;
    flex-direction: column;
    height: min(76dvh, 620px);
    max-height: min(86dvh, 720px);
}

@media (max-width: 768px) {
    #catalog-modal .catalog-modal-card,
    #catalog-picker-modal .catalog-modal-card,
    #catalog-import-modal .catalog-modal-card {
        height: 90dvh;
        max-height: 92dvh;
    }

    #catalog-modal .modal-header {
        margin-bottom: 0.65rem;
    }

    #catalog-modal .catalog-toolbar {
        gap: 0.45rem;
        margin-bottom: 0.6rem;
    }

    #catalog-modal .catalog-list {
        margin-bottom: 0.65rem;
    }

    #catalog-modal .catalog-modal-actions {
        gap: 0.45rem;
    }

    #catalog-modal .catalog-modal-actions .btn-outline {
        flex: 1 1 0;
        padding: 0.58rem 0.65rem;
        font-size: 0.82rem;
        justify-content: center;
    }

    #catalog-modal .catalog-modal-actions .btn-primary {
        padding: 0.72rem 1rem;
    }
}

.catalog-modal-actions {
    display: flex;
    gap: 0.65rem;
    align-items: center;
}

.catalog-modal-actions .btn-outline {
    white-space: nowrap;
    flex-shrink: 0;
}

.catalog-import-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

.catalog-import-list .catalog-item-card {
    cursor: pointer;
}

@keyframes catalogItemIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes catalogQtyPop {
    0% { transform: scale(0.84); }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.catalog-item-card.is-entering {
    animation: catalogItemIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.catalog-item-card.is-removing {
    opacity: 0;
    transform: translateX(18px) scale(0.96);
    transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.catalog-item-card .lifecycle-qty-val.is-popping {
    animation: catalogQtyPop 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.catalog-list {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.catalog-item-card,
.catalog-icon-btn,
.picker-add-btn,
.catalog-cat-chip {
    touch-action: manipulation;
}

.catalog-cat-chip:active {
    transform: scale(0.95);
}

.catalog-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}

.catalog-search-box {
    width: 100%;
    max-width: none;
}

.catalog-category-chips {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    overflow-x: auto;
    padding: 1px 22px 2px 1px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
}

.catalog-category-chips::-webkit-scrollbar {
    display: none;
}

.catalog-category-chips.is-hidden {
    display: none;
}

.catalog-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    padding: 0.28rem 0.64rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.catalog-cat-chip i {
    font-size: 0.7rem;
    opacity: 0.8;
}

.catalog-cat-chip:hover {
    color: var(--text-main);
    border-color: rgba(148, 163, 184, 0.45);
    background: var(--bg-subtle, rgba(148, 163, 184, 0.08));
}

.catalog-cat-chip.active {
    background: rgba(59, 130, 246, 0.13);
    border-color: rgba(59, 130, 246, 0.38);
    color: var(--primary);
}

[data-theme="dark"] .catalog-cat-chip.active {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(96, 165, 250, 0.42);
    color: #93c5fd;
}

.catalog-category-chips[data-kind-accent="service"] .catalog-cat-chip.active {
    background: rgba(139, 92, 246, 0.13);
    border-color: rgba(139, 92, 246, 0.38);
    color: #7c3aed;
}

[data-theme="dark"] .catalog-category-chips[data-kind-accent="service"] .catalog-cat-chip.active {
    background: rgba(139, 92, 246, 0.22);
    border-color: rgba(167, 139, 250, 0.45);
    color: #c4b5fd;
}

.catalog-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 2px;
    margin-bottom: 1rem;
}

.catalog-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: var(--bg-body);
    transition: border-color 0.16s ease, background 0.16s ease;
}

.catalog-item-card.is-picked {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.06);
}

.catalog-picker-list .catalog-item-card {
    cursor: pointer;
}

.catalog-item-left {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    flex: 1;
}

.catalog-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--primary);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.catalog-item-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.catalog-item-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-item-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.catalog-item-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.catalog-item-price {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
}

.catalog-item-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.catalog-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.catalog-icon-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.catalog-icon-btn.is-delete:hover {
    color: var(--error);
    border-color: var(--error);
}

.catalog-icon-btn.is-delete.is-confirming {
    width: auto;
    padding: 0 0.65rem;
    gap: 0.35rem;
    background: var(--error);
    border-color: var(--error);
    color: #fff;
    font-family: var(--font-main);
    font-size: 0.74rem;
    font-weight: 700;
    animation: catalogQtyPop 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.catalog-icon-btn.is-delete.is-confirming:hover {
    color: #fff;
    filter: brightness(1.06);
}

.catalog-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.picker-qty-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.picker-add-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s ease, transform 0.12s ease;
}

[data-theme="dark"] .picker-add-btn {
    color: #34d399;
}

.picker-add-btn:hover {
    background: rgba(16, 185, 129, 0.2);
}

@media (max-width: 520px) {
    .catalog-form-row {
        grid-template-columns: 1fr;
    }
}


/* === Shop Contact Phone/Email Pair & Edit Button === */

.shop-phone-pair {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 0.55rem;
    align-items: stretch;
}

.shop-phone-pair .custom-select-wrapper,
.shop-phone-pair .cs-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
}

.shop-phone-pair .custom-select-trigger,
.shop-phone-pair .cs-trigger {
    width: 100%;
    height: 100%;
    min-height: 46px;
    box-sizing: border-box;
}

.shop-phone-pair input[type="tel"] {
    width: 100%;
    height: 100%;
    min-height: 46px;
    box-sizing: border-box;
}

.label-optional {
    font-size: 0.76em;
    font-weight: 400;
    color: var(--text-muted);
    opacity: 0.78;
    margin-left: 0.25rem;
}

.input-clear-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.shop-phone-pair .input-clear-wrap {
    height: 100%;
}

.input-clear-wrap input {
    width: 100%;
    padding-right: 2.55rem;
}

.input-clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(148, 163, 184, 0.16);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0;
    touch-action: manipulation;
    transition: background 0.15s ease, color 0.15s ease;
}

.input-clear-btn:hover {
    background: rgba(239, 68, 68, 0.14);
    color: #ef4444;
}

.input-clear-btn:active {
    transform: translateY(-50%) scale(0.92);
}

.input-clear-btn.is-hidden {
    display: none;
}

.shop-meta .meta-item.is-hidden {
    display: none;
}

.btn-edit-shop-contacts {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.65rem;
    margin-left: auto;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-body);
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.btn-edit-shop-contacts:hover {
    color: var(--primary);
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.06);
}

@media (max-width: 768px) {
    .shop-meta #display-contact-phone-wrap,
    .shop-meta #display-contact-email-wrap {
        grid-column: 1 / -1;
    }

    .btn-edit-shop-contacts {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 0.2rem;
        padding: 0.6rem 0.9rem;
        border-radius: 12px;
        font-size: 0.84rem;
        gap: 0.45rem;
    }
}

/* --- Catalog CSV / Excel File Import Modal --- */
#catalog-file-import-modal .catalog-modal-card {
    height: auto;
}

.catalog-modal-actions {
    flex-wrap: wrap;
}

.cfi-dropzone.is-hidden,
.cfi-file-chip.is-hidden,
.cfi-error-banner.is-hidden,
.cfi-summary.is-hidden,
.cfi-dup-mode.is-hidden,
.cfi-preview-wrap.is-hidden,
.cfi-errors-wrap.is-hidden {
    display: none !important;
}

.cfi-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.25rem 0 0.75rem;
    max-height: 62vh;
    overflow-y: auto;
}

.cfi-template-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: var(--bg-subtle, rgba(148, 163, 184, 0.06));
    border: 1px solid var(--border-color);
    font-size: 0.79rem;
    color: var(--text-muted);
}

.cfi-template-hint {
    line-height: 1.35;
}

.cfi-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 2rem 1.25rem;
    border: 1.5px dashed var(--border-color);
    border-radius: 14px;
    background: var(--bg-subtle, rgba(148, 163, 184, 0.05));
    cursor: pointer;
    text-align: center;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.cfi-dropzone:hover,
.cfi-dropzone:focus-visible,
.cfi-dropzone.is-dragover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.07);
    outline: none;
}

.cfi-dropzone-icon {
    font-size: 1.65rem;
    color: var(--primary);
    margin-bottom: 0.15rem;
}

.cfi-dropzone-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-main);
}

.cfi-dropzone-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.cfi-file-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-subtle, rgba(148, 163, 184, 0.06));
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text-main);
}

.cfi-file-chip-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.cfi-file-chip-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cfi-error-banner {
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #ef4444;
    font-size: 0.84rem;
    line-height: 1.4;
}

.cfi-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.cfi-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.cfi-pill.is-ok {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.cfi-pill.is-warn {
    background: rgba(245, 158, 11, 0.13);
    color: #d97706;
}

.cfi-pill.is-err {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.cfi-dup-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.15rem;
    padding: 0.6rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-size: 0.84rem;
    color: var(--text-main);
}

.cfi-dup-option {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.cfi-preview-wrap {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    overflow: auto;
    max-height: 240px;
}

.cfi-preview-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
}

.cfi-preview-table th,
.cfi-preview-table td {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    vertical-align: middle;
}

.cfi-preview-table thead th {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    z-index: 2;
}

.cfi-preview-table tbody tr:last-child td {
    border-bottom: none;
}

.cfi-th-num,
.cfi-td-num {
    text-align: right;
    white-space: nowrap;
}

.cfi-td-name {
    font-weight: 500;
    color: var(--text-main);
    max-width: 240px;
}

.cfi-td-sku {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.35rem;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-subtle, rgba(148, 163, 184, 0.12));
}

.cfi-row-badge.is-upd {
    display: inline-block;
    margin-right: 0.35rem;
    padding: 0.08rem 0.35rem;
    border-radius: 4px;
    font-size: 0.66rem;
    font-weight: 700;
    background: rgba(245, 158, 11, 0.16);
    color: #d97706;
}

.cfi-td-more {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.cfi-errors-wrap {
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.05);
}

.cfi-errors-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ef4444;
    margin-bottom: 0.35rem;
}

.cfi-errors-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    max-height: 110px;
    overflow-y: auto;
}

.cfi-errors-list li + li {
    margin-top: 0.2rem;
}

/* --- Product / Service Kind Toggle & Badges --- */
.receipt-item-top .btn-remove-item {
    margin-left: 0;
    flex-shrink: 0;
}

.item-kind-toggle {
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    padding: 2px;
    border-radius: 9px;
    background: var(--bg-subtle, rgba(148, 163, 184, 0.12));
    border: 1px solid var(--border);
    margin-left: auto;
    margin-right: 0.25rem;
    flex-shrink: 0;
    isolation: isolate;
}

.item-kind-toggle.is-full {
    display: grid;
    width: 100%;
    margin: 0;
    padding: 3px;
    border-radius: 11px;
}

.item-kind-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(50% - 2px);
    height: calc(100% - 4px);
    border-radius: 7px;
    background: var(--card-bg);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.04);
    transform: translateX(0);
    transition: transform 0.34s cubic-bezier(0.32, 1.15, 0.48, 1), background-color 0.2s ease, box-shadow 0.2s ease;
    z-index: 0;
    pointer-events: none;
}

.item-kind-toggle.is-full .item-kind-thumb {
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    border-radius: 8px;
}

.item-kind-toggle[data-kind="service"] .item-kind-thumb {
    transform: translateX(100%);
    box-shadow: 0 1px 4px rgba(139, 92, 246, 0.18), 0 0 0 1px rgba(139, 92, 246, 0.16);
}

[data-theme="dark"] .item-kind-thumb {
    background: rgba(59, 130, 246, 0.22);
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.24);
}

[data-theme="dark"] .item-kind-toggle[data-kind="service"] .item-kind-thumb {
    background: rgba(139, 92, 246, 0.26);
    box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.3);
}

.item-kind-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.24rem 0.56rem;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.73rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.18s ease, transform 0.12s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.item-kind-btn i {
    font-size: 0.68rem;
    opacity: 0.85;
}

.item-kind-btn:active {
    transform: scale(0.95);
}

.item-kind-toggle.is-full .item-kind-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.84rem;
    border-radius: 8px;
}

.item-kind-toggle.is-full .item-kind-btn i {
    font-size: 0.78rem;
}

.item-kind-btn.is-active {
    color: var(--primary);
}

.item-kind-btn.is-active[data-kind="service"] {
    color: #7c3aed;
}

[data-theme="dark"] .item-kind-btn.is-active {
    color: #60a5fa;
}

[data-theme="dark"] .item-kind-btn.is-active[data-kind="service"] {
    color: #c4b5fd;
}

/* Subtle purple accent when a receipt row is switched to Service mode */
.receipt-item-row {
    transition: border-color 0.24s ease, box-shadow 0.24s ease, background-color 0.24s ease;
}

.receipt-item-row[data-item-kind="service"] {
    border-color: rgba(139, 92, 246, 0.32);
    box-shadow: 0 2px 10px -4px rgba(139, 92, 246, 0.16);
}

.receipt-item-row[data-item-kind="service"] .item-index {
    color: #7c3aed;
    background: rgba(139, 92, 246, 0.14);
}

[data-theme="dark"] .receipt-item-row[data-item-kind="service"] {
    border-color: rgba(167, 139, 250, 0.34);
    box-shadow: 0 2px 12px -4px rgba(139, 92, 246, 0.25);
}

[data-theme="dark"] .receipt-item-row[data-item-kind="service"] .item-index {
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.24);
}

@keyframes warrantyChipPop {
    0% {
        opacity: 0;
        transform: translateY(3px) scale(0.92);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.warranty-chip.is-popping {
    animation: warrantyChipPop 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (max-width: 440px) {
    .receipt-item-top .item-top-hint {
        display: none;
    }

    .receipt-item-top .item-kind-btn {
        padding: 0.24rem 0.45rem;
        font-size: 0.72rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .item-kind-thumb,
    .item-kind-btn,
    .receipt-item-row,
    .warranty-chip.is-popping {
        transition: none !important;
        animation: none !important;
    }
}

.catalog-kind-chips {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    padding: 3px;
    border-radius: 11px;
    background: var(--bg-subtle, rgba(148, 163, 184, 0.1));
    border: 1px solid var(--border);
    isolation: isolate;
}

.catalog-kind-chips.is-hidden {
    display: none;
}

.catalog-kind-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc((100% - 6px) / 3);
    height: calc(100% - 6px);
    border-radius: 8px;
    background: var(--card-bg);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.04);
    transform: translateX(0);
    transition: transform 0.34s cubic-bezier(0.32, 1.15, 0.48, 1), background-color 0.2s ease, box-shadow 0.2s ease;
    z-index: 0;
    pointer-events: none;
}

.catalog-kind-chips[data-active-kind="product"] .catalog-kind-thumb {
    transform: translateX(100%);
}

.catalog-kind-chips[data-active-kind="service"] .catalog-kind-thumb {
    transform: translateX(200%);
    box-shadow: 0 1px 4px rgba(139, 92, 246, 0.2), 0 0 0 1px rgba(139, 92, 246, 0.18);
}

[data-theme="dark"] .catalog-kind-thumb {
    background: rgba(59, 130, 246, 0.2);
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.24);
}

[data-theme="dark"] .catalog-kind-chips[data-active-kind="service"] .catalog-kind-thumb {
    background: rgba(139, 92, 246, 0.26);
    box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.3);
}

.catalog-kind-seg-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.42rem 0.5rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    min-width: 0;
    transition: color 0.18s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.catalog-kind-seg-btn:active {
    transform: scale(0.96);
}

.catalog-kind-seg-btn i {
    font-size: 0.72rem;
    opacity: 0.8;
}

.catalog-kind-seg-btn.is-active {
    color: var(--primary);
}

.catalog-kind-seg-btn.is-active[data-kind-val="service"] {
    color: #7c3aed;
}

[data-theme="dark"] .catalog-kind-seg-btn.is-active {
    color: #93c5fd;
}

[data-theme="dark"] .catalog-kind-seg-btn.is-active[data-kind-val="service"] {
    color: #c4b5fd;
}

.catalog-kind-seg-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: rgba(148, 163, 184, 0.16);
    color: var(--text-muted);
    transition: background-color 0.18s ease, color 0.18s ease;
}

.catalog-kind-seg-btn.is-active .catalog-kind-seg-count {
    background: rgba(59, 130, 246, 0.14);
    color: var(--primary);
}

.catalog-kind-seg-btn.is-active[data-kind-val="service"] .catalog-kind-seg-count {
    background: rgba(139, 92, 246, 0.16);
    color: #7c3aed;
}

[data-theme="dark"] .catalog-kind-seg-btn.is-active .catalog-kind-seg-count {
    background: rgba(59, 130, 246, 0.25);
    color: #bfdbfe;
}

[data-theme="dark"] .catalog-kind-seg-btn.is-active[data-kind-val="service"] .catalog-kind-seg-count {
    background: rgba(139, 92, 246, 0.3);
    color: #ddd6fe;
}

@media (max-width: 420px) {
    .catalog-kind-seg-btn i {
        display: none;
    }

    .catalog-kind-seg-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .catalog-kind-thumb,
    .catalog-kind-seg-btn {
        transition: none !important;
    }
}

.service-kind-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.42rem;
    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;
}
