* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    padding-top: 70px;
}

.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand i {
    margin-left: 8px;
}

.main-content {
    min-height: calc(100vh - 130px);
}

.card {
    border: none;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
    border-radius: 10px;
    margin-bottom: 20px;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    border-radius: 10px 10px 0 0 !important;
    font-weight: bold;
}

.stat-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .card-body {
    padding: 20px;
}

.stat-icon {
    font-size: 3rem;
    opacity: 0.3;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
}

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

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

.bg-gradient-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.bg-gradient-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.bg-gradient-danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.btn {
    border-radius: 6px;
    padding: 8px 18px;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    color: white;
}

.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #ddd;
    padding: 10px 15px;
}

.form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    border-color: #667eea;
}

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

.table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px;
}

.table tbody td {
    vertical-align: middle;
    padding: 10px 12px;
}

.table tbody tr:hover {
    background-color: #f8f9ff;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 6px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    margin-right: 10px;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 6px;
    padding: 5px;
    border: 1px solid #ddd;
}

.select2-container--default .select2-selection--single {
    border-radius: 6px;
    border: 1px solid #ddd;
    height: 42px;
    padding: 6px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 8px;
}

.select2-container .select2-selection--multiple {
    border-radius: 6px;
    border: 1px solid #ddd;
    min-height: 42px;
}

.pos-container {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 20px;
    height: calc(100vh - 140px);
}

.products-area {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
    overflow: hidden;
}

.cart-area {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 0 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.search-bar {
    margin-bottom: 15px;
}

.categories-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.category-btn {
    padding: 6px 16px;
    border-radius: 20px;
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.category-btn:hover, .category-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    overflow-y: auto;
    padding: 10px;
    flex: 1;
}

.product-card {
    background: #fff;
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.product-card:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.product-card.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-card img, .product-card .product-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #667eea;
}

.product-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
    min-height: 40px;
}

.product-price {
    color: #38ef7d;
    font-weight: bold;
    font-size: 1.1rem;
}

.product-stock {
    font-size: 0.8rem;
    color: #888;
}

.product-stock.low {
    color: #f5576c;
}

.cart-header {
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.cart-item-price {
    color: #666;
    font-size: 0.85rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cart-item-qty button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #eee;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-qty button:hover {
    background: #667eea;
    color: white;
}

.cart-item-qty input {
    width: 50px;
    text-align: center;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 4px;
}

.cart-item-total {
    font-weight: bold;
    color: #11998e;
    min-width: 70px;
    text-align: left;
}

.cart-item-delete {
    color: #f5576c;
    cursor: pointer;
    padding: 5px;
}

.cart-totals {
    background: #f8f9ff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.cart-total-row.total {
    border-top: 2px solid #667eea;
    padding-top: 10px;
    margin-top: 8px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
}

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

.customer-select-area {
    background: #f8f9ff;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    max-width: 450px;
    width: 100%;
}

.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    text-align: center;
    color: white;
}

.login-header i {
    font-size: 4rem;
    margin-bottom: 15px;
}

.login-body {
    padding: 30px;
}

.repair-device-card {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    background: #fafbff;
}

.device-type-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 15px;
}

.status-timeline {
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
    position: relative;
}

.status-timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 10%;
    left: 10%;
    height: 3px;
    background: #eee;
    transform: translateY(-50%);
}

.timeline-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.timeline-step .step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #eee;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.timeline-step.completed .step-circle {
    background: #38ef7d;
    border-color: #38ef7d;
    color: white;
}

.timeline-step.current .step-circle {
    background: #667eea;
    border-color: #667eea;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.modal-content {
    border-radius: 15px;
    border: none;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    border-bottom: none;
}

.close {
    color: white;
    opacity: 0.9;
}

.invoice-print {
    background: white;
    padding: 30px;
    max-width: 900px;
    margin: 0 auto;
    font-size: 14px;
}

.invoice-header {
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.invoice-footer {
    border-top: 2px solid #333;
    padding-top: 20px;
    margin-top: 30px;
    text-align: center;
}

@media (max-width: 1100px) {
    .pos-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    .products-area {
        max-height: 60vh;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 56px;
    }
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    .stat-value {
        font-size: 1.5rem;
    }
    .stat-icon {
        font-size: 2rem;
    }
}

.dropdown-menu {
    border-radius: 8px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.dropdown-item {
    padding: 10px 18px;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, #667eea15, #764ba215);
}

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

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

.text-right-dir { text-align: right; }
.text-left-dir { text-align: left; }
.text-center-dir { text-align: center; }
