@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(0, 0, 0, 0.1);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Glassmorphism Classes */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}


.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    animation: fadeIn 0.5s ease-out;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Components */
.card {
    padding: 2rem;
    margin-bottom: 2rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.3s ease;
}

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

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0.5rem;
}

/* Forms and Inputs */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input[type="text"], input[type="number"], select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

option {
    background: var(--bg-color);
    color: var(--text-primary);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-success {
    background: var(--success-color);
    color: white;
}
.btn-success:hover { background: #059669; }

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background: rgba(0, 0, 0, 0.03);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-blue { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.badge-green { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.badge-gray { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

.action-links a {
    color: var(--accent-color);
    text-decoration: none;
    margin-right: 0.75rem;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}
.action-links a:hover { color: #93c5fd; }

.action-links a.delete {
    color: var(--danger-color);
}
.action-links a.delete:hover {
    color: #fca5a5;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

/* POS Specific Styles */
.pos-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    height: calc(100vh - 120px);
}

.pos-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    align-content: start;
    overflow-y: auto;
    padding-right: 10px;
}

.pos-item {
    cursor: pointer;
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid transparent;
    transition: all 0.2s ease;
    border-radius: 12px;
}

.pos-item:hover {
    border-color: var(--accent-color);
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.9);
}

.pos-item h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.pos-item .price {
    color: #34d399;
    font-weight: 700;
}

.pos-cart {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.cart-item-title {
    font-weight: 600;
}

.cart-item-price {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.cart-summary {
    background: rgba(255, 255, 255, 0.8);
    padding: 1.5rem;
    border-radius: 12px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.pos-item-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.pos-item-img-placeholder {
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsiveness Media Queries */
@media (max-width: 1024px) {
    .pos-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .pos-cart {
        height: auto;
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }
    .container {
        margin: 1rem auto;
    }
    .stat-grid {
        grid-template-columns: 1fr;
    }
    
    /* Purchase items responsiveness */
    .row-header {
        display: none;
    }
    .item-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 8px;
    }
    .item-row > div:first-child { grid-column: span 2; }
    .item-row > div:last-child { grid-column: span 2; text-align: right; }

    /* Hide less important columns on mobile tables */
    .hide-mobile {
        display: none;
    }
}

@media (max-width: 480px) {
    .btn {
        width: 100%;
        text-align: center;
    }
}

