/* InVin base styles — extracted from index.html */
* {
    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%);
    min-height: 100vh;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

body.app-shell-enabled {
    background: var(--app-bg, #eef4f8) !important;
    color: var(--app-text, #0c1929) !important;
}

/* Prevent text selection on buttons for better mobile UX */
.btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

body.app-shell-enabled .header {
    color: var(--app-text, #0c1929);
}

body.app-shell-enabled .header h1,
body.app-shell-enabled .header p {
    text-shadow: none;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.aws-status {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    color: white;
}

.aws-status.connected {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid #4CAF50;
}

.aws-status.error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid #f44336;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .header p {
        font-size: 1rem;
    }

    .main-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .card {
        padding: 20px;
        margin-bottom: 15px;
    }

    .card h2 {
        font-size: 1.3rem;
    }

    .btn {
        width: 100%;
        margin: 5px 0;
        padding: 15px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .form-group input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 15px;
    }

    .inventory-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .inventory-stats .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .inventory-stats .stat-card {
        padding: 15px !important;
    }
    
    .inventory-stats .stat-value {
        font-size: 1.5rem !important;
    }
    
    .inventory-stats h3 {
        font-size: 1.2rem !important;
    }
    
    .inventory-filter-controls {
        flex-direction: column !important;
    }
    
    .inventory-filter-controls .filter-group {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    .inventory-filter-controls .filter-group button {
        width: 100% !important;
    }

    .inventory-item {
        padding: 12px;
    }

    /* Admin section mobile optimization */
    .admin-section {
        padding: 15px;
    }

    .admin-tabs {
        flex-direction: column;
        gap: 5px;
    }

    .tab-btn {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }

    .admin-section-card {
        padding: 15px;
    }

    /* Data tables mobile optimization */
    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 4px;
    }

    /* Sales form mobile optimization */
    .sales-form {
        padding: 15px;
    }

    .sales-form .form-row {
        flex-direction: column;
        gap: 10px;
    }

    /* Quick actions mobile optimization */
    .quick-actions {
        flex-direction: column;
        gap: 10px;
    }

    .quick-actions .btn {
        width: 100%;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .container {
        padding: 5px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .card {
        padding: 15px;
    }

    .card h2 {
        font-size: 1.2rem;
    }

    .btn {
        padding: 12px;
        font-size: 14px;
    }

    .form-group input {
        padding: 12px;
        font-size: 16px;
    }

    .data-table {
        font-size: 11px;
    }

    .data-table th,
    .data-table td {
        padding: 6px 2px;
    }

    /* Hide less important columns on very small screens */
    .data-table th:nth-child(4),
    .data-table td:nth-child(4),
    .data-table th:nth-child(5),
    .data-table td:nth-child(5) {
        display: none;
    }
}

/* Tablet optimization */
@media (min-width: 769px) and (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .card {
        padding: 20px;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .header h1 {
        font-size: 1.4rem;
    }

    .main-content {
        grid-template-columns: 1fr 1fr;
    }

    .admin-tabs {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .tab-btn {
        width: auto;
        flex: 1;
    }
}

.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.card h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.status-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.inventory-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    transition: transform 0.2s ease;
}

.inventory-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.item-details {
    color: #666;
    font-size: 0.9rem;
}

.item-actions {
    margin-top: 15px;
    text-align: right;
}

.item-actions .btn {
    margin-left: 10px;
}

/* Edit Modal Styles */
.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.edit-modal-content {
    background: white;
    border-radius: 10px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.edit-modal-header h3 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #333;
}

.edit-modal-body {
    margin-bottom: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.admin-section {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

.admin-section h2 {
    color: white;
    border-bottom-color: rgba(255,255,255,0.3);
}

.admin-section .btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
}

.admin-section .btn:hover {
    background: rgba(255,255,255,0.3);
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

.user-welcome {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
    color: white;
}

/* New styles for admin dashboard */
.admin-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.tab-btn {
    flex: 1;
    padding: 10px 15px;
    background: #f0f0f0;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
    text-align: center;
}

.tab-btn:hover {
    background: #e0e0e0;
}

.tab-btn.active {
    background: #667eea;
    color: white;
    border-bottom-color: #667eea;
}

.admin-tab-content {
    display: none; /* Hidden by default */
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.admin-tab-content.active {
    display: block; /* Show when active */
}

.admin-section-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Override admin section button styling for cards */
.admin-section-card .btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    opacity: 1 !important;
    display: inline-block !important;
    visibility: visible !important;
}

.admin-section-card .btn.btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%) !important;
}

.admin-section-card .btn.btn-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
}

.admin-section-card .btn.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
}

/* Table Controls */
.table-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.table-controls input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.table-controls select {
    min-width: 150px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* Pending Item Review Form */
.pending-item-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.pending-item-details .form-row {
    margin-bottom: 15px;
}

.pending-item-details .form-group {
    margin-bottom: 10px;
}

.pending-item-details input[readonly] {
    background-color: #e9ecef;
    color: #6c757d;
}

/* Full Width Form Group */
.form-group.full-width {
    width: 100%;
}

.form-group.full-width textarea {
    width: 100%;
    resize: vertical;
    min-height: 80px;
}

/* Barcode input group styling */
.barcode-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.barcode-input-group input {
    flex: 1;
    margin-right: 0;
}

.barcode-input-group .scan-btn {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 14px;
    white-space: nowrap;
}

/* Auto-populated Field Styles */
.auto-populated {
    transition: all 0.3s ease;
}

.auto-populated-indicator {
    display: inline-block;
    margin-left: 5px;
    font-weight: bold;
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Form field highlighting for auto-populated fields */
.form-group input.auto-populated,
.form-group select.auto-populated,
.form-group textarea.auto-populated {
    background-color: #e8f5e8 !important;
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.status-badge.status-active {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Small Buttons */
.btn.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-height: auto;
}

/* Ensure all buttons are visible */
.btn {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1;
    min-height: 44px; /* Minimum touch target size */
    touch-action: manipulation; /* Optimize for touch */
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.45 !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

.btn.hidden,
button.hidden {
    display: none !important;
}

/* Mobile touch optimizations */
@media (max-width: 768px) {
    /* Ensure minimum touch target size */
    .btn, button, input[type="button"], input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Improve form usability on mobile */
    input, select, textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
        -webkit-appearance: none; /* Remove default styling */
        border-radius: 8px;
    }

    /* Better spacing for mobile forms */
    .form-group {
        margin-bottom: 15px;
    }

    .form-group label {
        margin-bottom: 5px;
        font-size: 14px;
    }

    /* Improve table readability on mobile */
    .data-table {
        border-collapse: collapse;
        width: 100%;
        overflow-x: auto;
        display: block;
    }

    .data-table thead,
    .data-table tbody {
        display: block;
    }

    .data-table tr {
        display: flex;
        flex-wrap: wrap;
        border-bottom: 1px solid #ddd;
        padding: 8px 0;
    }

    .data-table th,
    .data-table td {
        flex: 1;
        min-width: 80px;
        text-align: left;
        padding: 4px;
        word-wrap: break-word;
    }

    /* Stack form rows on mobile */
    .form-row {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .form-row > * {
        width: 100% !important;
    }

    /* Improve admin section layout */
    .admin-section-card {
        margin-bottom: 15px;
    }

            /* Better modal handling on mobile */
.modal-mobile {
    padding: 10px;
}

.modal-content-mobile {
    margin: 10px;
    max-width: calc(100vw - 20px);
}

/* Barcode Scanner Styles */
.barcode-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10000 !important;
    position: fixed !important;
}

/* CRITICAL: Override any parent container styles that might hide the modal */
#scannerModal.show,
#scannerModal.scanner-modal.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10000 !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0,0,0,0.8) !important;
}

/* Ensure modal content is visible when modal is shown */
.modal.show .modal-content {
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto;
    margin: 0 auto;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 0;
    max-width: 90vw;
    width: auto;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.modal-body {
    padding: 20px;
    /* Ensure content is scrollable on mobile if needed */
    overflow-y: auto;
    max-height: calc(90vh - 120px); /* Account for header */
}

/* Desktop-specific modal styles */
@media (min-width: 769px) {
    .modal-content {
        max-width: 600px;
        width: 600px;
    }
    
    .scanner-modal .modal-content {
        max-width: 800px;
        width: 800px;
    }
    
    .modal-body {
        padding: 30px;
    }
}

/* Large desktop screens */
@media (min-width: 1025px) {
    .modal-content {
        max-width: 700px;
        width: 700px;
    }
    
    .scanner-modal .modal-content {
        max-width: 900px;
        width: 900px;
    }
}

.scanner-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 20px;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    /* Ensure container doesn't take up too much space */
    max-height: 60vh;
}

#scannerVideo {
    width: 100%;
    height: auto;
    display: block;
    /* Ensure video doesn't overflow container */
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    box-sizing: border-box;
    /* Force video to respect container bounds */
    min-width: 0;
    overflow: hidden;
}

#scannerVideo video {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
    box-sizing: border-box !important;
    /* Force video element to respect container bounds - critical for mobile */
    min-width: 0 !important;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scanner-frame {
    width: 200px;
    height: 100px;
    border: 2px solid #00ff00;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,255,0,0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.scanner-instructions {
    color: white;
    background: rgba(0,0,0,0.7);
    padding: 10px 20px;
    border-radius: 20px;
    margin-top: 20px;
    font-size: 14px;
    text-align: center;
}

.scanner-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    /* Ensure controls are always visible */
    position: relative;
    z-index: 10;
    background: white;
    padding: 15px 0;
    margin: 0;
}

.scanner-controls .btn {
    min-width: 120px;
}

/* Mobile Responsive Scanner Styles */
@media (max-width: 768px) {
    .scanner-modal .modal-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 10px;
        border-radius: 10px;
    }

    .scanner-container {
        max-width: 100%;
        margin: 0 auto 15px;
    }

    #scannerVideo {
        max-height: 50vh; /* Limit video height on mobile */
        object-fit: cover;
    }

    .scanner-controls {
        flex-direction: column;
        gap: 8px;
        margin: 15px 0;
    }

    .scanner-controls .btn {
        min-width: 100%;
        padding: 12px 16px;
        font-size: 16px;
        min-height: 48px; /* Ensure touch-friendly button size */
    }

    .scanner-info {
        margin-top: 10px;
        padding: 12px;
    }

    .scanner-info p {
        font-size: 11px;
        margin: 3px 0;
    }

    .scanner-frame {
        width: 150px;
        height: 75px;
    }

    .scanner-instructions {
        font-size: 12px;
        padding: 8px 16px;
        margin-top: 15px;
    }

    .scanner-modal .modal-header {
        padding: 15px;
    }

    .scanner-modal .modal-header h3 {
        font-size: 1.1rem;
    }

    .scanner-modal .modal-body {
        padding: 15px;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .scanner-modal .modal-content {
        max-width: 98vw;
        max-height: 98vh;
        margin: 5px;
    }

    #scannerVideo {
        max-height: 40vh;
    }

    .scanner-controls .btn {
        padding: 10px 14px;
        font-size: 14px;
    }

    .scanner-frame {
        width: 120px;
        height: 60px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .scanner-modal .modal-content {
        max-height: 90vh;
    }

    #scannerVideo {
        max-height: 35vh;
    }

    .scanner-controls {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .scanner-controls .btn {
        min-width: auto;
        flex: 1;
        min-width: 120px;
    }
}

.camera-info {
    margin: 10px 0;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.camera-info-text {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.zoom-controls {
    display: flex;
    gap: 8px;
    margin: 10px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.zoom-controls .btn {
    min-width: 80px;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.zoom-controls .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.scanner-info {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    /* Ensure info section is visible */
    position: relative;
    z-index: 5;
}

.scanner-info p {
    margin: 5px 0;
    font-size: 12px;
    color: #666;
}

.scanner-info strong {
    color: #333;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-outline {
    background: transparent;
    border: 1px solid #667eea;
    color: #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

/* Upload QR Code Modal Styles */
.upload-instructions {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #28a745;
}

.upload-instructions p {
    margin: 5px 0;
    font-size: 14px;
    color: #333;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.upload-area.dragover {
    border-color: #28a745;
    background: #f0fff4;
}

.upload-placeholder {
    pointer-events: none;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.upload-hint {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.upload-preview {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.qr-preview-container {
    text-align: center;
    margin-bottom: 20px;
}

#qrPreviewImage {
    max-width: 200px;
    max-height: 200px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.qr-details .form-group {
    margin-bottom: 15px;
}

.upload-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.upload-status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.upload-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.upload-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.upload-status.uploading {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #28a745;
    width: 0%;
    transition: width 0.3s ease;
}



/* Mobile Responsive Upload Styles */
@media (max-width: 768px) {
    .upload-area {
        padding: 30px 15px;
    }

    .upload-actions {
        flex-direction: column;
    }

    .upload-actions .btn {
        width: 100%;
    }

    #qrPreviewImage {
        max-width: 150px;
        max-height: 150px;
    }
}

/* Item Details Modal Styles */
.item-details-form {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}

.item-details-form .form-group {
    margin-bottom: 15px;
}

.item-details-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.item-details-form input,
.item-details-form select,
.item-details-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: white;
}

.item-details-form input:focus,
.item-details-form select:focus,
.item-details-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.item-details-form input[readonly] {
    background-color: #f8f9fa;
    color: #666;
    cursor: not-allowed;
}

.item-details-form textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.modal-actions .btn {
    min-width: 120px;
}

/* Category dropdown styling */
#itemSport,
#masterItemSport,
#reviewItemSport {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Mobile scanner optimizations */
@media (max-width: 768px) {
    .scanner-modal .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .scanner-container {
        max-width: 100%;
    }

    .scanner-frame {
        width: 150px;
        height: 75px;
    }

    .scanner-controls {
        flex-direction: column;
    }

    .scanner-controls .btn {
        width: 100%;
    }

    .barcode-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .barcode-input-group input {
        margin-bottom: 10px;
    }

    .barcode-input-group .btn {
        width: 100%;
        margin-left: 0 !important;
    }

    /* Mobile item details modal */
    .item-details-form {
        max-height: 50vh;
        padding-right: 5px;
    }

    .modal-actions {
        flex-direction: column;
        gap: 10px;
    }

    .modal-actions .btn {
        width: 100%;
        min-width: auto;
    }

    .item-details-form input,
    .item-details-form select,
    .item-details-form textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 15px;
    }
}
}

/* Ensure form rows display properly */
.form-row {
    display: flex !important;
    gap: 15px !important;
    margin-bottom: 15px !important;
    flex-wrap: wrap !important;
}

/* Ensure admin section is properly styled */
.admin-section {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%) !important;
    color: white !important;
    border-radius: 10px !important;
    padding: 20px !important;
    margin: 20px 0 !important;
}

/* Ensure admin section cards are visible */
.admin-section-card {
    background: #fff !important;
    border-radius: 10px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    display: block !important;
    visibility: visible !important;
}

/* Mobile-optimized admin tabs */
@media (max-width: 768px) {
    .admin-tabs {
        display: flex;
        flex-direction: column;
        gap: 5px;
        margin-bottom: 15px;
    }

    .tab-btn {
        width: 100%;
        padding: 12px 15px;
        font-size: 14px;
        text-align: center;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.2);
        color: white;
        border: 1px solid rgba(255, 255, 255, 0.3);
        transition: all 0.3s ease;
    }

    .tab-btn.active {
        background: rgba(255, 255, 255, 0.9);
        color: #333;
        font-weight: bold;
    }

    .tab-btn:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    /* Improve admin tab content layout */
    .admin-tab-content {
        padding: 15px 0;
    }

    .admin-tab-content h3 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.stat-card h4 {
    margin-top: 0;
    color: #667eea;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.stat-card p {
    margin: 8px 0;
    color: #666;
}

.stat-card strong {
    color: #333;
}

.admin-section-card h4 {
    color: #667eea;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.admin-tab-content h3 {
    color: #333;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 3px solid #667eea;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group.form-group-inline {
    display: inline-block;
    margin-bottom: 0;
}

.data-table-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th, .data-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.data-table td {
    color: #333 !important;
    font-weight: 500;
    background-color: #ffffff;
}

.data-table tr:nth-child(even) td {
    background-color: #fafafa;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background-color: #f0f0f0;
}

.data-table tr:hover td {
    background-color: #f0f0f0 !important;
}

.stat-card {
    background: #f0f0f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 0.9rem;
    color: #555;
}

.activity-chart {
    height: 250px; /* Adjust as needed */
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #555;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 15px;
    }

    .data-table {
        font-size: 14px;
    }

    .data-table th, .data-table td {
        padding: 8px 6px;
    }

    .data-table td {
        color: #333 !important;
        font-weight: 500;
    }
}

/* POS - Point of Sale Styles */
.barcode-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.barcode-input-group input {
    flex: 1;
}

/* Desktop-specific styling for POS barcode input */
#saleBarcode {
font-size: 16px;
padding: 12px 15px;
border: 2px solid #ddd;
border-radius: 6px;
background-color: #fff;
color: #333;
min-height: 44px;
}

#saleBarcode:focus {
outline: none;
border-color: #007bff;
box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#saleBarcode::placeholder {
color: #999;
font-size: 15px;
}

.barcode-scanner-container {
    margin-top: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    /* Mobile-optimized container */
    width: 100%;
    max-width: 100%;
    position: relative;
}

.barcode-scanner-container video {
    width: 100%;
    height: auto;
    max-width: 100%;
    /* Ensure video scales properly on all devices */
    object-fit: cover;
    display: block;
}

 /* POS-specific scanner container - uses same styles as main scanner */
/* POS Scanner Container - constrained to parent card */
#salesSection #saleBarcodeScannerContainer {
position: relative;
    width: 100%;
 max-width: 100%;
 margin: 0 auto 20px;
 border-radius: 10px;
 overflow: hidden;
 background: #000;
 max-height: 60vh;
 /* Ensure container doesn't overflow on mobile */
 box-sizing: border-box;
}

/* Also target without parent for flexibility */
#saleBarcodeScannerContainer {
position: relative;
    width: 100%;
    max-width: 100%;
 margin: 0 auto 20px;
 border-radius: 10px;
 overflow: hidden;
 background: #000;
 max-height: 60vh;
 /* Ensure container doesn't overflow on mobile */
 box-sizing: border-box;
}

#saleBarcodeScanner {
    width: 100%;
    height: auto;
 display: block;
 max-height: 100%;
 max-width: 100%;
 object-fit: contain;
 }

#saleBarcodeScanner video {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
    box-sizing: border-box !important;
    /* Force video to respect container bounds */
    min-width: 0 !important;
    max-height: 100% !important;
}

/* Ensure POS section constrains scanner */
#salesSection {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent horizontal overflow */
    position: relative;
}

#salesSection .form-group {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden; /* Prevent horizontal overflow */
    padding-left: 0;
    padding-right: 0;
}

/* Ensure scanner container doesn't overflow parent */
#salesSection #saleBarcodeScannerContainer {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    position: relative !important;
    /* Force container to respect viewport */
    min-width: 0 !important;
}

/* Ensure the inner scanner div also respects bounds */
#saleBarcodeScanner {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    min-width: 0 !important;
}
 
 /* POS scanner overlay (same as main scanner) */
 #saleBarcodeScannerContainer .scanner-overlay {
 position: absolute;
 top: 0;
 left: 0;
 right: 0;
 bottom: 0;
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 pointer-events: none;
 }
 
 #saleBarcodeScannerContainer .scanner-frame {
 width: 200px;
 height: 100px;
 border: 2px solid #00ff00;
 border-radius: 10px;
 box-shadow: 0 0 20px rgba(0,255,0,0.5);
 animation: pulse 2s infinite;
 }
 
 #saleBarcodeScannerContainer .scanner-instructions {
 color: white;
 background: rgba(0,0,0,0.7);
 padding: 10px 20px;
 border-radius: 20px;
 margin-top: 20px;
 font-size: 14px;
 text-align: center;
 }
 
 /* POS scanner controls */
 #posScannerControls {
 display: flex;
 gap: 10px;
 justify-content: center;
 flex-wrap: wrap;
 position: relative;
 z-index: 10;
 background: white;
 padding: 15px 0;
 margin: 15px 0 0 0;
 border-radius: 8px;
 }
 
 #posScannerControls .btn {
 min-width: 120px;
 }
 
 #posCameraInfo {
 margin: 10px 0;
 padding: 10px;
 background: #f8f9fa;
 border-radius: 8px;
 }
 
 #posZoomControls {
 display: flex;
 gap: 10px;
 justify-content: center;
 flex-wrap: wrap;
 margin: 10px 0;
 }
 
 #posScannerInfo {
 margin-top: 10px;
 padding: 12px;
 background: #f8f9fa;
 border-radius: 8px;
 }
 
 #posScannerInfo p {
 font-size: 12px;
 margin: 5px 0;
 }

 /* Mobile responsive styles for POS scanner */
 @media (max-width: 768px) {
 /* Ensure card and form-group don't cause overflow */
 #salesSection.card {
 padding-left: 10px;
 padding-right: 10px;
 }
 
 #salesSection .form-group {
 padding-left: 0;
 padding-right: 0;
 }
 
 #saleBarcodeScannerContainer {
 max-width: 100%;
 width: 100%;
 margin: 15px auto;
 padding: 0;
 box-sizing: border-box;
 overflow: hidden;
 position: relative;
 min-width: 0;
 }

 #saleBarcodeScanner {
 max-height: 50vh;
 max-width: 100%;
 width: 100%;
 box-sizing: border-box;
 overflow: hidden;
 min-width: 0;
 }

 #saleBarcodeScanner video {
 max-width: 100% !important;
 width: 100% !important;
 height: auto !important;
 box-sizing: border-box !important;
 min-width: 0 !important;
 object-fit: contain !important;
 }

 #posScannerControls {
 flex-direction: column;
 gap: 8px;
 max-width: 95%;
 width: 95%;
 margin-left: auto;
 margin-right: auto;
 box-sizing: border-box;
 }

 #posScannerControls .btn {
 min-width: 100%;
 padding: 12px 16px;
 font-size: 16px;
 min-height: 48px;
 }

 #posCameraInfo {
 max-width: 95%;
 width: 95%;
 margin-left: auto;
 margin-right: auto;
 box-sizing: border-box;
 }

 #posZoomControls {
 max-width: 95%;
 width: 95%;
 margin-left: auto;
 margin-right: auto;
 box-sizing: border-box;
 }

 #posScannerInfo {
 max-width: 95%;
 width: 95%;
 margin-left: auto;
 margin-right: auto;
 box-sizing: border-box;
 }

 #saleBarcodeScannerContainer .scanner-frame {
 width: 150px;
 height: 75px;
 }

 #saleBarcodeScannerContainer .scanner-instructions {
 font-size: 12px;
 padding: 8px 16px;
 }
 }

 @media (max-width: 480px) {
 /* Ensure card and form-group don't cause overflow on small screens */
 #salesSection.card {
 padding-left: 8px;
 padding-right: 8px;
 }
 
 #salesSection .form-group {
 padding-left: 0;
 padding-right: 0;
 }
 
 #saleBarcodeScannerContainer {
 max-width: 100%;
 width: 100%;
 margin: 10px auto;
 padding: 0;
 box-sizing: border-box;
 overflow: hidden;
 position: relative;
 min-width: 0;
 }

 #saleBarcodeScanner {
 max-height: 40vh;
 max-width: 100%;
 width: 100%;
 object-fit: contain;
 display: block;
 box-sizing: border-box;
 overflow: hidden;
 min-width: 0;
 }

 #saleBarcodeScanner video {
 max-width: 100% !important;
 width: 100% !important;
 height: auto !important;
 object-fit: contain !important;
 display: block !important;
 box-sizing: border-box !important;
 min-width: 0 !important;
 }

 #posScannerControls {
 max-width: 92%;
 width: 92%;
 box-sizing: border-box;
 }

 #posCameraInfo {
 max-width: 92%;
 width: 92%;
 box-sizing: border-box;
 }

 #posZoomControls {
 max-width: 92%;
 width: 92%;
 box-sizing: border-box;
 }

 #posScannerInfo {
 max-width: 92%;
 width: 92%;
 box-sizing: border-box;
 }

 #posScannerControls .btn {
 padding: 10px 14px;
 font-size: 14px;
 }

 #saleBarcodeScannerContainer .scanner-frame {
 width: 120px;
 height: 60px;
 }
}

.item-details {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.item-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.item-info {
    padding: 8px;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

.qr-code-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    text-align: center;
}

.qr-code-image {
    margin: 15px 0;
    display: flex;
    justify-content: center;
}

.qr-code-image img {
    max-width: 200px;
    max-height: 200px;
    border: 2px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.qr-code-note {
    color: #6c757d;
    font-style: italic;
    margin-top: 10px;
}

.qr-code-container.show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.cash-note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
    color: #856404;
}

.cash-note p {
    margin: 0;
    font-weight: 500;
}

/* Payment method styling */
#salePaymentMethod {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#salePaymentMethod:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Enhanced POS Styles */
.transaction-items {
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.items-list {
    max-height: 300px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    margin: 10px 0;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.item-details {
    flex: 1;
    margin-right: 15px;
}

.item-name {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.item-info {
    font-size: 14px;
    color: #666;
    margin: 2px 0;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.quantity-control input {
    width: 60px;
    text-align: center;
}

.price-control {
    display: flex;
    align-items: center;
    gap: 5px;
}

.price-control input {
    width: 80px;
    text-align: center;
}

.item-total {
    font-weight: bold;
    color: #28a745;
    font-size: 16px;
    min-width: 80px;
    text-align: right;
}

.remove-item {
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
}

.remove-item:hover {
    background-color: #c82333;
}

.transaction-summary {
    margin: 20px 0;
    padding: 20px;
    background-color: #e8f5e8;
    border-radius: 8px;
    border: 1px solid #c3e6c3;
}

.price-breakdown {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.price-breakdown h5 {
    margin: 0 0 15px 0;
    color: #28a745;
    font-size: 16px;
}

.price-breakdown-list {
    margin-bottom: 15px;
}

.price-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.price-breakdown-item:last-child {
    border-bottom: none;
}

.price-breakdown-item .item-name {
    font-weight: 500;
    color: #495057;
}

.price-breakdown-item .item-price {
    font-weight: bold;
    color: #28a745;
}

.total-display {
    text-align: center;
    padding: 15px;
    background-color: #28a745;
    color: white;
    border-radius: 6px;
    font-size: 18px;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: center;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-item input {
    font-size: 18px;
    font-weight: bold;
    color: #28a745;
    border: 2px solid #28a745;
    border-radius: 4px;
    padding: 8px;
    background-color: white;
}

.pos-actions {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.transaction-history-section {
    margin: 20px 0;
    text-align: center;
}

/* Transaction History Modal Styles */
.filter-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: bold;
    font-size: 14px;
}

.filter-group select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.transactions-list {
    max-height: 400px;
    overflow-y: auto;
}

.transaction-record {
    padding: 15px;
    margin: 10px 0;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.transaction-date {
    font-weight: bold;
    color: #333;
}

.transaction-payment {
    background-color: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    text-transform: capitalize;
}
.source-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: none;
    vertical-align: middle;
}
.source-badge.source-shopify {
    background-color: #95bf47;
    color: #fff;
}

.transaction-amount {
    font-weight: bold;
    color: #28a745;
    font-size: 18px;
}

.transaction-items-list {
    margin-top: 10px;
}

.transaction-item-record {
    padding: 8px;
    margin: 5px 0;
    background-color: white;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

/* Mobile responsive for Transaction History Modal */
@media (max-width: 768px) {
    /* Only show when explicitly opened — do not override .hidden */
    #transactionHistoryModal.show {
        display: flex !important;
        align-items: flex-start;
        justify-content: center;
        padding: 10px;
    }

    #transactionHistoryModal.hidden {
        display: none !important;
    }
    
    #transactionHistoryModal .modal-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 10px;
        width: 100%;
        display: flex;
        flex-direction: column;
    }
    
    #transactionHistoryModal .modal-header {
        padding: 15px;
        flex-shrink: 0;
    }
    
    #transactionHistoryModal .modal-header h3 {
        font-size: 1.1rem;
    }
    
    #transactionHistoryModal .modal-body {
        padding: 15px;
        overflow-y: auto;
        flex: 1;
        min-height: 0;
    }
    
    /* Stack filter controls vertically on mobile */
    .filter-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group select {
        width: 100%;
        padding: 10px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .filter-controls .btn {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        margin: 5px 0;
    }
    
    /* Transaction list mobile styles */
    .transactions-list {
        max-height: calc(95vh - 300px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .transaction-record {
        padding: 12px;
        margin: 8px 0;
    }
    
    .transaction-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .transaction-date {
        font-size: 14px;
    }
    
    .transaction-amount {
        font-size: 16px;
        align-self: flex-end;
    }
    
    .transaction-payment {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .transaction-item-record {
        padding: 10px;
        font-size: 13px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .transaction-items-list {
        font-size: 13px;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    #transactionHistoryModal .modal-content {
        max-width: 98vw;
        max-height: 98vh;
        margin: 5px;
    }
    
    #transactionHistoryModal .modal-header {
        padding: 12px;
    }
    
    #transactionHistoryModal .modal-header h3 {
        font-size: 1rem;
    }
    
    #transactionHistoryModal .modal-body {
        padding: 12px;
    }
    
    .transactions-list {
        max-height: calc(98vh - 280px);
    }
    
    .transaction-record {
        padding: 10px;
    }
    
    .transaction-item-record {
        padding: 8px;
        font-size: 12px;
    }
}

/* Mobile responsive for POS */
@media (max-width: 768px) {
    .barcode-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .barcode-input-group button {
        margin: 5px 0;
    }

    .item-info-grid {
        grid-template-columns: 1fr;
    }

    .qr-code-image img {
        max-width: 150px;
        max-height: 150px;
    }
    
    .transaction-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .item-controls {
        justify-content: center;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .pos-actions {
        flex-direction: column;
    }
    
    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
 /* Mobile-optimized POS scanner - matches main scanner styles */
    #saleBarcodeScannerContainer {
        max-width: 100%;
        width: 100%;
        margin: 15px auto;
        padding: 0;
        box-sizing: border-box;
        overflow: hidden;
    }
    
    #saleBarcodeScanner {
        max-height: 50vh; /* Limit video height on mobile */
        max-width: 100%;
        width: 100%;
        object-fit: contain;
        display: block;
        box-sizing: border-box;
    }
    
    /* Ensure scanner video scales properly on mobile */
    #saleBarcodeScanner video {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: 50vh !important;
        object-fit: contain !important;
        display: block !important;
        box-sizing: border-box !important;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    #saleBarcodeScanner {
        min-height: 200px;
        max-height: 40vh;
    }
    
    #saleBarcodeScanner video {
        max-height: 40vh !important;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    #saleBarcodeScanner {
        min-height: 200px;
        max-height: 60vh;
    }
    
    #saleBarcodeScanner video {
        max-height: 60vh !important;
    }
}

/* Notification Stack System */
.notification-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    pointer-events: none;
}

.notification {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    pointer-events: auto;
    position: relative;
    transform: translateX(100%);
    animation: slideIn 0.3s ease-out forwards;
    max-height: 200px;
    overflow-y: auto;
}

.notification.success {
    border-left-color: #28a745;
    background: #d4edda;
    color: #155724;
}

.notification.error {
    border-left-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
}

.notification.warning {
    border-left-color: #ffc107;
    background: #fff3cd;
    color: #856404;
}

.notification.info {
    border-left-color: #17a2b8;
    background: #d1ecf1;
    color: #0c5460;
}

.notification-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: opacity 0.2s ease;
}

.notification-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.notification-content {
    padding-right: 25px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification.slide-out {
    animation: slideOut 0.3s ease-in forwards;
}

/* User Role Display */
.user-role-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-role-display.basic {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #333;
}

.user-role-display.standard {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.user-role-display.premium {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #333;
}

.user-role-display.admin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Ensure role dropdown is visible */
#editUserRole {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    padding: 12px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    background-color: white !important;
    font-size: 16px !important;
    color: #333 !important;
    margin-bottom: 20px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

#editUserRole:focus {
    outline: none !important;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

/* Make sure the role form group is visible */
#editUserSection .form-group:has(#editUserRole) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-bottom: 20px !important;
}

/* Ensure the role label is visible */
#editUserSection label[for="editUserRole"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #555 !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
}

.inventory-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.inventory-controls .btn {
    flex-shrink: 0;
}

/* Inventory Scanner Modal Styles */
#inventoryScannerModal.scanner-modal.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10000 !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0,0,0,0.8) !important;
}

#inventoryScannerVideo {
    position: relative;
    width: 100%;
    min-height: 300px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

#inventoryScannerVideo video {
    width: 100%;
    height: auto;
    display: block;
}

/* Edit Item Modal Styles */
.edit-item-form {
    max-width: 500px;
    margin: 0 auto;
}

.edit-item-form .form-group {
    margin-bottom: 20px;
}

.edit-item-form .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.edit-item-form .form-control {
    width: 100%;
    padding: 10px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.edit-item-form .form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.edit-item-form .form-control[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.edit-item-form textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.edit-controls .btn {
    min-width: 120px;
    padding: 10px 20px;
    font-weight: 600;
}

.edit-controls .btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    color: white;
}

.edit-controls .btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    transform: translateY(-1px);
}

.edit-controls .btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border: none;
    color: white;
}

.edit-controls .btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-1px);
}

.btn-spinner {
    display: none;
}

.btn-spinner.show {
    display: inline;
}

.btn-text.hidden {
    display: none;
}

.edit-info-text {
    font-style: italic;
}
