* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Inter", "Segoe UI", sans-serif;
}

body {
    background: #f4f6fb;
    color: #1f2937;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #111827;
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
}

.brand {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.nav a {
    color: #cbd5f5;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
}

.nav a.active,
.nav a:hover {
    background: #1f2937;
    color: #fff;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}

.logout {
    color: #fca5a5;
    text-decoration: none;
}

.content {
    flex: 1;
    padding: 32px;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 28px;
    margin-bottom: 6px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 20px;
}

.card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.card h2 {
    margin-bottom: 16px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    margin-bottom: 14px;
}

input,
select,
textarea {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

button,
.button {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button.secondary {
    background: #e2e8f0;
    color: #1f2937;
}

.button.danger {
    background: #ef4444;
}

.button.small {
    padding: 6px 10px;
    font-size: 12px;
}

.alert {
    background: #fee2e2;
    color: #991b1b;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

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

.table.categories .table-row {
    grid-template-columns: 1.6fr 0.6fr 1fr;
}

.table-row {
    display: grid;
    grid-template-columns: 1.6fr 1fr 0.8fr 0.6fr 0.6fr 1fr;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.table-row.table-head {
    font-weight: 600;
}

.table-row.empty {
    grid-template-columns: 1fr;
}

.empty-cell {
    color: #6b7280;
    padding: 10px 0;
}

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-form {
    display: inline-flex;
}

.product-cell {
    display: flex;
    gap: 10px;
    align-items: center;
}

.product-cell img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    background: #e2e8f0;
}

.product-name {
    font-weight: 600;
}

.product-barcode {
    font-size: 12px;
    color: #6b7280;
}

.image-preview img {
    width: 100%;
    max-width: 220px;
    border-radius: 12px;
    margin-bottom: 10px;
}

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

.stat {
    background: #fff;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
}

.stat-label {
    color: #6b7280;
    font-size: 14px;
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #111827;
}

.login-card {
    background: #fff;
    padding: 32px;
    border-radius: 16px;
    width: 320px;
}

.login-card h1 {
    margin-bottom: 16px;
}

.login-form button {
    width: 100%;
    margin-top: 8px;
}

@media (max-width: 1024px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .table-row {
        grid-template-columns: 1.6fr 1fr 0.8fr 0.6fr;
    }
    .table-row > div:nth-child(5),
    .table-row > div:nth-child(6) {
        display: none;
    }
}

@media (max-width: 768px) {
    .app {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
    }
    .sidebar-footer {
        width: 100%;
        align-items: flex-start;
    }
    .content {
        padding: 20px;
    }
    .table-row {
        grid-template-columns: 1fr;
    }
}
