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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --secondary-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --success: #10b981;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.pos-container {
    display: flex;
    min-height: 100vh;
    gap: 0;
}

/* Modern Sidebar */
.pos-sidebar {
    width: 280px;
    /* background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%); */
    background: linear-gradient(180deg, #2f4f2f 0%, #0b160a 100%);
    color: #fff;
    padding: 2rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.pos-sidebar h2 {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    padding: 0 1.5rem;
    /* background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%); */
    background: linear-gradient(135deg, #ffffff 0%, #9f8e02 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pos-sidebar ul {
    list-style: none;
    padding: 0 1rem;
}

.pos-sidebar li {
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    overflow: hidden;
}

.pos-sidebar li a {
    color: #cbd5e1;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.pos-sidebar li a::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--primary-light);
    border-radius: 2px 0 0 2px;
    transition: height 0.3s ease;
}

.pos-sidebar li.active a::before,
.pos-sidebar li:hover a::before {
    height: 60%;
}

.pos-sidebar li.active a,
.pos-sidebar li:hover a {
    background: rgba(99, 102, 241, 0.15);
    color: #fff;
    transform: translateX(-4px);
}

.pos-sidebar li.active {
    background: rgba(99, 102, 241, 0.1);
}

/* Main Content */
.pos-main {
    flex: 1;
    padding: 2rem;
    background: var(--bg-secondary);
    min-height: 100vh;
}

/* Modern Cards */
.products-panel,
.cart-panel,
.modern-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.products-panel:hover,
.cart-panel:hover,
.modern-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.products-panel h3,
.modern-card h2,
.modern-card h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
}

.product-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.product-card:hover::before {
    opacity: 1;
}

.product-card > * {
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.product-card:hover > * {
    color: #fff;
}

/* Cart Panel */
.cart-panel {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 4rem);
}

.cart-items {
    flex: 1;
    overflow-x: auto;
    height: 250px;
    margin-bottom: 1.5rem;
    /* padding-right: 0.5rem; */
}

.cart-items::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.cart-items::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.cart-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(-4px);
}

.cart-total {
    /* font-size: 1.75rem; */
    font-weight: 700;
    /* margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border);
    color: var(--text-primary); */
}

/* Modern Buttons */
.checkout-btn,
.btn,
button[type="submit"],
button {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: #fff;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-family: inherit;
}

.checkout-btn:hover,
.btn:hover,
button[type="submit"]:hover,
button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--secondary-dark) 0%, #047857 100%);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #4338ca 100%);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--danger-dark) 0%, #b91c1c 100%);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Modern Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-primary);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-top: 1.5rem;
}

table thead {
    /* background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); */
    background: linear-gradient(180deg, #97d197 0%, #0b160a 100%);
    color: #fff;
}

table th {
    padding: 1rem 1.25rem;
    text-align: right;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

table tbody tr {
    transition: all 0.2s ease;
}

table tbody tr:hover {
    background: var(--bg-secondary);
    transform: scale(1.01);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* Modern Forms */
form {
    background: var(--bg-primary);
    /* padding: 2rem; */
    border-radius: var(--radius-lg);
    /* box-shadow: var(--shadow-md);
    border: 1px solid var(--border); */
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    margin-bottom: 1.25rem;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Table form inputs */
table input,
table select {
    margin-bottom: 0;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
}

table input:focus,
table select:focus {
    transform: none;
}

/* Page Headers */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.page-header h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

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

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

.flex {
    display: flex;
}

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

.gap-2 {
    gap: 1rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Responsive */
@media (max-width: 768px) {
    .pos-container {
        flex-direction: column;
    }

    .pos-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .pos-main {
        padding: 1rem;
    }

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