/* Base Styles */
:root {
    --primary: #667eea;
    --primary-dark: #5a6fd8;
    --secondary: #764ba2;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --light: #f8f9fa;
    --dark: #2c3e50;
    --gray: #7f8c8d;
    --border: #e0e0e0;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body { min-height: 100vh; background: #f5f6fa; }

/* Typography */
h1, h2, h3, h4, h5, h6 { color: var(--dark); margin-bottom: 1rem; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* Links */
a { color: var(--primary); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--primary-dark); }

/* Buttons */
.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-icon { width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s; border: none; font-size: 1.1rem; }
.btn-icon:hover { transform: scale(1.1); }

/* Badge */
.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Cards */
.stat-card { position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; right: 0; width: 100px; height: 100px; background: rgba(255,255,255,0.1); border-radius: 50%; transform: translate(30%, -30%); }

/* Tables */
.table-actions { display: flex; gap: 5px; }
.table-actions .btn-icon { padding: 8px; }

/* Forms */
.form-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

.w-100 { width: 100%; }

/* Progress Bar */
.progress { height: 8px; background: #e0e0e0; border-radius: 4px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 4px; transition: width 0.5s ease; }

/* Tooltip */
.tooltip { position: relative; }
.tooltip::after { content: attr(data-tooltip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--dark); color: white; padding: 5px 10px; border-radius: 4px; font-size: 0.75rem; white-space: nowrap; opacity: 0; visibility: hidden; transition: all 0.3s; }
.tooltip:hover::after { opacity: 1; visibility: visible; bottom: calc(100% + 5px); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeIn 0.5s ease forwards; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }

/* POS Terminal Specific */
.pos-terminal { background: linear-gradient(145deg, #2c3e50 0%, #1a252f 100%); border-radius: 20px; padding: 2rem; color: white; }
.pos-screen { background: #1a1a2e; border-radius: 12px; padding: 1.5rem; min-height: 300px; max-height: 500px; overflow-y: auto; margin-bottom: 1rem; }
.pos-keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pos-key { background: #34495e; border: 2px solid #4a5f7a; color: white; border-radius: 10px; padding: 20px; font-size: 1.2rem; font-weight: bold; cursor: pointer; transition: all 0.2s; user-select: none; }
.pos-key:hover { background: #4a5f7a; transform: scale(1.05); }
.pos-key:active { transform: scale(0.95); }
.pos-key.operator { background: #e67e22; border-color: #f39c12; }
.pos-key.enter { background: var(--success); border-color: #27ae60; grid-column: span 2; }
.pos-key.clear { background: var(--danger); border-color: #c0392b; }

/* Ticket printer style */
.receipt { font-family: 'Courier New', monospace; background: #fff; color: #000; padding: 20px; max-width: 400px; margin: 0 auto; border: 2px dashed #ccc; }
.receipt-header { text-align: center; margin-bottom: 15px; }
.receipt-body { margin-bottom: 15px; }
.receipt-line { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 0.9rem; }
.receipt-total { border-top: 2px dashed #000; padding-top: 10px; font-weight: bold; font-size: 1.1rem; margin-top: 10px; }

/* Toast notification */
.toast-container { position: fixed; top: 80px; right: 20px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; }
.toast { padding: 15px 20px; border-radius: 8px; color: white; font-weight: 500; box-shadow: 0 4px 12px rgba(0,0,0,0.15); animation: slideIn 0.3s ease; min-width: 300px; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info { background: var(--info); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Low stock alert */
.low-stock-alert { position: fixed; bottom: 20px; right: 20px; background: linear-gradient(135deg, #ff6b6b, #ee5a52); color: white; padding: 15px 25px; border-radius: 10px; box-shadow: 0 4px 20px rgba(238, 90, 82, 0.4); display: none; z-index: 3000; animation: bounceIn 0.5s ease; }
@keyframes bounceIn { 0% { transform: scale(0.3); opacity: 0; } 50% { transform: scale(1.05); } 70% { transform: scale(0.9); } 100% { transform: scale(1); opacity: 1; }

/* Search highlight */
.highlight { background: #ffeb3b; padding: 2px 4px; border-radius: 3px; font-weight: bold; }

/* Print styles */
@media print {
    .no-print { display: none !important; }
    .receipt { border: none; box-shadow: none; }
}

/* Responsive */
@media (max-width: 576px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .pos-keypad { grid-template-columns: repeat(3, 1fr); }
    .pos-key { padding: 15px; font-size: 1rem; }
}

/* Touch optimization */
@media (pointer: coarse) {
    .btn, .pos-key, .btn-icon {
        min-height: 44px;
        min-width: 44px;
    }
    th, td { padding: 12px 8px; }
}