@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --bg-dark: #09090b;
    --bg-panel: #18181b;
    --primary: #8b5cf6;
    /* Violet */
    --accent: #a78bfa;
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --border: #27272a;
    --success: #10b981;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body.antigravity-app {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    font-size: 0.875rem;
    /* Fix layout */
    height: 100vh;
}

/* Layout */
.layout-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Product Section (Left) */
.product-section {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: radial-gradient(circle at top left, #1c1c20 0%, var(--bg-dark) 100%);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.brand-logo {
    font-weight: 700;
    letter-spacing: -1px;
    font-size: 1.5rem;
}

.brand-logo .highlight {
    color: var(--primary);
}

.status-indicator {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
}

/* Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px rgba(139, 92, 246, 0.3);
}

.product-card:active {
    transform: scale(0.98);
}

.product-image-placeholder {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #27272a, #3f3f46);
    border-radius: 12px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.1);
}

.product-info h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.product-info .price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

.product-info .stock {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Sidebar (Right) */
.cart-section {
    width: 400px;
    background: var(--bg-panel);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.cart-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    font-size: 1.1rem;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 14px;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateX(4px);
}

.cart-item-info h4 {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.cart-item-info .meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.3rem;
    border-radius: 10px;
    gap: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.qty-display {
    min-width: 32px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary);
}

.btn-qty {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-qty:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.1);
}

.btn-remove {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.1);
    color: var(--danger);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-remove:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.3);
    transform: scale(1.1) rotate(8deg);
}

.cart-footer {
    padding: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.summary-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 0.75rem;
    margin-bottom: 1rem;
}

.btn-checkout {
    width: 100%;
    background: linear-gradient(90deg, var(--primary), #7c3aed);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-checkout:hover {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.btn-checkout:active {
    transform: scale(0.98);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    margin-top: 3rem;
    font-style: italic;
}

/* Utils */
.hidden {
    display: none !important;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    z-index: 100;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 20px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow-x: auto;
        white-space: nowrap;
        flex-direction: row;
    }

    .sidebar .nav-menu {
        margin-top: 0;
        display: flex;
        gap: 1rem;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem;
    }

    .layout-container {
        flex-direction: column;
        overflow: hidden;
    }

    .product-section {
        width: 100%;
        height: calc(100vh - 80px);
        padding: 1rem;
        padding-bottom: 100px;
    }

    .top-bar {
        margin-bottom: 1rem;
    }

    .brand-logo {
        font-size: 1.4rem;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .product-card {
        padding: 1rem;
    }

    .product-image-placeholder {
        height: 80px;
        font-size: 1.5rem;
    }

    .cart-section {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 85vh;
        z-index: 100;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 20px 20px 0 0;
        border-left: none;
        border-top: 1px solid var(--primary);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    }

    .cart-section.open {
        transform: translateY(0);
    }

    .mobile-cart-btn {
        display: flex !important;
    }

    .table-container {
        overflow-x: auto;
    }
}

.mobile-cart-btn {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    background: var(--primary);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.5);
    z-index: 90;
    border: none;
    cursor: pointer;
}

.close-cart-btn {
    display: none;
}

@media (max-width: 768px) {
    .close-cart-btn {
        display: block;
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: white;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        font-size: 1.2rem;
        cursor: pointer;
    }
}

#product-search {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--bg-panel);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1.1rem;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s;
}

#product-search:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.search-wrapper {
    position: relative;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 3rem;
    background: rgba(30, 30, 36, 0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.search-input:focus {
    border-color: var(--primary);
    outline: none;
    background: rgba(30, 30, 36, 0.8);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.3s;
    width: 20px;
    height: 20px;
}

.search-input:focus+.search-icon {
    color: var(--primary);
}

.search-shortcut {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: Consolas, monospace;
    pointer-events: none;
    opacity: 0.7;
}

.search-input:focus~.search-shortcut {
    opacity: 0;
}

/* Modal Overlay */
.modal-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ====================================================
   TOPBAR BUTTONS (Pro Max)
   ==================================================== */
.topbar-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.875rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topbar-link-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--text-main);
}

.topbar-link-btn--danger {
    color: rgba(239, 68, 68, 0.7);
}

.topbar-link-btn--danger:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--danger);
}

/* ====================================================
   HISTORY BUTTON — Liquid Glass Gold
   ==================================================== */
.btn-history-pro {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.48rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(202, 138, 4, 0.35);
    background: rgba(202, 138, 4, 0.1);
    color: #fbbf24;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.2px;
}

.btn-history-pro__glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(251, 191, 36, 0.18) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.btn-history-pro:hover {
    background: rgba(202, 138, 4, 0.18);
    border-color: rgba(251, 191, 36, 0.55);
    color: #fde68a;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.12), 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.btn-history-pro:hover .btn-history-pro__glow {
    opacity: 1;
}

.btn-history-pro:active {
    transform: translateY(0) scale(0.97);
}

.btn-history-pro svg {
    flex-shrink: 0;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.btn-history-pro:hover svg {
    opacity: 1;
}

.btn-history-pro__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: rgba(251, 191, 36, 0.25);
    color: #fde68a;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

/* ====================================================
   HISTORY MODAL — Liquid Glass Pro Max
   ==================================================== */
.hm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    animation: hm-fade-in 0.25s ease-out;
}

.hm-backdrop.is-open {
    display: flex;
}

@keyframes hm-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.hm-box {
    position: relative;
    width: 95%;
    max-width: 820px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(24, 24, 27, 0.9);
    backdrop-filter: blur(40px) saturate(1.8);
    -webkit-backdrop-filter: blur(40px) saturate(1.8);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 32px 80px -16px rgba(0, 0, 0, 0.8),
        0 0 60px rgba(202, 138, 4, 0.04);
    overflow: hidden;
    animation: hm-slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hm-slide-up {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }

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

/* Top accent line */
.hm-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.5), transparent);
    pointer-events: none;
}

/* --- Header --- */
.hm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    gap: 1rem;
}

.hm-header__left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hm-header__right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hm-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(202, 138, 4, 0.12);
    border: 1px solid rgba(202, 138, 4, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fbbf24;
    flex-shrink: 0;
}

.hm-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.2rem;
    letter-spacing: -0.3px;
}

.hm-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hm-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
    flex-shrink: 0;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 6px var(--success);
    }

    50% {
        opacity: 0.6;
        box-shadow: 0 0 10px var(--success);
    }
}

/* Stats chips */
.hm-stats {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    overflow: hidden;
    padding: 0 0.25rem;
}

.hm-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 0.875rem;
    gap: 0;
}

.hm-stat__val {
    font-size: 1rem;
    font-weight: 800;
    color: #fbbf24;
    line-height: 1.2;
}

.hm-stat__lbl {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.hm-stat-divider {
    width: 1px;
    height: 28px;
    background: rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.hm-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.hm-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}

/* --- Body --- */
.hm-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.hm-body::-webkit-scrollbar {
    width: 4px;
}

.hm-body::-webkit-scrollbar-track {
    background: transparent;
}

.hm-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
}

/* Loading */
.hm-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 4rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.hm-loading__ring {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(202, 138, 4, 0.2);
    border-top-color: #fbbf24;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Empty state */
.hm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 0;
    gap: 0.75rem;
    color: var(--text-muted);
}

.hm-empty__icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 0.25rem;
}

.hm-empty p {
    font-size: 0.875rem;
}

.hm-empty small {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* ====================================================
   BILL CARD — Pro Max (used inside .hm-body)
   ==================================================== */
.bc {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    margin-bottom: 0.875rem;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.bc:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.bc.bc--expanded {
    border-color: rgba(202, 138, 4, 0.2);
}

.bc__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    gap: 1rem;
    cursor: pointer;
}

.bc__left {
    flex: 1;
    min-width: 0;
}

.bc__num {
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #fbbf24;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.bc__meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bc__meta-sep {
    opacity: 0.35;
}

.bc__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.bc__amount {
    text-align: right;
}

.bc__amount-main {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    display: block;
}

.bc__amount-refunded {
    font-size: 0.72rem;
    color: var(--danger);
    display: block;
    margin-top: 0.1rem;
}

.bc__chevron {
    color: var(--text-muted);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.bc--expanded .bc__chevron {
    transform: rotate(180deg);
}

/* Bill Items section */
.bc__items {
    display: none;
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0;
    animation: bc-items-in 0.2s ease-out;
}

.bc--expanded .bc__items {
    display: block;
}

@keyframes bc-items-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

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

.bc__items-inner {
    padding-top: 0.875rem;
}

.bc__item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    gap: 0.5rem;
}

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

.bc__item-name {
    flex: 1;
    color: var(--text-main);
    font-weight: 500;
}

.bc__item-qty {
    color: var(--text-muted);
    font-size: 0.78rem;
    min-width: 48px;
    text-align: center;
}

.bc__item-sub {
    font-weight: 600;
    color: var(--text-main);
    min-width: 72px;
    text-align: right;
    font-size: 0.82rem;
}

.bc__refund-tag {
    font-size: 0.68rem;
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
    white-space: nowrap;
}

.bc__actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    margin-top: 0.875rem;
}

.bc__refund-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.07);
    color: #f87171;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.bc__refund-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}



/* ============================
   STATUS BADGES
   ============================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-paid {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-partial {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.badge-voided {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-cash {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-transfer {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-debt {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ============================
   REFUND MODAL
   ============================ */
.refund-modal-box {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 24px;
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.refund-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.refund-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.refund-modal-header .order-ref {
    font-size: 0.8rem;
    color: var(--accent);
    font-family: monospace;
    margin-top: 0.25rem;
}

.refund-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
}

.refund-item-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s, background 0.2s;
}

.refund-item-row.selected {
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(139, 92, 246, 0.05);
}

.refund-item-row.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.refund-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.refund-item-detail {
    flex: 1;
    min-width: 0;
}

.refund-item-detail .name {
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.refund-item-detail .meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.refund-qty-input {
    width: 80px;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.875rem;
    text-align: center;
    font-family: 'Outfit', sans-serif;
}

.refund-qty-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.refund-item-subtotal {
    min-width: 70px;
    text-align: right;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--danger);
}

.refund-reason-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.refund-reason-section label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.refund-reason-input {
    width: 100%;
    padding: 0.6rem 0.875rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-main);
    font-size: 0.875rem;
    font-family: 'Outfit', sans-serif;
}

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

.refund-summary-bar {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.refund-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.refund-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.refund-total-amount {
    color: var(--danger);
}

.refund-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.btn-cancel-refund {
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-cancel-refund:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-confirm-refund {
    padding: 0.75rem;
    border-radius: 10px;
    border: none;
    background: linear-gradient(90deg, var(--danger), #dc2626);
    color: white;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-confirm-refund:hover {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-confirm-refund:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-open-refund {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-open-refund:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
}

/* Spinner inside button */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-left-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}