* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f1f5f9;
    color: #334155;
    line-height: 1.6;
}

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #1e293b;
}

.login-box .icon {
    text-align: center;
    font-size: 48px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #475569;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
}

select.form-control {
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #1e293b;
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid #334155;
    margin-bottom: 20px;
}

.sidebar-header h2 {
    font-size: 20px;
}

.sidebar-header small {
    color: #94a3b8;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: #334155;
    color: white;
}

.sidebar-nav a.active {
    border-left: 3px solid #3b82f6;
}

.sidebar-user {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    border-top: 1px solid #334155;
    background: #1e293b;
}

.sidebar-user .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.sidebar-user .avatar {
    width: 40px;
    height: 40px;
    background: #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.sidebar-user .user-name {
    font-weight: 500;
}

.sidebar-user .user-role {
    font-size: 12px;
    color: #94a3b8;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 18px;
    color: #1e293b;
}

.card-body {
    padding: 20px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.stat-card .stat-icon.green { background: #d1fae5; color: #059669; }
.stat-card .stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-card .stat-icon.yellow { background: #fef3c7; color: #d97706; }
.stat-card .stat-icon.purple { background: #ede9fe; color: #7c3aed; }

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
}

.stat-card .stat-label {
    color: #64748b;
    font-size: 14px;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 14px;
    text-transform: uppercase;
}

.table tr:hover {
    background: #f8fafc;
}

.table .actions {
    display: flex;
    gap: 8px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: #d1fae5; color: #059669; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-info { background: #dbeafe; color: #2563eb; }

/* POS */
.pos-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    height: calc(100vh - 60px);
}

.pos-products {
    overflow-y: auto;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 18px;
}

.search-box input:focus {
    outline: none;
    border-color: #3b82f6;
}

.search-box .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 20px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.product-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.product-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59,130,246,0.15);
}

.product-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-card .product-code {
    font-size: 12px;
    color: #94a3b8;
    font-family: monospace;
}

.product-card .product-name {
    font-weight: 600;
    color: #1e293b;
    margin: 8px 0;
}

.product-card .product-price {
    font-size: 20px;
    font-weight: 700;
    color: #3b82f6;
}

.product-card .product-stock {
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
}

.product-card .product-stock.low {
    color: #d97706;
}

/* Cart */
.pos-cart {
    background: white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cart-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.cart-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.cart-item-name {
    font-weight: 500;
}

.cart-item-remove {
    color: #ef4444;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 18px;
}

.cart-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-controls button {
    width: 28px;
    height: 28px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}

.qty-controls button:hover {
    background: #f1f5f9;
}

.qty-controls span {
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.cart-item-subtotal {
    font-weight: 600;
    color: #1e293b;
}

.cart-empty {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
}

.cart-empty .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
}

.cart-totals {
    margin-bottom: 20px;
}

.cart-totals .total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.cart-totals .total-row.grand-total {
    font-size: 24px;
    font-weight: 700;
    color: #059669;
    padding-top: 12px;
    border-top: 2px solid #e2e8f0;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.payment-method {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-method:hover {
    border-color: #3b82f6;
}

.payment-method.active {
    border-color: #3b82f6;
    background: #eff6ff;
}

.payment-method .icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.payment-method .label {
    font-size: 12px;
    font-weight: 500;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Success Screen */
.success-screen {
    text-align: center;
    padding: 40px;
}

.success-screen .icon {
    width: 80px;
    height: 80px;
    background: #d1fae5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
    color: #059669;
}

.success-screen h2 {
    color: #1e293b;
    margin-bottom: 8px;
}

.success-screen .factura-num {
    font-family: monospace;
    font-size: 24px;
    color: #3b82f6;
    margin: 20px 0;
}

.success-screen .total {
    font-size: 36px;
    font-weight: 700;
    color: #059669;
    margin-bottom: 30px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    color: #1e293b;
}

.page-header p {
    color: #64748b;
}

/* Filters */
.filters {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters .form-control {
    width: auto;
    min-width: 200px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    .main-content {
        margin-left: 200px;
    }
    .pos-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
