.navbar-brand-icon {
    border-radius: 4px;
    flex-shrink: 0;
}
    position: sticky;
    top: 0;
    z-index: 1030;
    font-size: 0.875rem;
}

body {
    background: #f4f6f9;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
}

.login-card {
    width: 100%;
    max-width: 400px;
    border: none;
}

.stat-card {
    border: none;
    border-radius: 10px;
    height: 100%;
}

.stat-card .card-body {
    padding: 0.75rem 1rem;
}

.stat-card .h3 {
    font-size: 1.25rem;
}

.stat-card .text-muted.small,
.stat-card .small {
    font-size: 0.75rem;
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 7px;
    max-height: 400px;
    overflow-y: auto;
    padding: 2px 1px;
}

.item-tile {
    display: flex;
    flex-direction: column;
    border: 1px solid #e3e8ef;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    min-height: 76px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.item-tile:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
    transform: translateY(-2px);
}

.item-tile:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.item-tile-body {
    flex: 1;
    padding: 6px 7px 5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.item-tile-cat {
    font-size: 0.58rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-tile-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.item-tile-shop-hint {
    font-size: 0.55rem;
    line-height: 1.2;
    color: #15803d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.item-tile .price,
.item-tile-price {
    margin-top: auto;
    padding: 4px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #1d4ed8;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e8edf3;
    text-align: center;
    white-space: nowrap;
}

.item-tile-price small {
    font-size: 0.58rem;
    font-weight: 500;
    color: #64748b;
}

.cart-panel {
    position: sticky;
    top: 1rem;
    font-size: 0.875rem;
}

.cart-panel .card-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.cart-panel .card-body {
    padding: 0.75rem;
}

.cart-panel .fs-5 {
    font-size: 1rem !important;
}

.cart-panel .table-sm {
    font-size: 0.8rem;
}

.cart-panel .cart-print-rate,
.cart-panel .cart-final-rate {
    max-width: 72px;
    min-width: 64px;
    padding: 0.2rem 0.25rem;
    font-size: 0.75rem;
}

.cart-table col.cart-col-item {
    width: 38%;
}

.cart-table col.cart-col-rate {
    width: 12%;
}

.cart-table col.cart-col-qty {
    width: 14%;
}

.cart-table col.cart-col-total {
    width: 18%;
}

.cart-table col.cart-col-action {
    width: 6%;
}

.cart-item-cell {
    min-width: 120px;
    max-width: 0;
}

.cart-item-name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    text-align: left;
}

.cart-item-name:hover {
    color: #0d6efd !important;
}

.cart-item-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-confirm-dot {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.cart-confirm-dot.is-pending {
    background: #ffc107;
}

.cart-confirm-dot.is-confirmed {
    background: #198754;
    color: #fff;
}

.cart-panel .cart-qty,
.cart-panel .cart-weight {
    max-width: 76px;
    min-width: 68px;
    padding: 0.2rem 0.25rem;
    font-size: 0.75rem;
}

.cart-row-pending {
    background: rgba(255, 193, 7, 0.06);
}

.receipt-mrp {
    text-decoration: line-through;
    color: #94a3b8;
    margin-right: 0.35rem;
}

.receipt-rate-cell {
    white-space: nowrap;
}

.payment-option-btn {
    font-size: 0.875rem;
    padding: 0.4rem 0.75rem;
}

.payment-amount {
    font-size: 1.15rem;
}

.payment-wait-card {
    max-width: 400px;
}

.payment-wait-card .payment-amount {
    font-size: 1.5rem;
    font-weight: 700;
}

.payment-wait-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
}

.payment-wait-badge-gpay {
    background: linear-gradient(135deg, #4285f4, #34a853);
}

.payment-wait-badge-phonepe {
    background: #5f259f;
}

.payment-confirm-panel .btn {
    text-align: center;
}

@media print {
    .navbar, .no-print, #ledgerTabs, .card:not(.ledger-table-card), .modal {
        display: none !important;
    }
    .ledger-table-card {
        border: none !important;
        box-shadow: none !important;
    }
}

.ledger-table th,
.ledger-table td {
    vertical-align: middle;
}

.ledger-page-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    color: #fff;
    flex-shrink: 0;
    background: linear-gradient(135deg, #0d6efd 0%, #5b3df5 55%, #7c3aed 100%);
    box-shadow: 0 3px 10px rgba(13, 110, 253, 0.28);
}

.ledger-page-icon svg {
    width: 1.2rem;
    height: 1.2rem;
}

.account-spend-card .h5 {
    font-size: 1.15rem;
}

.account-profile dt {
    font-size: 0.8rem;
}

.account-profile dd {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.cart-add-bar {
    background: #f8fafc;
}

.cart-add-bar .autocomplete-price,
.item-autocomplete .autocomplete-price {
    flex: 0 0 6.5rem;
    width: 6.5rem;
    min-width: 6.5rem;
    max-width: 7.5rem;
    text-align: right;
}

.item-autocomplete-actions {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.item-autocomplete-actions .autocomplete-type {
    flex: 0 0 7.5rem;
    max-width: 9rem;
}

.item-autocomplete-actions .autocomplete-add {
    flex: 1 1 auto;
    min-width: 4.5rem;
}

.bill-scan-preview {
    min-height: 220px;
    overflow: hidden;
}

.bill-scan-preview-img {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.bill-items-table {
    table-layout: fixed;
    width: 100%;
}

.bill-items-table .bill-items-col-name {
    width: 50%;
    min-width: 11rem;
}

.bill-items-table .bill-items-col-qty {
    width: 1.625rem;
}

.bill-items-table .bill-items-col-weight {
    width: 1.75rem;
}

.bill-items-table .bill-items-col-rate {
    width: 4.25rem;
}

.bill-items-table .bill-items-col-total {
    width: 3.75rem;
}

.bill-items-table .bill-items-col-action {
    width: 1.5rem;
}

.bill-items-table .bill-item-name-cell {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.bill-items-table .item-name {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.bill-items-table .item-type {
    flex: 0 0 4.25rem;
    width: 4.25rem;
    min-width: 4.25rem;
    padding-left: 0.25rem;
    padding-right: 1.25rem;
    font-size: 0.7rem;
}

.bill-items-table .item-qty,
.bill-items-table .item-weight,
.bill-items-table .item-rate {
    width: 100%;
    min-width: 0;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
}

.bill-items-table thead th {
    font-size: 0.75rem;
    white-space: nowrap;
}

.bill-items-table .line-total {
    font-size: 0.75rem;
    white-space: nowrap;
}

.voice-assistant-wrap {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1035;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    max-width: min(280px, calc(100vw - 2rem));
    pointer-events: none;
}

body.modal-open .voice-assistant-wrap {
    display: none;
}

.modal-footer {
    justify-content: flex-start;
    gap: 0.5rem;
}

.voice-assistant-wrap > * {
    pointer-events: auto;
}

.voice-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--bs-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(13, 110, 253, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.voice-fab:hover {
    transform: scale(1.05);
}

.voice-fab.is-listening {
    background: var(--bs-danger);
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.25);
    animation: voice-pulse 1.2s ease-in-out infinite;
}

.voice-fab.is-disabled {
    opacity: 0.55;
}

.voice-status {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0.5rem;
    padding: 0.35rem 0.6rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: right;
}

@keyframes voice-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.autocomplete-wrap {
    min-width: 0;
}

.plan-item-picker .autocomplete-list {
    max-height: 260px;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.autocomplete-list li {
    padding: 8px 10px;
    font-size: 0.8125rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.autocomplete-list li:last-child {
    border-bottom: none;
}

.autocomplete-list li:hover,
.autocomplete-list li.active {
    background: #eff6ff;
}

.autocomplete-list .suggest-meta {
    font-size: 0.7rem;
    color: #64748b;
}

.plan-item-status-dot {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    margin-top: 0.35rem;
}

.plan-item-status-dot.is-pending {
    background: #ffc107;
    color: #fff;
}

.plan-item-status-dot.is-complete {
    background: #198754;
    color: #fff;
}

.plan-item-status-dot.is-cancelled {
    background: #adb5bd;
    color: #fff;
}

.plan-item-row-pending {
    background: rgba(255, 193, 7, 0.05);
}

.plan-item-row-complete {
    background: rgba(25, 135, 84, 0.04);
}

.item-name-status {
    font-size: 0.8rem;
}

.receipt-box {
    max-width: 420px;
    margin: 0 auto;
    background: #fff;
    padding: 24px;
    border: 1px solid #ddd;
}

.receipt-head {
    border-bottom: 1px dashed #dee2e6;
    padding-bottom: 12px;
}

.receipt-shop-name {
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.receipt-shop-address {
    line-height: 1.4;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.share-btn-group .btn { min-width: 110px; }

.buddy-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.buddy-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0d6efd;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1;
}

.account-photo-lg {
    width: 96px;
    height: 96px;
    font-size: 2rem;
}

.account-photo-wrap {
    width: 96px;
    height: 96px;
}

.notif-list-scroll {
    max-height: 320px;
    overflow-y: auto;
}

.notif-dropdown {
    min-width: 280px;
    max-width: min(360px, calc(100vw - 1rem));
}

.notif-dropdown .notif-item {
    white-space: normal;
    border-bottom: 1px solid #f1f5f9;
}

.reminder-col-status {
    width: 1%;
    white-space: nowrap;
}

.reminder-col-actions {
    width: 5.5rem;
}

.reminder-status-select {
    min-width: 6.25rem;
    width: auto;
    max-width: 7rem;
    font-size: 0.8125rem;
    padding-right: 1.6rem;
}

.reminder-title {
    font-size: 0.8125rem;
    line-height: 1.35;
    word-break: break-word;
}

.btn-icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    line-height: 1;
}

.plan-na-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background-color: #7c3aed;
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

.plan-items-table .plan-item-select,
.plan-items-table .plan-item-name {
    min-width: 12rem;
}

.plan-items-table .plan-col-qty,
.plan-items-table .plan-qty-cell,
.plan-items-table .plan-col-weight,
.plan-items-table .plan-weight-cell {
    width: 1%;
    white-space: nowrap;
}

.plan-items-table .plan-qty,
.plan-items-table .plan-weight {
    width: 5.25rem;
    max-width: 5.25rem;
    min-width: 0;
}

.plan-items-table .plan-col-actions,
.plan-items-table .plan-row-actions {
    width: 2.5rem;
    text-align: center;
}

.plan-items-wrap {
    overflow-x: auto;
}

@media (max-width: 767.98px) {
    .plan-items-wrap {
        overflow-x: visible;
    }

    .plan-items-table thead {
        display: none;
    }

    .plan-items-table .plan-items-row {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.35rem 0.4rem;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        padding: 0.45rem 0.5rem;
        margin-bottom: 0.45rem;
        background: #fff;
    }

    .plan-items-table .plan-item-cell {
        display: contents;
    }

    .plan-items-table .plan-items-row td {
        display: block;
        width: auto !important;
        border: 0;
        padding: 0;
    }

    .plan-items-table .plan-items-row td + td {
        margin-top: 0;
    }

    .plan-items-table .plan-items-row td::before {
        display: none !important;
    }

    .plan-items-table .plan-item-top {
        order: 1;
        flex: 1 1 calc(100% - 2.25rem);
        min-width: 0;
        gap: 0.35rem !important;
    }

    .plan-items-table .plan-row-actions {
        order: 2;
        flex: 0 0 auto;
        align-self: flex-start;
    }

    .plan-items-table .plan-row-actions .btn-remove-row {
        padding: 0.1rem 0.45rem;
        line-height: 1.2;
    }

    .plan-items-table .plan-new-item-meta {
        order: 3;
        flex: 0 0 70%;
        max-width: 70%;
        min-width: 0;
    }

    .plan-items-table .plan-new-item-meta .plan-item-category {
        width: 100%;
        font-size: 0.875rem;
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }

    .plan-items-table .plan-qty-cell,
    .plan-items-table .plan-weight-cell {
        order: 4;
        flex: 0 0 30%;
        max-width: 30%;
        min-width: 0;
    }

    .plan-items-table .plan-items-row:not(:has(.plan-new-item-meta:not(.d-none))) .plan-qty-cell,
    .plan-items-table .plan-items-row:not(:has(.plan-new-item-meta:not(.d-none))) .plan-weight-cell {
        margin-left: auto;
    }

    .plan-items-table .plan-item-name {
        width: 100%;
        max-width: none;
        min-width: 0;
        font-size: 0.875rem;
    }

    .plan-items-table .plan-item-select,
    .plan-items-table .plan-qty,
    .plan-items-table .plan-weight {
        width: 100%;
        max-width: none;
        min-width: 0;
        font-size: 0.875rem;
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }
}

.buddy-status-badge {
    font-size: 0.7rem;
}

.buddy-stat-card {
    flex: 1;
    min-width: 8rem;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
}

.buddy-invoice-wrap {
    overflow-x: auto;
}

.buddy-invoice-btns {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
    align-items: center;
}

.buddy-invoice-cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.buddy-inv-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.75rem;
    background: #fff;
}

.buddy-inv-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.buddy-inv-card-actions .btn-pay-invoice {
    width: 100%;
    font-weight: 600;
    padding: 0.55rem 1rem;
}

.buddy-inv-card-actions .btn-cancel-invoice {
    width: 100%;
}

.receipt-row-returned,
.bill-row-returned {
    opacity: 0.85;
}

.receipt-row-returned td {
    text-decoration: line-through;
    text-decoration-color: rgba(0, 0, 0, 0.25);
}

.receipt-row-returned .badge {
    text-decoration: none;
}

@media print {
    body * {
        visibility: hidden;
    }
    .receipt-box, .receipt-box * {
        visibility: visible;
    }
    .receipt-box {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: none;
    }
    .no-print {
        display: none !important;
    }
}
