@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #475569;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --card-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    --card-shadow-hover: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.light-theme {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #e2e8f0;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

.main-content {
    flex: 1;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    overflow-x: hidden;
}

.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 20px;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.navbar-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.navbar-links {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
}

.nav-link.active {
    background: var(--accent);
    color: white;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle, .mobile-menu-btn {
    background: var(--bg-tertiary);
    border: none;
    border-radius: 8px;
    padding: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover, .mobile-menu-btn:hover {
    background: var(--accent);
    color: white;
}

.mobile-menu {
    display: none;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 16px;
    animation: slideDown 0.3s ease;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 6px;
    font-size: 0.95rem;
    font-weight: 600;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
    background: var(--accent);
    color: white;
}

.mobile-menu-actions {
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-top: 12px;
}

.card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-4px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #0da271;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    border-radius: 8px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--bg-tertiary);
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.table tr:hover {
    background: var(--bg-tertiary);
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1200px) {
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
    .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
    .main-content { padding: 16px; }
    .navbar-links { display: none; }
    .mobile-menu { display: block; }
    .navbar { padding: 0 16px; }
    .card { padding: 16px; }
    .table th, .table td { padding: 10px 14px; }
}

@media (max-width: 640px) {
    .main-content { padding: 12px; }
    .card { padding: 14px; }
    .btn { padding: 8px 14px; }
    .navbar-content { padding: 10px 0; }
}

@media (min-width: 769px) {
    .mobile-menu-btn { display: none; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease;
}

.product-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    min-height: 180px;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.product-image {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 12px;
    position: relative;
}

.product-info {
    flex: 1;
}

.product-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.3;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--success);
    margin-bottom: 8px;
}

.product-stock {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.welcome-section {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px 0;
}

.welcome-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.2;
}

.welcome-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stats-grid {
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.bg-gradient-blue { background: #3b82f6; }
.bg-gradient-green { background: #10b981; }
.bg-gradient-orange { background: #f59e0b; }
.bg-gradient-purple { background: #8b5cf6; }

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.recent-sales-list {
    margin-top: 16px;
}

.sale-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.sale-item:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.sale-customer {
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.sale-details {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sale-amount {
    font-weight: 800;
    font-size: 1rem;
    color: var(--success);
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.quick-action-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    text-align: center;
}

.quick-action-btn:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.quick-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.sales-page {
    animation: fadeIn 0.4s ease;
    width: 100%;
}

.sales-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 4px;
    font-weight: 500;
}

.sales-stats {
    display: flex;
    gap: 16px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 18px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 800;
}

.barcode-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

.products-grid::-webkit-scrollbar {
    width: 6px;
}

.products-grid::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.products-grid::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

.cart-section {
    position: sticky;
    top: 20px;
}

.cart-items-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    width: 100%;
}

.cart-items-container::-webkit-scrollbar {
    width: 6px;
}

.cart-items-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.cart-items-container::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

.empty-cart, .empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
    font-style: italic;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.cart-item:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-price {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-weight: 700;
    font-size: 0.9rem;
}

.qty-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.quantity {
    min-width: 30px;
    text-align: center;
    font-weight: 800;
    font-size: 0.9rem;
}

.item-total {
    font-weight: 800;
    color: var(--success);
    min-width: 60px;
    text-align: right;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.remove-btn:hover {
    background: var(--danger);
    color: white;
}

.cart-totals {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-bottom: 16px;
}

.total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 8px 0;
    font-size: 0.95rem;
}

.total-line.final {
    font-weight: 800;
    font-size: 1.1rem;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 12px;
    color: var(--success);
}

.cart-actions {
    display: flex;
    gap: 12px;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--bg-primary);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    color: var(--danger);
    background: var(--bg-tertiary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid var(--border);
}

.fas.fa-home { color: #3b82f6; }
.fas.fa-shopping-cart { color: #10b981; }
.fas.fa-boxes { color: #f59e0b; }
.fas.fa-chart-bar { color: #8b5cf6; }
.fas.fa-receipt { color: #ef4444; }
.fas.fa-barcode { color: #06b6d4; }
.fas.fa-cog { color: #6b7280; }
.fas.fa-cash-register { color: #10b981; }
.fas.fa-plus { color: #10b981; }
.fas.fa-history { color: #8b5cf6; }
.fas.fa-bolt { color: #f59e0b; }
.fas.fa-user { color: #3b82f6; }
.fas.fa-clock { color: #6b7280; }
.fas.fa-shopping-bag { color: #8b5cf6; }
.fas.fa-box { color: #d4d38e; }
.fas.fa-exclamation-triangle { color: #ef4444; }
.fas.fa-chart-line { color: #10b981; }
.fas.fa-money-bill { color: #f59e0b; }
.fas.fa-store { color: #ffffff; }
.fas.fa-info-circle { color: #06b6d4; }
.fas.fa-edit { color: #f59e0b; }
.fas.fa-trash { color: #ffffff; }
.fas.fa-print { color: #ffffff; }
.fas.fa-shopping { color: #ffffff; }
.fas.fa-search { color: #6b7280; }
.fas.fa-moon { color: #f59e0b; }
.fas.fa-sun { color: #f59e0b; }
.fas.fa-bars { color: var(--text-primary); }
.fas.fa-sign-out-alt { color: #ffffff; }
.fas.fa-hourglass-end { color: #dfc08d;}
.fas.fa-chart-pie { color: #ffa200; }
.fas.fa-cog { color: #6b7280; } 
.fas.fa-shield-alt { color: #ef4444; }
.fas.fa-users { color: #8b5cf6; }
.fas.fa-user-plus { color: #10b981; }
.fas.fa-user-slash { color: #ef4444; }
.fas.fa-user-check { color: #10b981; }
.fas.fa-user-circle { color: #8b5cf6; }
.fas.fa-shopping-cart { color: #ffffff; }

.inventory-header, .receipts-header, .reports-header, .barcode-header, .settings-header, .statistics-header, .security-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    width: 100%;
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stock-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stock-badge.in-stock {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.stock-badge.low-stock {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.low-stock-row {
    background: rgba(239, 68, 68, 0.05) !important;
}

.barcode {
    background: var(--bg-primary);
    padding: 6px 10px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 1001;
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    border-left: 4px solid;
}

.toast.success {
    background: var(--success);
    border-left-color: #059669;
}

.toast.error {
    background: var(--danger);
    border-left-color: #dc2626;
}

.toast.warning {
    background: var(--warning);
    border-left-color: #d97706;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.floating-cart-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    border: none;
    z-index: 1000;
    transition: all 0.3s ease;
}

.floating-cart-btn:hover {
    transform: scale(1.1);
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    border: 2px solid var(--bg-primary);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: all 0.3s ease;
}

.light-theme .loading-overlay {
    background: rgba(248, 250, 252, 0.9);
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.circular-loader {
    width: 70px;
    height: 70px;
    position: relative;
    margin-bottom: 20px;
}

.circular-loader-inner {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 16px;
    text-align: center;
}

.loading-subtext {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 8px;
    text-align: center;
    font-weight: 500;
}

.loading-progress-bar {
    height: 6px;
    background: var(--accent);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.barcode-generator-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    width: 100%;
}

.barcode-input-section {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 0 auto;
    max-width: 500px;
    width: 100%;
}

.barcode-actions {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.barcode-preview-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    width: 100%;
}

.search-box {
    position: relative;
    max-width: 300px;
}

.search-box .form-input {
    padding-left: 40px;
}

.search-box::before {
    content: '\f002';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    z-index: 1;
    font-size: 0.9rem;
}

.low-stock-card {
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.low-stock-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.low-stock-indicator {
    color: var(--danger);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.cart-badge {
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    margin-left: 8px;
}

.total-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 8px;
}

.items-badge {
    background: var(--accent);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
}

.date-cell, .customer-cell, .cashier-cell, .items-cell, .amount-cell {
    padding: 8px 0;
}

.date {
    font-weight: 700;
    color: var(--text-primary);
}

.time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.customer-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.statistics-page {
    animation: fadeIn 0.4s ease;
    width: 100%;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.analysis-item-circular {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.analysis-item-circular:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.big-circular-progress {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.big-circular-bg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-tertiary);
    position: relative;
    overflow: hidden;
}

.big-circular-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(var(--success) 0%, #22c55e 20%, #f59e0b 40%, #ef4444 60%, #dc2626 80%, #b91c1c 100%);
    mask: radial-gradient(transparent 55%, black 56%);
    -webkit-mask: radial-gradient(transparent 55%, black 56%);
    transform: rotate(-90deg);
}

.big-circular-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 85%;
}

.big-circular-name {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.big-circular-value {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.big-circular-subtext {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 2px;
    font-weight: 600;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.security-page {
    animation: fadeIn 0.4s ease;
    width: 100%;
}

.security-activities-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 8px;
}

.security-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.security-activity-item:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-description {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
    font-weight: 600;
}

.activity-changes {
    margin-top: 8px;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border-left: 3px solid var(--warning);
}

.change-item {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    padding: 2px 0;
}

.activity-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.activity-user, .activity-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.activity-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px;
}

.activity-stat {
    text-align: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.activity-stat:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.activity-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
}

.activity-stat .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.edited-products-list {
    padding: 16px;
}

.edited-product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.edited-product-item:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.edited-product-item .product-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.edited-product-item .edit-count {
    background: var(--warning);
    color: white;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 700;
}

.edit-count-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--warning);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.edit-count-indicator {
    color: var(--warning);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.cart-container {
    max-height: 70vh;
    overflow-y: auto;
}

html {
    scroll-behavior: smooth;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

::selection {
    background: rgba(59, 130, 246, 0.3);
    color: var(--text-primary);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.active {
    background: var(--success);
    color: white;
}

.status-badge.inactive {
    background: #6b7280;
    color: white;
}

.staff-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.6;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.sticky-top {
    position: sticky;
    top: 1rem;
}

.desktop-only {
    display: block;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
}

.quick-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.receipt-content {
    background: white;
    color: black;
    padding: 16px;
    font-family: 'Courier New', monospace;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 8px;
}

.receipt-header {
    text-align: center;
    margin-bottom: 16px;
    border-bottom: 2px dashed #000;
    padding-bottom: 16px;
}

.receipt-logo {
    margin-bottom: 8px;
    max-width: 100%;
    height: auto;
}

.receipt-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 4px;
    text-transform: uppercase;
    word-wrap: break-word;
}

.receipt-address, .receipt-phone {
    font-size: 0.8rem;
    margin-bottom: 2px;
    font-weight: 600;
}

.receipt-info {
    margin-bottom: 16px;
    font-size: 0.8rem;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    word-wrap: break-word;
    border: 1px solid #e2e8f0;
}

.receipt-items {
    margin-bottom: 16px;
}

.receipt-item-header, .receipt-item {
    display: grid;
    grid-template-columns: 2fr 0.8fr 1fr 1fr;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.75rem;
    align-items: start;
}

.receipt-item-header {
    font-weight: 800;
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.receipt-item {
    border-bottom: 1px dashed #ccc;
}

.item-name {
    font-weight: 700;
    word-break: break-word;
}

.item-qty, .item-price, .item-total {
    text-align: center;
    font-weight: 700;
}

.receipt-totals {
    border-top: 2px solid #000;
    padding-top: 16px;
    margin-bottom: 16px;
}

.receipt-total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.receipt-total-line.final {
    font-weight: 800;
    font-size: 1rem;
    border-top: 2px dashed #000;
    padding-top: 8px;
    margin-top: 8px;
}

.receipt-footer {
    text-align: center;
    font-size: 0.75rem;
    line-height: 1.3;
}

.thank-you {
    font-weight: 800;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #15803d;
}

.return-policy {
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 8px;
}

.receipt-note {
    font-style: italic;
    color: #999;
    margin-top: 8px;
    font-size: 0.7rem;
}

@media (max-width: 1024px) {
    .sales-content {
        display: flex;
        flex-direction: column;
    }
    
    .cart-section {
        order: -1;
        margin-bottom: 24px;
    }
    
    .cart-container {
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    .navbar-title {
        font-size: 1.1rem;
    }
    
    .navbar-logo {
        width: 36px;
        height: 36px;
    }
    
    .welcome-title {
        font-size: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .analysis-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .big-circular-progress {
        width: 100px;
        height: 100px;
    }
    
    .activity-stats {
        grid-template-columns: 1fr;
    }
}

.barcode-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.barcode-input {
    flex: 1;
}

.barcode-camera-btn {
    white-space: nowrap;
}

.camera-scanner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.camera-scanner-header {
    background: #2c3e50;
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.camera-scanner-body {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.camera-scanner-body video {
    width: 100%;
    max-width: 500px;
    height: auto;
    border: 2px solid #fff;
    border-radius: 8px;
}

.camera-guide {
    position: absolute;
    width: 80%;
    height: 100px;
    border: 2px solid #00ff00;
    border-radius: 8px;
    pointer-events: none;
}

.camera-scanner-footer {
    background: #2c3e50;
    color: white;
    padding: 15px;
    text-align: center;
}

.toggle-switch {
    position: relative;
    width: 80px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #2196F3;
}

input:checked + .toggle-slider:before {
    transform: translateX(46px);
}

.toggle-label-on, .toggle-label-off {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.toggle-label-on {
    left: 10px;
    display: none;
}

.toggle-label-off {
    right: 10px;
}

input:checked + .toggle-slider .toggle-label-on {
    display: block;
}

input:checked + .toggle-slider .toggle-label-off {
    display: none;
}

.security-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}



@media (max-width: 768px) {
    .barcode-input-group {
        flex-direction: column;
    }
    
    .camera-scanner-body video {
        max-width: 100%;
        height: auto;
    }
}