/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --sidebar-bg: #1e293b;
    --sidebar-text: #f8fafc;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-danger: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition-normal);
    animation: fadeInLeft 0.5s ease;
}

.logo {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInDown 0.6s ease;
}

.logo i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-right: 10px;
    animation: pulse 2s infinite;
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

.nav-menu {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 14px 24px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all var(--transition-normal);
    border-left: 3px solid transparent;
    position: relative;
    overflow: hidden;
    animation: fadeInRight 0.4s ease backwards;
}

.nav-item:nth-child(1) { animation-delay: 0.1s; }
.nav-item:nth-child(2) { animation-delay: 0.2s; }
.nav-item:nth-child(3) { animation-delay: 0.3s; }

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: rgba(37, 99, 235, 0.2);
    transition: width var(--transition-normal);
    z-index: -1;
}

.nav-item:hover::before {
    width: 100%;
}

.nav-item i {
    font-size: 1.2rem;
    margin-right: 12px;
    width: 24px;
    text-align: center;
    transition: transform var(--transition-normal);
}

.nav-item:hover i {
    transform: scale(1.2);
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.2);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-item.active i {
    animation: bounce 1s infinite;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    animation: fadeIn 0.8s ease;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.mobile-menu-toggle.active {
    background: var(--danger-color);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    opacity: 1;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px;
    min-height: 100vh;
    animation: fadeIn 0.5s ease;
}

/* Page */
.page {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.page.active {
    display: block;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
    animation: fadeInDown 0.5s ease;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h2 i {
    color: var(--primary-color);
    animation: pulse 2s infinite;
}

.date-time {
    font-size: 0.95rem;
    color: var(--text-secondary);
    background: var(--card-bg);
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.6s ease;
}

/* Card */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    transition: all var(--transition-normal);
    animation: fadeInUp 0.5s ease backwards;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    position: relative;
}

.card h3::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
    animation: fadeInUp 0.4s ease backwards;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.15s; }
.form-group:nth-child(3) { animation-delay: 0.2s; }

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all var(--transition-normal);
    background: var(--card-bg);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.form-group input[readonly] {
    background: var(--background);
    cursor: not-allowed;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5);
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
}

/* Billing Container */
.billing-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-template-rows: auto auto;
    gap: 24px;
}

.billing-form-section {
    grid-column: 1;
    grid-row: 1;
}

.bill-items-section {
    grid-column: 2;
    grid-row: 1 / 3;
}

.bill-summary-section {
    grid-column: 1;
    grid-row: 2;
}

/* Product Selection Grid */
.product-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.product-select-card {
    background: var(--background);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    animation: scaleIn 0.3s ease backwards;
}

.product-select-card:nth-child(1) { animation-delay: 0.05s; }
.product-select-card:nth-child(2) { animation-delay: 0.1s; }
.product-select-card:nth-child(3) { animation-delay: 0.15s; }
.product-select-card:nth-child(4) { animation-delay: 0.2s; }
.product-select-card:nth-child(5) { animation-delay: 0.25s; }
.product-select-card:nth-child(6) { animation-delay: 0.3s; }

.product-select-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.product-select-card.selected {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.product-select-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.product-select-card .product-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-select-card .check-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    animation: scaleIn 0.3s ease;
}

.product-select-card.selected .check-icon {
    display: flex;
}

.selected-product-display {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 10px;
    margin-bottom: 16px;
    animation: fadeInUp 0.3s ease;
}

.selected-product-display.active {
    display: flex;
}

.selected-product-display img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.selected-product-display .product-details {
    flex: 1;
}

.selected-product-display .product-details h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.selected-product-display .product-details button {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
}

.selected-product-display .product-details button:hover {
    text-decoration: underline;
}

/* Add to Bill Modal */
.add-to-bill-modal {
    max-width: 400px;
    padding: 0;
}

.modal-header {
    padding: 20px 24px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.selected-product-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
}

.selected-product-info img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.selected-product-info .product-details h4 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin: 0;
}

.add-to-bill-modal form {
    padding: 24px;
}

.form-row-modal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.add-to-bill-modal .modal-actions {
    padding: 0;
    margin-top: 20px;
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    background: var(--background);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-secondary);
}

table tbody tr {
    transition: background var(--transition-fast);
    animation: fadeInUp 0.3s ease backwards;
}

table tbody tr:nth-child(1) { animation-delay: 0.05s; }
table tbody tr:nth-child(2) { animation-delay: 0.1s; }
table tbody tr:nth-child(3) { animation-delay: 0.15s; }
table tbody tr:nth-child(4) { animation-delay: 0.2s; }

table tbody tr:hover {
    background: var(--background);
}

.delete-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    transform: scale(1.1);
}

.delete-btn:active {
    transform: scale(0.95);
}

/* Empty Message */
.empty-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    animation: fadeIn 0.5s ease;
}

.empty-message i {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
    animation: bounce 2s infinite;
}

.empty-message p {
    font-size: 0.95rem;
}

/* Summary Card */
.summary-card .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    animation: fadeInRight 0.3s ease;
}

.summary-card .summary-row.total {
    border-bottom: none;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    animation: pulse 2s infinite;
}

.summary-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.summary-actions .btn {
    flex: 1;
}

/* Inventory Container */
.inventory-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

/* Image Upload */
.image-upload-container {
    position: relative;
}

.image-preview {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.image-preview:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
    transform: scale(1.02);
}

.image-preview i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 8px;
    transition: transform var(--transition-normal);
}

.image-preview:hover i {
    transform: translateY(-5px);
    color: var(--primary-color);
}

.image-preview span {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#previewImg {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-top: 12px;
    animation: scaleIn 0.3s ease;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.product-card {
    background: var(--background);
    border-radius: 14px;
    overflow: hidden;
    transition: all var(--transition-normal);
    position: relative;
    animation: scaleIn 0.4s ease backwards;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.product-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.product-card:hover img {
    transform: scale(1.05);
}

.product-card .product-info {
    padding: 12px;
}

.product-card .product-name {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.product-card .delete-product {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--danger-color);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card:hover .delete-product {
    opacity: 1;
    transform: scale(1);
}

.product-card .delete-product:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-lg);
}

.modal.active .modal-content {
    transform: scale(1);
}

/* Bill Preview */
.bill-preview {
    padding: 24px;
}

.bill-header {
    text-align: center;
    border-bottom: 2px dashed var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 16px;
    animation: fadeInDown 0.4s ease;
}

.store-info h1 {
    font-size: 1.6rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.store-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.bill-info {
    margin-top: 12px;
    text-align: left;
    background: var(--background);
    padding: 12px;
    border-radius: 10px;
    animation: fadeIn 0.5s ease;
}

.bill-info p {
    font-size: 0.85rem;
    margin: 4px 0;
}

.bill-body {
    margin-bottom: 16px;
    animation: fadeInUp 0.5s ease;
}

.bill-table {
    width: 100%;
    font-size: 0.9rem;
}

.bill-table th {
    background: var(--background);
    padding: 10px;
    text-align: left;
    font-weight: 600;
}

.bill-table td {
    padding: 10px;
    border-bottom: 1px dashed var(--border-color);
}

.bill-footer {
    border-top: 2px dashed var(--border-color);
    padding-top: 16px;
    text-align: center;
    animation: fadeInUp 0.6s ease;
}

.bill-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 10px;
    animation: pulse 2s infinite;
}

.thank-you {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.visit-again {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    animation: fadeInUp 0.7s ease;
}

.modal-actions .btn {
    flex: 1;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }

    #printTemplate,
    #printTemplate * {
        visibility: visible;
    }

    #printTemplate {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 20px;
    }

    .bill-preview {
        box-shadow: none !important;
        border: none !important;
    }

    .modal-actions {
        display: none !important;
    }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 28px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.4s ease;
}

.notification-success { background: var(--gradient-success); }
.notification-error { background: var(--gradient-danger); }
.notification-warning { background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%); }
.notification-info { background: var(--gradient-primary); }

/* Responsive Design */
@media (max-width: 1200px) {
    .billing-container {
        grid-template-columns: 1fr;
    }

    .bill-items-section {
        grid-column: 1;
        grid-row: 2;
    }

    .bill-summary-section {
        grid-row: 3;
    }

    .inventory-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 80px 16px 24px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .product-selection-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .product-select-card img {
        width: 60px;
        height: 60px;
    }

    .product-select-card .product-name {
        font-size: 0.75rem;
    }

    .summary-actions {
        flex-direction: column;
    }

    .modal-content {
        margin: 10px;
        max-height: 85vh;
    }

    .bill-preview {
        padding: 16px;
    }

    table th,
    table td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.2rem;
    }

    .page-header h2 {
        font-size: 1.25rem;
    }

    .card {
        padding: 16px;
        border-radius: 12px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-card img {
        height: 100px;
    }

    .product-selection-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .product-select-card {
        padding: 8px;
    }

    .product-select-card img {
        width: 50px;
        height: 50px;
    }

    .selected-product-display {
        flex-direction: column;
        text-align: center;
    }

    .selected-product-display img {
        width: 80px;
        height: 80px;
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Selection color */
::selection {
    background: var(--primary-color);
    color: white;
}

/* ========================================
   NEW STYLES FOR STOCK & ANALYTICS PAGES
   ======================================== */

/* Navigation Sections */
.nav-section {
    padding: 0 16px;
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    opacity: 0.6;
    padding: 8px 8px 4px;
    display: block;
}

.nav-item {
    padding: 12px 16px;
    margin: 2px 0;
    border-radius: 8px;
}

/* Stock Badge on Product Cards */
.stock-badge {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    padding: 2px 6px;
    background: rgba(34, 197, 94, 0.1);
    border-radius: 4px;
    color: var(--success-color);
}

.stock-badge.low {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

/* Out of Stock Card */
.product-select-card.out-of-stock {
    opacity: 0.6;
    cursor: not-allowed;
}

.product-select-card.out-of-stock img {
    filter: grayscale(100%);
}

.product-select-card.out-of-stock .stock-badge {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* Product Stock Display in Inventory */
.product-card .product-stock {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Stock Info in Modal */
.stock-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stock-info span {
    font-weight: 600;
    color: var(--primary-color);
}

/* Stock Container */
.stock-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Stock Summary Cards */
.stock-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    animation: fadeInUp 0.5s ease backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.15s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }
.stat-card:nth-child(4) { animation-delay: 0.25s; }

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card.highlight {
    background: var(--gradient-primary);
    color: white;
}

.stat-card.highlight .stat-info p {
    color: rgba(255, 255, 255, 0.8);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.bg-primary { background: rgba(37, 99, 235, 0.15); color: var(--primary-color); }
.stat-icon.bg-success { background: rgba(34, 197, 94, 0.15); color: var(--success-color); }
.stat-icon.bg-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning-color); }
.stat-icon.bg-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger-color); }
.stat-icon.bg-info { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }

.stat-card.highlight .stat-icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Stock Table */
.stock-table,
.transactions-table,
.sales-table,
.bills-table {
    width: 100%;
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-product-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.table-product-img.placeholder {
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-info { color: #3b82f6 !important; }

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-good { background: rgba(34, 197, 94, 0.15); color: var(--success-color); }
.status-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning-color); }
.status-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger-color); }
.status-active { background: rgba(34, 197, 94, 0.15); color: var(--success-color); }
.status-reversed { background: rgba(239, 68, 68, 0.15); color: var(--danger-color); }

/* Type Badge */
.type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.type-success { background: rgba(34, 197, 94, 0.15); color: var(--success-color); }
.type-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger-color); }
.type-info { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }

/* Bills Table Reversed Row */
.bills-table tr.reversed {
    opacity: 0.6;
    background: rgba(239, 68, 68, 0.05);
}

/* Add Stock Container */
.add-stock-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: all var(--transition-normal);
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Quick Stock Grid */
.quick-stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.quick-stock-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--background);
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
}

.quick-stock-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.quick-stock-info {
    display: flex;
    flex-direction: column;
}

.quick-stock-name {
    font-weight: 600;
    color: var(--text-primary);
}

.quick-stock-current {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Quick Stock Modal */
.quick-stock-modal {
    max-width: 380px;
    padding: 0;
}

.quick-stock-product {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
}

.quick-stock-product span:first-child {
    font-weight: 600;
    font-size: 1.1rem;
}

.quick-stock-modal form {
    padding: 24px;
}

/* Analytics Container */
.analytics-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Date Range Picker */
.date-range-picker {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-range-picker input[type="date"] {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all var(--transition-normal);
}

.date-range-picker input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.date-range-picker span {
    color: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

.chart-card {
    min-height: 300px;
}

.chart-container {
    position: relative;
    height: 250px;
}

/* Top Products List */
.top-products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
}

.top-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background);
    border-radius: 10px;
    transition: all var(--transition-normal);
}

.top-product-item:hover {
    transform: translateX(4px);
}

.top-product-item .rank {
    width: 28px;
    height: 28px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.top-product-item .product-info {
    flex: 1;
}

.top-product-item .name {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
}

.top-product-item .stats {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.top-product-item .revenue {
    font-weight: 600;
    color: var(--primary-color);
}

/* No Data Message */
.no-data {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Alert Card */
.alert-card {
    border-left: 4px solid var(--warning-color);
}

.alert-card h3 {
    color: var(--warning-color);
}

.alert-card h3 i {
    margin-right: 8px;
}

/* Low Stock Grid */
.low-stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.low-stock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.low-stock-info {
    display: flex;
    flex-direction: column;
}

.low-stock-info .product-name {
    font-weight: 500;
    color: var(--text-primary);
}

.low-stock-info .stock-count {
    font-size: 0.85rem;
    color: var(--warning-color);
}

.low-stock-info .stock-count.critical {
    color: var(--danger-color);
    font-weight: 600;
}

/* Bill Details Modal */
.bill-details-modal {
    max-width: 500px;
}

.bill-details-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.bill-details-content {
    padding: 24px;
}

.bill-details-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.bill-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.bill-info-row span {
    color: var(--text-secondary);
}

.bill-info-row strong {
    color: var(--text-primary);
}

.bill-details-table {
    width: 100%;
}

.bill-details-table th,
.bill-details-table td {
    padding: 10px 12px;
}

.bill-details-table tfoot {
    background: var(--background);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Responsive for new components */
@media (max-width: 1200px) {
    .stock-summary-cards,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    .add-stock-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stock-summary-cards,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .stat-info h3 {
        font-size: 1.25rem;
    }

    .date-range-picker {
        flex-wrap: wrap;
        width: 100%;
    }

    .date-range-picker input[type="date"] {
        flex: 1;
        min-width: 120px;
    }

    .quick-stock-grid {
        grid-template-columns: 1fr;
    }

    .low-stock-grid {
        grid-template-columns: 1fr;
    }

    .top-products-list {
        max-height: 200px;
    }

    .chart-container {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .product-cell {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .table-product-img {
        width: 32px;
        height: 32px;
    }

    .top-product-item {
        flex-wrap: wrap;
    }

    .top-product-item .revenue {
        width: 100%;
        text-align: right;
        margin-top: 4px;
    }
}

/* ========================================
   NEW STYLES FOR CATEGORIES, ORDERS & EDIT PRODUCT
   ======================================== */

/* Categories Container */
.categories-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

.add-category-section {
    animation: fadeInLeft 0.5s ease;
}

.category-list-section {
    animation: fadeInRight 0.5s ease;
}

/* Categories Table */
.categories-table {
    width: 100%;
}

.categories-table th,
.categories-table td {
    padding: 12px 16px;
}

/* Category Filter Bar */
.category-filter-bar {
    margin-bottom: 16px;
}

.category-filter-bar select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--card-bg);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.category-filter-bar select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Filter Bar in Cards */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-bar select {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    background: var(--card-bg);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.filter-bar select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Orders Container */
.orders-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Order Stats Cards */
.order-stats-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Orders Table */
.orders-table {
    width: 100%;
}

.orders-table th,
.orders-table td {
    padding: 12px 16px;
}

.orders-table .text-muted {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Order Details Modal */
.order-details-modal {
    max-width: 600px;
}

.order-details-content {
    padding: 24px;
}

.order-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.order-info-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.order-info-section p {
    margin: 8px 0;
    font-size: 0.9rem;
}

.order-items-section {
    margin-bottom: 16px;
}

.order-items-section h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.order-items-table {
    width: 100%;
    font-size: 0.9rem;
}

.order-items-table th,
.order-items-table td {
    padding: 10px 12px;
}

.order-items-table tfoot {
    background: var(--background);
}

.order-notes {
    padding: 12px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    font-size: 0.9rem;
}

.order-status-actions {
    padding: 16px 24px;
    background: var(--background);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Edit Product Modal */
.edit-product-modal {
    max-width: 500px;
}

.edit-product-modal form {
    padding: 24px;
}

/* Checkbox Group */
.checkbox-group {
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Product Card Additional Styles */
.product-card .product-category {
    display: block;
    font-size: 0.75rem;
    color: var(--primary-color);
    margin-top: 2px;
}

.product-card .product-price {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 4px;
}

.product-card .featured-indicator {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--warning-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.product-card .inactive-indicator {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: var(--danger-color);
    color: white;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.product-card .product-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.product-card:hover .product-actions {
    opacity: 1;
}

.product-card .edit-product {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.product-card .edit-product:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Product Select Card Price Badge */
.product-select-card .price-badge {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 4px;
}

/* Price Info in Modal */
.price-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.price-info span {
    font-weight: 600;
    color: var(--primary-color);
}

/* Additional Status Badges */
.status-inactive { background: rgba(100, 116, 139, 0.15); color: var(--secondary-color); }
.status-info { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.status-primary { background: rgba(37, 99, 235, 0.15); color: var(--primary-color); }
.status-shipped { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

/* Select Styling */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Header Actions Select */
.header-actions select {
    padding: 8px 36px 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    background-color: var(--card-bg);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.header-actions select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Responsive for Categories & Orders */
@media (max-width: 1200px) {
    .categories-container {
        grid-template-columns: 1fr;
    }
    
    .order-stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .order-stats-cards {
        grid-template-columns: 1fr;
    }
    
    .order-info-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-bar {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .order-status-actions {
        flex-direction: column;
    }
    
    .order-status-actions .btn {
        width: 100%;
    }
}

/* ========================================
   QR CODE SCANNER & MANAGEMENT STYLES
   ======================================== */

/* QR Scanner Container */
.qr-scanner-container {
    padding: 16px;
    background: var(--background);
    border-radius: 12px;
    margin-bottom: 16px;
}

.qr-input-section {
    display: flex;
    gap: 12px;
}

.qr-input-section input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-normal);
}

.qr-input-section input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.qr-scanner-status {
    margin-top: 12px;
    padding: 10px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 8px;
    text-align: center;
}

.qr-scanner-status p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.qr-scanner-status.success {
    background: rgba(34, 197, 94, 0.1);
}

.qr-scanner-status.success p {
    color: var(--success-color);
}

.qr-scanner-status.error {
    background: rgba(239, 68, 68, 0.1);
}

.qr-scanner-status.error p {
    color: var(--danger-color);
}

/* Scanned QR List */
.scanned-qr-list {
    margin-top: 16px;
    padding: 16px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 2px solid var(--success-color);
    animation: fadeInUp 0.3s ease;
}

.scanned-qr-list h4 {
    font-size: 0.95rem;
    color: var(--success-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.scanned-qr-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 8px;
    animation: fadeInRight 0.3s ease;
}

.scanned-qr-item:last-child {
    margin-bottom: 0;
}

.scanned-qr-info {
    display: flex;
    flex-direction: column;
}

.scanned-qr-info .product-name {
    font-weight: 600;
    color: var(--text-primary);
}

.scanned-qr-info .qr-id {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.scanned-qr-info .color-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 0.75rem;
    margin-top: 4px;
}

.scanned-qr-price {
    font-weight: 600;
    color: var(--primary-color);
}

/* QR Codes Container */
.qrcodes-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* QR Stats Cards */
.qr-stats-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Generated QR Codes Card */
.qr-codes-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.qr-codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    max-height: 500px;
    overflow-y: auto;
    padding: 4px;
}

.qr-code-item {
    background: var(--background);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all var(--transition-normal);
    animation: scaleIn 0.3s ease backwards;
}

.qr-code-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.qr-code-item canvas {
    margin-bottom: 8px;
}

.qr-code-info {
    margin-top: 8px;
}

.qr-code-info .qr-id {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    word-break: break-all;
}

.qr-code-info .product-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-top: 4px;
}

.qr-code-info .color {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-top: 2px;
}

/* QR Codes Table */
.qr-codes-table {
    width: 100%;
}

.qr-codes-table th,
.qr-codes-table td {
    padding: 12px 16px;
}

.qr-codes-table .qr-id-cell {
    font-family: monospace;
    font-size: 0.85rem;
}

/* Bill Item with QR Code */
.bill-qr-badge {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 0.7rem;
    margin-left: 4px;
    font-family: monospace;
}

/* Print QR Codes */
@media print {
    .qr-codes-actions {
        display: none !important;
    }
    
    .qr-codes-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        max-height: none !important;
    }
    
    .qr-code-item {
        page-break-inside: avoid;
        border: 1px solid #000;
    }
}

/* Responsive for QR Codes */
@media (max-width: 1200px) {
    .qr-stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .qr-stats-cards {
        grid-template-columns: 1fr;
    }
    
    .qr-input-section {
        flex-direction: column;
    }
    
    .qr-codes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .qr-codes-grid {
        grid-template-columns: 1fr;
    }
    
    .scanned-qr-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Camera Scanner Modal */
.camera-scanner-modal {
    max-width: 500px;
    padding: 0;
    background: #000;
}

.camera-scanner-modal .modal-header {
    background: var(--gradient-primary);
    padding: 16px 24px;
}

.scanner-container {
    position: relative;
    width: 100%;
    background: #000;
    min-height: 300px;
}

.scanner-container video {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scanner-frame {
    width: 200px;
    height: 200px;
    border: 3px solid var(--primary-color);
    border-radius: 16px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: pulse 2s infinite;
}

.scanner-frame::before,
.scanner-frame::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: var(--success-color);
    border-style: solid;
}

.scanner-frame::before {
    top: -3px;
    left: -3px;
    border-width: 4px 0 0 4px;
    border-radius: 16px 0 0 0;
}

.scanner-frame::after {
    bottom: -3px;
    right: -3px;
    border-width: 0 4px 4px 0;
    border-radius: 0 0 16px 0;
}

.scanner-status {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    padding: 12px;
    text-align: center;
}

.scanner-status p {
    margin: 0;
    color: white;
    font-size: 0.9rem;
}

/* QR Code Display Section */
.qr-display-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    animation: fadeInUp 0.4s ease;
}

.qr-code-display {
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

.qr-code-display canvas {
    display: block;
}

.qr-info {
    text-align: center;
    margin-bottom: 20px;
}

.qr-info p {
    margin: 8px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.qr-info p strong {
    color: var(--text-primary);
}

.qr-info p span {
    font-family: monospace;
    color: var(--primary-color);
}

.qr-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.qr-actions .btn {
    min-width: 150px;
}

/* Product QR Button */
.qr-product-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--primary-color);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card:hover .qr-product-btn {
    opacity: 1;
    transform: scale(1);
}

.qr-product-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Product QR Modal */
.product-qr-modal {
    max-width: 400px;
    padding: 0;
}

.product-qr-modal .modal-header {
    background: var(--gradient-primary);
    padding: 16px 24px;
    border-radius: 16px 16px 0 0;
}

/* Stock QR Card */
#stockQRCard {
    animation: fadeInUp 0.4s ease;
}

#stockQRCard .qr-display-section {
    padding: 16px;
}

/* Responsive for QR display */
@media (max-width: 480px) {
    .qr-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .qr-actions .btn {
        width: 100%;
        min-width: auto;
    }
}
