/* POS System Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.pos-navbar .btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.55);
    color: #ffffff;
}

.pos-navbar .header-sep {
    margin: 0 6px;
}

.tab-content {
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    padding: 20px;
    min-height: 600px;
}

.bill-item {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
}

.product-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-details {
    flex-grow: 1;
    margin-left: 15px;
}

.discount-section {
    background: #e9ecef;
    padding: 15px;
    border-radius: 0.375rem;
    margin: 15px 0;
}

.payment-section {
    background: #d1ecf1;
    padding: 15px;
    border-radius: 0.375rem;
    margin: 15px 0;
}

.total-section {
    background: #d4edda;
    padding: 15px;
    border-radius: 0.375rem;
    margin: 15px 0;
    font-size: 1.2em;
    font-weight: bold;
}

.barcode-input {
    font-family: 'Courier New', monospace;
}

.purchase-item {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.remove-item {
    margin-top: 32px;
}

.customer-info {
    background: #fff3cd;
    padding: 10px;
    border-radius: 0.375rem;
    margin-bottom: 15px;
}

.btn-scan {
    background: linear-gradient(45deg, #28a745, #20c997);
    border: none;
    color: white;
}

.btn-scan:hover {
    background: linear-gradient(45deg, #218838, #1aa085);
    color: white;
}

.search-result-item {
    cursor: pointer;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin-bottom: 5px;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.barcode-scan-view,
#posScannerView {
    width: 100%;
    min-height: 280px;
}

.close-tab {
    margin-left: 10px;
    border: none;
    background: none;
    color: #6c757d;
    font-size: 1.2em;
    cursor: pointer;
}

.close-tab:hover {
    color: #dc3545;
}

/* Purchase modal enhancements */
#purchaseModal .modal-dialog {
    margin: 0;
    max-width: 100%;
    width: 100%;
    height: 100%;
}

#purchaseModal .modal-content {
    border-radius: 0;
    overflow: hidden;
    height: 100%;
}

#purchaseModal .modal-header {
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    color: #ffffff;
}

#purchaseModal .modal-header .btn-close {
    filter: invert(1);
}

#purchaseModal .modal-body {
    background:
        repeating-linear-gradient(
            0deg,
            rgba(15, 23, 42, 0.04),
            rgba(15, 23, 42, 0.04) 1px,
            transparent 1px,
            transparent 36px
        ),
        #f6f8fb;
    overflow-y: auto;
}

#purchaseModal .modal-footer {
    background: #f1f3f6;
}

#purchaseModal h6 {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
}

#purchaseModal .purchase-sheet-header {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    background: #eef2f7;
    border: 1px solid #dfe7f1;
    border-radius: 0.6rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5c6b7a;
    margin-bottom: 10px;
    position: sticky;
    top: 0;
    z-index: 2;
}

#purchaseModal .purchase-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

#purchaseModal .purchase-item .purchase-col {
    display: flex;
    flex-direction: column;
    flex: 1 1 140px;
    min-width: 130px;
}

#purchaseModal .purchase-sheet-header .purchase-col {
    display: flex;
    align-items: center;
}

#purchaseModal .purchase-sheet-header .col-remove {
    justify-content: center;
}

/* Dashboard styles */
.dashboard-wrapper {
    padding-bottom: 30px;
}

.dashboard-card {
    background: #ffffff;
    border: 1px solid #e1e7ef;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.dashboard-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f3f6fb;
    border-bottom: 1px solid #e1e7ef;
    font-weight: 600;
    color: #1f2a37;
}

.dashboard-card-body {
    padding: 16px;
}

.kpi-card {
    padding: 16px 18px;
    min-height: 120px;
}

.kpi-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
}

.kpi-sub {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 4px;
}

.chart-box {
    height: 320px;
}

.chart-box canvas {
    max-height: 100%;
}

.table-box {
    max-height: 360px;
}

.table-box .table-responsive {
    max-height: 320px;
}

.table-box table thead th {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 1;
}

.badge-status {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
}

.badge-status.active {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-status.cancelled {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-mini {
    padding: 4px 10px;
    font-size: 0.75rem;
}

#purchaseModal .col-barcode {
    flex: 1 1 170px;
    min-width: 150px;
}

#purchaseModal .col-name {
    flex: 2 1 260px;
    min-width: 210px;
}

#purchaseModal .col-category {
    flex: 1.4 1 220px;
    min-width: 180px;
}

#purchaseModal .col-rate {
    flex: 1 1 150px;
    min-width: 130px;
}

#purchaseModal .col-qty {
    flex: 0.9 1 140px;
    min-width: 120px;
}

#purchaseModal .col-gst {
    flex: 0.9 1 140px;
    min-width: 120px;
}

#purchaseModal .col-mrp {
    flex: 1 1 170px;
    min-width: 150px;
}

#purchaseModal .col-remove {
    flex: 0 0 72px;
    min-width: 72px;
    display: flex;
    justify-content: flex-end;
}

#purchaseModal .purchase-item .form-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    margin-bottom: 4px;
}

#purchaseModal .purchase-item .form-control {
    border-color: #d9e1ea;
}

#purchaseModal .purchase-item .form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

#purchaseModal .remove-item {
    margin-top: 0;
    width: 100%;
}

#purchaseModal .barcode-input {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.02em;
}
