/* ===== mB2B — Mobile-first B2B Client ===== */

:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-500: #adb5bd;
    --gray-700: #495057;
    --gray-900: #212529;
    --tab-height: 56px;
    --navbar-height: 56px;
    --touch-min: 44px;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--gray-100);
    color: var(--gray-900);
    padding-bottom: calc(var(--tab-height) + 8px);
    padding-top: var(--navbar-height);
    -webkit-tap-highlight-color: transparent;
}

/* ===== NAVBAR ===== */
.app-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 12px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.app-navbar .brand {
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
    margin-right: 12px;
}
.app-navbar .search-wrap {
    flex: 1;
    position: relative;
}
.app-navbar .search-wrap input {
    width: 100%;
    height: 36px;
    border: none;
    border-radius: 18px;
    padding: 0 36px 0 14px;
    font-size: 0.9rem;
    outline: none;
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.app-navbar .search-wrap input::placeholder { color: rgba(255,255,255,0.6); }
.app-navbar .search-wrap input:focus {
    background: #fff;
    color: var(--gray-900);
}
.app-navbar .search-wrap input:focus::placeholder { color: var(--gray-500); }
.app-navbar .search-wrap .search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 1.1rem;
    cursor: pointer;
    display: none;
    padding: 4px;
}
.app-navbar .search-wrap input:focus ~ .search-clear { color: var(--gray-500); }
/* Nav links — hidden on mobile (bottom tabs visible), shown on desktop */
.app-navbar .nav-links {
    display: none;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.app-navbar .nav-links a {
    color: rgba(255,255,255,0.7);
    font-size: 1.25rem;
    text-decoration: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}
.app-navbar .nav-links a:hover,
.app-navbar .nav-links a.active {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

.app-navbar .nav-cart {
    position: relative;
    color: #fff;
    font-size: 1.5rem;
    margin-left: 12px;
    cursor: pointer;
    text-decoration: none;
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
    justify-content: center;
}
.app-navbar .nav-cart .badge {
    position: absolute;
    top: 2px;
    right: -2px;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 10px;
    background: var(--danger);
    color: #fff;
    min-width: 18px;
    text-align: center;
}

/* ===== BOTTOM TABS ===== */
.bottom-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--tab-height);
    background: #fff;
    display: flex;
    border-top: 1px solid var(--gray-200);
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}
.bottom-tabs a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--gray-500);
    font-size: 0.7rem;
    gap: 2px;
    min-height: var(--touch-min);
    transition: color 0.15s;
    position: relative;
}
.bottom-tabs a i { font-size: 1.3rem; }
.bottom-tabs a.active { color: var(--primary); font-weight: 600; }
.bottom-tabs a .tab-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 20px);
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 10px;
    background: var(--danger);
    color: #fff;
    min-width: 16px;
    text-align: center;
}

/* ===== MAIN CONTENT ===== */
#app {
    max-width: 960px;
    margin: 0 auto;
    padding: 8px;
    min-height: calc(100vh - var(--navbar-height) - var(--tab-height));
}

/* ===== PRODUCT CARDS ===== */
.product-list { display: flex; flex-direction: column; gap: 6px; }
.product-card {
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.product-card .card-photo-wrap img,
.product-card > img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 6px;
    background: var(--gray-100);
    flex-shrink: 0;
}
.product-card .product-info { flex: 1; min-width: 0; }
.product-card .product-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.product-card .product-sku {
    font-size: 0.7rem;
    color: var(--gray-500);
    margin: 0 0 4px;
}
.product-card .product-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-dark);
}
.product-card .product-unit {
    font-size: 0.7rem;
    color: var(--gray-500);
}
/* ===== FAVORITES ===== */
.card-photo-wrap {
    position: relative;
    flex-shrink: 0;
}
.card-photo-wrap img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
}
.btn-fav {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255,255,255,0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}
.btn-fav.is-fav {
    color: #e53935;
}
.btn-fav:active {
    transform: scale(1.3);
}
.btn-fav-filter {
    height: 34px;
    padding: 0 10px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    background: #fff;
    color: var(--gray-500);
    font-size: 0.82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
    flex-shrink: 0;
}
.btn-fav-filter.active {
    border-color: #e53935;
    background: #fce4ec;
    color: #e53935;
}
.btn-fav-filter .fav-count {
    font-weight: 700;
    font-size: 0.75rem;
}
.btn-fav-detail {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    font-size: 1.3rem;
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-fav-detail.is-fav {
    color: #e53935;
}
.btn-fav-detail:active {
    transform: scale(1.3);
}

.product-box-badge {
    display: inline-block;
    background: #e8f4e8;
    color: #2e7d32;
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 4px;
}
.product-card .btn-add {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: #fff;
    color: var(--primary);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}
.product-card .btn-add:active {
    background: var(--primary);
    color: #fff;
}

/* ===== CATEGORY FILTER ===== */
.filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    align-items: center;
}
.filter-row select {
    flex: 1;
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    padding: 0 8px;
    font-size: 0.85rem;
    background: #fff;
}
.filter-controls .sort-select {
    flex: 0 0 auto;
    width: auto;
    min-width: 80px;
    height: 34px;
    font-size: 0.8rem;
    padding: 0 6px;
}
.filter-controls .result-count {
    font-size: 0.78rem;
    color: var(--gray-500);
    white-space: nowrap;
    margin-left: auto;
}

/* ===== QUICK-ADD MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.modal-sheet {
    background: #fff;
    width: 100%;
    max-width: 480px;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    animation: slideUp 0.2s ease-out;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.modal-sheet .modal-product {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.modal-sheet .modal-product img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--gray-100);
}
.modal-sheet .modal-product .info h5 { margin: 0 0 4px; font-size: 1rem; }
.modal-sheet .modal-product .info .price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
}
.qty-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}
.qty-control button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: #fff;
    color: var(--primary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qty-control button:active { background: var(--primary); color: #fff; }
.qty-control input {
    width: 80px;
    height: 48px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
}
.modal-sheet .btn-confirm {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 24px;
    background: var(--primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}
.modal-sheet .btn-confirm:active { background: var(--primary-dark); }
.modal-sheet .btn-cancel {
    width: 100%;
    height: 44px;
    border: none;
    background: none;
    color: var(--gray-500);
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 8px;
}

/* ===== BULK PACKAGING ===== */
.box-info {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #e8f4e8;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #2e7d32;
    margin-bottom: 12px;
}
.box-info i { font-size: 1rem; }

.quick-qty-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.quick-qty-btn {
    flex: 1;
    height: 44px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    background: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}
.quick-qty-btn small {
    font-weight: 400;
    font-size: 0.7rem;
    color: var(--gray-500);
}
.quick-qty-btn.active {
    border-color: var(--primary);
    background: #e7f0ff;
    color: var(--primary);
}
.quick-qty-btn.active small { color: var(--primary); }
.quick-qty-btn:active {
    transform: scale(0.95);
    background: #dbe7ff;
}

/* ===== PRODUCT DETAIL SHEET ===== */
.product-detail-sheet {
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.product-detail-sheet .detail-loading {
    text-align: center;
    padding: 40px;
}
.product-detail-sheet .detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -8px -8px 0 -8px;
}
.product-detail-sheet .detail-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 8px;
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-detail-sheet .detail-photo {
    text-align: center;
    margin-bottom: 16px;
}
.product-detail-sheet .detail-photo img {
    max-width: 100%;
    max-height: 240px;
    object-fit: contain;
    border-radius: 10px;
    background: var(--gray-100);
}
.product-detail-sheet .detail-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.3;
}
.product-detail-sheet .detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.product-detail-sheet .detail-badge {
    font-size: 0.72rem;
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 3px 8px;
    border-radius: 12px;
}
.product-detail-sheet .detail-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.product-detail-sheet .detail-price-main {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-dark);
}
.product-detail-sheet .detail-price-unit {
    font-size: 0.8rem;
    color: var(--gray-500);
}
.product-detail-sheet .detail-price-old {
    font-size: 0.9rem;
    color: var(--gray-500);
    text-decoration: line-through;
}
.product-detail-sheet .detail-specs {
    margin-bottom: 12px;
}
.product-detail-sheet .spec-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--gray-100);
}
.product-detail-sheet .spec-row span { color: var(--gray-500); }
.product-detail-sheet .detail-desc {
    background: var(--gray-100);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 0.82rem;
    color: var(--gray-700);
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
}
.product-detail-sheet .detail-desc p {
    margin: 0 0 4px;
}
.product-detail-sheet .detail-desc u {
    font-weight: 700;
    text-decoration: none;
    display: block;
    margin-top: 8px;
    margin-bottom: 2px;
    font-size: 0.88rem;
    color: var(--gray-900);
}
.product-detail-sheet .detail-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 4px;
}
.product-detail-sheet .detail-actions .qty-control {
    margin-bottom: 0;
    flex-shrink: 0;
}
.product-detail-sheet .detail-actions .btn-confirm {
    flex: 1;
    min-width: 0;
}

/* ===== CART ===== */
.cart-item {
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.cart-item img,
.cart-item .cart-thumb {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 6px;
    background: var(--gray-100);
    flex-shrink: 0;
}
.cart-item .cart-info { flex: 1; min-width: 0; }
.cart-item .cart-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cart-item .cart-price {
    font-size: 0.8rem;
    color: var(--gray-700);
}
.cart-item .cart-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cart-item .cart-qty button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--gray-200);
    background: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-item .cart-qty input {
    width: 48px;
    height: 32px;
    text-align: center;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}
.cart-item .btn-remove {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
}

.cart-summary {
    position: fixed;
    bottom: var(--tab-height);
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--gray-200);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 900;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}
.cart-summary .total {
    font-size: 1.1rem;
    font-weight: 700;
}
.cart-summary .total small { font-size: 0.75rem; color: var(--gray-500); font-weight: 400; }
.cart-summary .btn-order {
    height: 44px;
    padding: 0 24px;
    border: none;
    border-radius: 22px;
    background: var(--success);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}
.cart-summary .btn-order:active { background: #157347; }

/* ===== CHECKOUT ===== */
.checkout-section {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.checkout-section h6 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--gray-700);
}
.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    min-height: var(--touch-min);
}
.radio-option:last-child { border-bottom: none; }
.radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}
.radio-option label { flex: 1; font-size: 0.9rem; cursor: pointer; }

.checkout-items {
    font-size: 0.85rem;
}
.checkout-items .item-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--gray-100);
}
.checkout-items .item-row:last-child { border-bottom: none; }

.btn-finalize {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 26px;
    background: var(--success);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
}
.btn-finalize:active { background: #157347; }
.btn-finalize:disabled { background: var(--gray-500); cursor: not-allowed; }

/* ===== ORDER SUCCESS ===== */
.order-success {
    text-align: center;
    padding: 40px 20px;
}
.order-success i { font-size: 4rem; color: var(--success); }
.order-success h4 { margin: 16px 0 8px; }
.order-success .order-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

/* ===== HISTORY ===== */
.period-select {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}
.period-select button {
    flex: 1;
    height: 36px;
    border: 1px solid var(--gray-200);
    border-radius: 18px;
    background: #fff;
    font-size: 0.8rem;
    cursor: pointer;
}
.period-select button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
/* History tabs */
.history-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    background: var(--gray-200);
    border-radius: 10px;
    padding: 3px;
}
.history-tabs .htab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.15s;
}
.history-tabs .htab.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.history-tabs .htab i { margin-right: 4px; }

/* Order cards */
.order-card {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: box-shadow 0.15s;
}
.order-card.expanded {
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.order-card .order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.order-card .order-number { font-weight: 700; font-size: 0.9rem; }
.order-card .order-date { font-size: 0.8rem; color: var(--gray-500); }
.order-card .order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.order-card .order-value { font-weight: 700; color: var(--primary-dark); }
.order-card .order-status {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--gray-200);
    display: inline-block;
}
.order-status.status-new { background: #cfe2ff; color: #084298; }
.order-status.status-processing { background: #fff3cd; color: #664d03; }
.order-status.status-shipped { background: #d1e7dd; color: #0f5132; }
.order-status.status-done { background: #d1e7dd; color: #0f5132; }
.order-status.status-cancelled { background: #f8d7da; color: #842029; }
.badge-paid {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 8px;
    background: #d1e7dd;
    color: #0f5132;
    margin-right: 4px;
}

/* Order details */
.order-details {
    border-top: 1px solid var(--gray-200);
    margin-top: 10px;
    padding-top: 10px;
}
.detail-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}
.detail-label { color: var(--gray-500); }
.detail-value { font-weight: 500; text-align: right; }
.detail-total { font-weight: 700; color: var(--primary-dark); font-size: 1rem; }

/* Order positions */
.detail-positions {
    border-top: 1px solid var(--gray-200);
    margin-top: 10px;
    padding-top: 10px;
}
.detail-positions h6 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.detail-position {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--gray-100);
}
.detail-position .pos-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-position .pos-qty { color: var(--gray-500); white-space: nowrap; }
.detail-position .pos-price { font-weight: 600; white-space: nowrap; }

/* Detail actions */
.detail-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.btn-detail-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-detail-action:hover {
    background: var(--primary);
    color: #fff;
}
.btn-detail-action.btn-repeat {
    border-color: var(--success);
    color: var(--success);
}
.btn-detail-action.btn-repeat:hover {
    background: var(--success);
    color: #fff;
}

/* Settlement cards */
.settlement-summary {
    background: #fff;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.settlement-summary .summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.9rem;
}
.settlement-summary .summary-row strong { font-size: 1rem; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.settlement-card {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.settlement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.settlement-doc { font-weight: 600; font-size: 0.9rem; }
.settlement-date { font-size: 0.8rem; color: var(--gray-500); }
.settlement-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.settlement-amount { font-weight: 700; }
.amount-positive { color: var(--success); }
.amount-negative { color: var(--danger); }
.settlement-status { font-size: 0.8rem; color: var(--gray-500); }
.settlement-status i { margin-right: 2px; }
.settlement-desc { font-size: 0.8rem; color: var(--gray-500); margin-top: 4px; }

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: calc(var(--navbar-height) + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
}
.toast-msg {
    background: var(--gray-900);
    color: #fff;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: fadeInOut 2s ease-in-out;
    white-space: nowrap;
}
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-10px); }
    15% { opacity: 1; transform: translateY(0); }
    85% { opacity: 1; }
    100% { opacity: 0; }
}

/* ===== SPINNER ===== */
.page-spinner {
    text-align: center;
    padding: 40px;
}
.page-spinner .spinner-border { width: 3rem; height: 3rem; color: var(--primary); }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
}
.empty-state i { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { margin: 0; }

/* ===== ACCOUNT ===== */
.account-section {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.account-section h6 {
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.account-loading {
    color: var(--gray-500);
    font-size: 0.85rem;
}
.account-info-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.account-info-row {
    display: flex;
    gap: 12px;
}
.account-label {
    flex: 0 0 70px;
    font-size: 0.78rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding-top: 2px;
}
.account-value {
    flex: 1;
    font-size: 0.9rem;
    color: var(--gray-900);
    word-break: break-word;
}
.account-value a {
    color: var(--primary);
    text-decoration: none;
}
.account-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.account-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    background: var(--gray-100);
    color: var(--gray-900);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s;
}
.account-link:active { background: var(--gray-200); }
.account-link i { font-size: 1.1rem; color: var(--primary); }
.address-card {
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--gray-100);
    margin-bottom: 8px;
}
.address-card .address-name {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 4px;
}
.address-card .address-line {
    font-size: 0.82rem;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 6px;
}
.address-card .address-line i {
    font-size: 0.75rem;
    color: var(--gray-500);
}
.btn-logout {
    width: 100%;
    height: 48px;
    border: 2px solid var(--danger);
    border-radius: 24px;
    background: #fff;
    color: var(--danger);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}
.btn-logout:active { background: var(--danger); color: #fff; }

/* ===== DESKTOP (≥768px) ===== */
@media (min-width: 768px) {
    .bottom-tabs { display: none; }
    .app-navbar .nav-links { display: flex; }
    body { padding-bottom: 8px; }
    #app { max-width: 720px; padding: 16px; }
    .product-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .cart-summary { max-width: 720px; left: 50%; transform: translateX(-50%); border-radius: 12px 12px 0 0; }
}

@media (min-width: 1024px) {
    .product-list {
        grid-template-columns: repeat(3, 1fr);
    }
}
