* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

#root {
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
}

.app-container {
    display: flex;
    height: 100vh;
    background: #f5f5f5;
    flex-wrap: nowrap;
}

.compact-header {
    flex-shrink: 0;
    min-height: 40px;
}

.sidebar {
    width: 280px;
    background: #2c3e50;
    color: white;
    padding: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    overflow: hidden;
    min-height: 0;
    flex-shrink: 0;
    transition: width 0.2s ease;
}

.sidebar.sidebar-collapsed {
    width: 48px;
    min-width: 48px;
    padding: 8px 4px;
    align-items: center;
    gap: 4px;
}

.sidebar.sidebar-collapsed .sidebar-main-content {
    display: none;
}

.sidebar h1 {
    font-size: 18px;
    margin-bottom: 12px;
    text-align: center;
    color: #ecf0f1;
}

.product-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
}

.product-item {
    background: white;
    padding: 10px;
    border: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-item .product-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 4px;
    color: #2c3e50;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-item .product-category {
    font-size: 11px;
    color: #7f8c8d;
    margin: 2px 0;
}

.product-item .product-price {
    font-size: 16px;
    font-weight: bold;
    color: #2ecc71;
    margin-top: auto;
    padding-top: 6px;
}

.product-item .product-barcode {
    font-size: 9px;
    color: #95a5a6;
    margin-top: 4px;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px;
}

.header {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h2 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 18px;
    margin-top: 0;
}

.search-bar {
    width: 100%;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.3s;
}

.search-bar:focus {
    outline: none;
    border-color: #667eea;
}

/* Right panel: a_material list + order lines with checkboxes (bottom) */
.order-materials-right-panel {
    width: 280px;
    min-width: 260px;
    flex-shrink: 0;
    background: #2c3e50;
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100vh;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.order-materials-right-panel-top {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 12px;
    padding-bottom: 8px;
}

.order-materials-right-panel-title {
    font-size: 15px;
    margin: 0 0 10px 0;
    text-align: center;
    color: #ecf0f1;
    font-weight: 600;
}

.order-materials-right-panel-search {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #34495e;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 8px;
    background: #34495e;
    color: #ecf0f1;
}

.order-materials-right-panel-search::placeholder {
    color: #95a5a6;
}

.order-materials-right-panel-search:focus {
    outline: none;
    border-color: #667eea;
}

.order-materials-right-panel-list {
    flex: 1;
    min-height: 80px;
    overflow-y: auto;
    margin: 0 -4px;
    padding: 0 4px;
}

.order-materials-right-panel-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    margin-bottom: 6px;
    border: none;
    border-radius: 6px;
    background: #34495e;
    color: #ecf0f1;
    cursor: pointer;
    font-size: 12px;
}

.order-materials-right-panel-row:hover {
    background: #3d566e;
}

.order-materials-right-panel-row-name {
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.order-materials-right-panel-row-meta {
    font-size: 10px;
    color: #bdc3c7;
    margin-top: 4px;
}

.order-materials-right-panel-empty {
    padding: 16px;
    text-align: center;
    color: #95a5a6;
    font-size: 13px;
}

.order-materials-right-panel-empty.small {
    padding: 10px;
    font-size: 12px;
}

.order-materials-right-panel-loading-more {
    text-align: center;
    padding: 8px;
    color: #95a5a6;
    font-size: 12px;
}

.order-materials-right-panel-bottom {
    flex-shrink: 0;
    max-height: 36vh;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    background: #1e2b38;
    border-top: 2px solid #34495e;
    padding: 10px 12px 12px;
}

.order-materials-right-panel-bottom-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #bdc3c7;
}

.order-materials-right-panel-selectall {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 11px;
    color: #ecf0f1;
}

.order-materials-right-panel-selectall input {
    cursor: pointer;
}

.order-materials-right-panel-order-list {
    flex: 1;
    min-height: 48px;
    max-height: 22vh;
    overflow-y: auto;
    margin-bottom: 8px;
}

.order-materials-right-panel-order-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-bottom: 1px solid #34495e;
    font-size: 11px;
    cursor: pointer;
    color: #ecf0f1;
}

.order-materials-right-panel-order-line input {
    flex-shrink: 0;
    cursor: pointer;
}

.order-materials-right-panel-order-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-materials-right-panel-order-qty {
    flex-shrink: 0;
    color: #2ecc71;
    font-weight: 600;
}

.order-materials-right-panel-remove-btn {
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    background: #c0392b;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.order-materials-right-panel-remove-btn:hover:not(:disabled) {
    background: #e74c3c;
}

.order-materials-right-panel-remove-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 1100px) {
    .order-materials-right-panel {
        display: none !important;
    }
}

.cart-section {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.cart-header h2 {
    color: #2c3e50;
    font-size: 18px;
    margin: 0;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px;
    background: #f8f9fa;
    margin-bottom: 3px;
    border-radius: 4px;
    border-left: 2px solid #667eea;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 1px;
    font-size: 11px;
    line-height: 1.2;
}

.cart-item-price {
    color: #7f8c8d;
    font-size: 9px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
}

.quantity-btn {
    background: #667eea;
    color: white;
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    padding: 0;
}

.quantity-btn:hover {
    background: #5568d3;
}

.quantity {
    font-weight: bold;
    min-width: 18px;
    text-align: center;
    font-size: 10px;
}

.item-total {
    font-weight: bold;
    color: #2c3e50;
    font-size: 11px;
    min-width: 60px;
    text-align: right;
}

/* Number input spinner controls устгах */
.quantity-input-no-spinner::-webkit-outer-spin-button,
.quantity-input-no-spinner::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.quantity-input-no-spinner {
    -moz-appearance: textfield;
    appearance: textfield;
}

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.3s;
}

.remove-btn:hover {
    background: #c0392b;
}

.cart-footer {
    border-top: 1px solid #e0e0e0;
    padding-top: 12px;
}

.total-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.total-label {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
}

.total-amount {
    font-size: 20px;
    font-weight: bold;
    color: #2ecc71;
}

.checkout-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #2ecc71;
    color: white;
}

.btn-primary:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.empty-cart {
    text-align: center;
    padding: 20px;
    color: #95a5a6;
    font-size: 12px;
}

.empty-cart-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background: white;
}

table th {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
    font-weight: 600;
}

table td {
    padding: 10px;
    border: 1px solid #ddd;
}

table tr:nth-child(even) {
    background: #f8f9fa;
}

table tr:nth-child(odd) {
    background: white;
}

table tr:hover {
    background: #e8f4f8;
}

select {
    transition: border-color 0.3s;
}

select:focus {
    outline: none;
    border-color: #667eea;
}

.client-info-box {
    background: #e8f4f8;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 2px solid #667eea;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 400px;
    max-width: 90%;
}

.login-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.login-input:focus {
    outline: none;
    border-color: #667eea;
}

.login-button {
    width: 100%;
    padding: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.login-button:hover:not(:disabled) {
    background: #5568d3;
}

.login-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* Payment Modal Styles - жижиг дэлгэц дээр ажиллахын тулд өндөр z-index, бүтэн viewport */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    min-width: 100vw;
    min-height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 10px;
    box-sizing: border-box;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    .modal-overlay {
        padding: 8px;
        align-items: center;
    }
    .modal-content {
        max-height: 80vh;
        width: calc(100% - 16px);
    }
}

/* Settings Modal specific styles */
.modal-content[style*="max-width: 600px"] {
    max-width: 600px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #95a5a6;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 14px;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #2c3e50;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.form-select {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
}

/* Form Input Styles */
.form-input {
    width: 100%;
    padding: 6px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    background: #ffffff;
    color: #2c3e50;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #fafbfc;
}

.form-input:hover {
    border-color: #bdc3c7;
}

.form-input::placeholder {
    color: #95a5a6;
    font-style: italic;
}

.form-input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.form-input[type="number"]::-webkit-outer-spin-button,
.form-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-input[type="time"] {
    cursor: pointer;
}

textarea.form-input {
    min-height: 80px;
    resize: vertical;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
}

/* Settings Modal Section Styles */
.settings-section {
    margin-bottom: 12px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.settings-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #667eea;
    display: flex;
    align-items: center;
    gap: 4px;
}

.settings-section-title::before {
    content: '';
    width: 3px;
    height: 16px;
    background: #667eea;
    border-radius: 2px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.settings-form-group {
    margin-bottom: 0;
}

.settings-form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #34495e;
    font-size: 11px;
    letter-spacing: 0.2px;
}

.settings-form-group label span {
    color: #e74c3c;
    margin-left: 2px;
}

.settings-checkbox-group {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.settings-checkbox-group:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.settings-checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
    margin: 0;
}

.settings-checkbox-group label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    color: #2c3e50;
    user-select: none;
}

/* Enhanced Modal Styles */
.modal-content {
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    padding: 18px 20px;
}

.modal-header h2 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    width: 32px;
    height: 32px;
    font-size: 24px;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    background: #ffffff;
}

.modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 16px 20px;
}

.payment-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: #2c3e50;
}

.summary-row.total-row {
    border-top: 2px solid #e0e0e0;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #2ecc71;
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

.modal-footer .btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-footer .btn-secondary {
    background: #95a5a6;
    color: white;
}

.modal-footer .btn-secondary:hover {
    background: #7f8c8d;
}

.modal-footer .btn-primary {
    background: #667eea;
    color: white;
}

.modal-footer .btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading-spinner {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 40px 50px;
    border-radius: 16px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    min-width: 250px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e8edf2;
    border-top: 5px solid #667eea;
    border-right: 5px solid #764ba2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: relative;
}

.spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid transparent;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 0.6s linear infinite reverse;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 15px;
    color: #2c3e50;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
}

.loading-progress {
    width: 100%;
    height: 4px;
    background: #e8edf2;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    animation: progress 1.5s ease-in-out infinite;
}

@keyframes progress {
    0% {
        width: 0%;
        margin-left: 0%;
    }
    50% {
        width: 70%;
        margin-left: 0%;
    }
    100% {
        width: 0%;
        margin-left: 100%;
    }
}

/* ═══════════════════════════════════════════════════════
   BANNER PANEL — Зээлийн бараа / TDS реклам
   ═══════════════════════════════════════════════════════ */

.banner-overlay {
    display: none;
}

.banner-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    z-index: 8000;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.25s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);   opacity: 1; }
}

.banner-header {
    background: linear-gradient(135deg, #c0392b 0%, #922b21 100%);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.tds-logo {
    width: 40px;
    height: 40px;
    background: white;
    color: #c0392b;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.banner-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.banner-product-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
}

.banner-product-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.banner-order-btn {
    flex: 1;
    padding: 7px 12px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.banner-order-btn:hover {
    opacity: 0.88;
}

@media (max-width: 640px) {
    .banner-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 7999;
    }
    .banner-panel {
        width: 90%;
        max-width: 340px;
    }
}

/* ═══════════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION
   ═══════════════════════════════════════════════════════ */

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #2c3e50;
    z-index: 500;
    border-top: 2px solid #1a252f;
}

.mobile-nav-btn {
    flex: 1;
    color: rgba(255, 255, 255, 0.6);
    border: none;
    background: none;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    padding: 0;
    border-top: 3px solid transparent;
    letter-spacing: 0.3px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-btn.active {
    color: white;
    border-top-color: #667eea;
    background: rgba(102, 126, 234, 0.15);
}

.mobile-nav-btn-icon {
    font-size: 22px;
    line-height: 1;
}

.mobile-nav-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 22px);
    background: #e74c3c;
    color: white;
    border-radius: 10px;
    font-size: 9px;
    font-weight: bold;
    padding: 1px 5px;
    min-width: 16px;
    text-align: center;
    line-height: 14px;
    height: 14px;
}

/* ═══════════════════════════════════════════════════════
   MOBILE RESPONSIVE — max-width: 640px
   ═══════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    /* Show bottom navigation */
    .mobile-bottom-nav {
        display: flex;
    }

    /* App container: pad for bottom nav */
    .app-container {
        padding-bottom: 56px;
    }

    /* Sidebar: full width, full height */
    .sidebar {
        width: 100% !important;
        min-width: 0 !important;
        height: calc(100vh - 56px);
        flex-shrink: unset;
        transition: none;
        border-radius: 0;
    }

    .sidebar.sidebar-collapsed {
        display: none !important;
    }

    /* Product grid: 3 columns on phone */
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
        padding: 6px !important;
    }

    .product-item {
        padding: 8px !important;
    }

    .product-item .product-name {
        font-size: 12px !important;
    }

    .product-item .product-price {
        font-size: 13px !important;
    }

    .product-item .product-barcode {
        display: none;
    }

    /* Cart: full width, scroll */
    .cart-section {
        border-radius: 6px;
        height: calc(100vh - 56px - 24px);
    }

    /* Touch-friendly cart items */
    .cart-item {
        padding: 10px !important;
        margin-bottom: 6px !important;
    }

    .cart-item-name {
        font-size: 14px !important;
    }

    .cart-item-price {
        font-size: 12px !important;
    }

    .item-total {
        font-size: 14px !important;
        min-width: 72px;
    }

    /* Bigger touch targets */
    .quantity-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
        border-radius: 6px !important;
    }

    .quantity {
        font-size: 15px !important;
        min-width: 28px !important;
    }

    .quantity-control {
        padding: 4px 6px !important;
        gap: 6px !important;
    }

    .remove-btn {
        padding: 8px 12px !important;
        font-size: 13px !important;
        min-height: 36px;
    }

    .btn {
        padding: 14px !important;
        font-size: 15px !important;
        min-height: 48px;
    }

    .total-amount {
        font-size: 22px !important;
    }

    .total-label {
        font-size: 15px !important;
    }

    /* Prevent iOS zoom on input focus (must be 16px+) */
    input[type="text"],
    input[type="number"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Login box */
    .login-box {
        width: 95% !important;
        padding: 24px !important;
    }

    .login-input,
    .login-button {
        font-size: 16px !important;
    }

    .login-button {
        padding: 14px !important;
    }

    /* Modals: bottom-sheet style */
    .modal-overlay {
        padding: 0 !important;
        align-items: flex-end !important;
    }

    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh !important;
        border-radius: 16px 16px 0 0 !important;
    }

    .modal-header {
        padding: 14px 16px !important;
    }

    .modal-header h2 {
        font-size: 16px !important;
    }

    .modal-body {
        padding: 14px 16px !important;
    }

    .modal-footer {
        padding: 12px 16px !important;
        gap: 8px !important;
    }

    /* Settings grid: 1 column on phone */
    .settings-grid {
        grid-template-columns: 1fr !important;
    }

    /* Scrollbar thinner on mobile */
    ::-webkit-scrollbar {
        width: 3px;
    }
}

/* Print styles - prevent page breaks inside receipt items */
@media print {
    * {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .receipt-group,
    .receipt-item,
    .receipt-summary {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    /* Allow page breaks between receipt groups if needed */
    .receipt-group {
        page-break-after: auto;
        break-after: auto;
    }
    
    /* Prevent orphaned items */
    .receipt-item {
        page-break-after: avoid;
        break-after: avoid;
    }
}
