.page-products{
    direction:rtl;
    padding:24px;
}
.page-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:20px;
}
.page-header h1{
    margin:0 0 6px;
    font-size:28px;
    font-weight:800;
}
.page-header p{
    margin:0;
    color:#6b7280;
}
.stats-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:16px;
    margin-bottom:20px;
}
.stat-card,.card{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:20px;
    box-shadow:0 12px 32px rgba(15,23,42,.05);
}
.stat-card{
    padding:20px;
}
.stat-card span{
    display:block;
    font-size:14px;
    color:#6b7280;
    margin-bottom:8px;
}
.stat-card strong{
    font-size:30px;
}
.card{
    padding:20px;
    margin-bottom:20px;
}
.card-title{
    margin:0 0 18px;
    font-size:18px;
    font-weight:800;
}
.card-title-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
    margin-bottom:18px;
}
.toolbar{
    display:flex;
    gap:16px;
    align-items:end;
    flex-wrap:wrap;
}
.field-grow{flex:1 1 320px}
.form-grid{
    display:grid;
    grid-template-columns:1.3fr 1fr;
    gap:20px;
}
.form-row{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
    margin-bottom:16px;
}
.form-row > div,
.toolbar > div{
    display:flex;
    flex-direction:column;
    gap:8px;
}
label{
    font-size:14px;
    font-weight:700;
    color:#111827;
}
input[type="text"],
input[type="number"],
input[type="file"],
select,
textarea{
    width:100%;
    border:1px solid #d1d5db;
    border-radius:14px;
    padding:12px 14px;
    outline:none;
    background:#fff;
    font-size:14px;
    box-sizing:border-box;
}
textarea{resize:vertical}
input:focus, select:focus, textarea:focus{
    border-color:#4f46e5;
    box-shadow:0 0 0 3px rgba(79,70,229,.12);
}
.btn-primary,.btn-secondary,.btn-light,.btn-danger{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    text-decoration:none;
    border:none;
    cursor:pointer;
    border-radius:14px;
    padding:12px 18px;
    font-weight:800;
}
.btn-primary{background:#111827;color:#fff}
.btn-secondary{background:#4f46e5;color:#fff}
.btn-light{background:#f3f4f6;color:#111827}
.btn-danger{background:#dc2626;color:#fff}
.sm{padding:8px 12px;border-radius:10px;font-size:12px}
.toolbar-actions,.actions,.form-actions{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
}
.table-card{padding:0;overflow:hidden}
.table-responsive{overflow:auto}
.product-table{
    width:100%;
    border-collapse:collapse;
    min-width:1100px;
}
.product-table th,.product-table td{
    padding:14px 16px;
    border-bottom:1px solid #f1f5f9;
    vertical-align:middle;
    text-align:right;
}
.product-table thead th{
    background:#f8fafc;
    font-size:13px;
    color:#475569;
}
.product-title{font-weight:800;margin-bottom:4px}
.product-meta{font-size:12px;color:#6b7280}
.old-price{
    text-decoration:line-through;
    color:#9ca3af;
    font-size:12px;
    margin-top:5px;
}
.product-thumb{
    width:64px;height:64px;border-radius:14px;
    overflow:hidden;background:#f8fafc;border:1px solid #e5e7eb;
    display:flex;align-items:center;justify-content:center;
    font-size:11px;color:#6b7280;
}
.product-thumb img,.preview-image img{
    width:100%;height:100%;object-fit:cover;
}
.preview-image{
    width:96px;height:96px;border-radius:18px;overflow:hidden;
    border:1px solid #e5e7eb;margin:10px 0 18px;
}
.badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:6px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
}
.badge.green{background:#dcfce7;color:#166534}
.badge.red{background:#fee2e2;color:#991b1b}
.badge.gray{background:#e5e7eb;color:#374151}
.alert{
    border-radius:16px;
    padding:14px 16px;
    margin-bottom:16px;
    font-weight:700;
}
.alert.success{background:#ecfdf5;color:#065f46;border:1px solid #a7f3d0}
.alert.error{background:#fef2f2;color:#991b1b;border:1px solid #fecaca}
.switch-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
    margin:18px 0;
}
.switch-box{
    border:1px solid #e5e7eb;
    border-radius:16px;
    padding:14px 16px;
    display:flex;
    align-items:center;
    gap:10px;
    cursor:pointer;
    background:#fafafa;
}
.variant-item{
    border:1px dashed #d1d5db;
    border-radius:18px;
    padding:16px;
    margin-bottom:16px;
    background:#fcfcff;
}
.variant-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:12px;
}
.check-line{
    display:flex;
    align-items:center;
    gap:10px;
    font-weight:700;
}
.empty-state{text-align:center;color:#6b7280;padding:28px}
.hidden{display:none!important}
@media (max-width: 1100px){
    .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .form-grid{grid-template-columns:1fr}
}
@media (max-width: 768px){
    .page-products{padding:16px}
    .page-header{flex-direction:column;align-items:stretch}
    .stats-grid{grid-template-columns:1fr}
    .form-row,.switch-grid{grid-template-columns:1fr}
    .card-title-row,.form-actions,.toolbar-actions{flex-direction:column;align-items:stretch}
}
