/* ----- تعریف فونت یکان ----- */
@font-face {
    font-family: 'IRANYekanX';
    src: url('../fonts/IRANYekanXFaNum-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'IRANYekanX';
    src: url('../fonts/IRANYekanXFaNum-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

/* ----- استایل‌های عمومی ----- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'IRANYekanX', Tahoma, sans-serif;
    background: #f1f5f9;
    padding: 20px;
    direction: rtl;
    min-height: 100vh;
}

a {
    text-decoration: none;
}

/* ----- صفحات ورود و ثبت‌نام ----- */
.login-box {
    max-width: 400px;
    margin: 100px auto;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}
.login-box h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}
.login-box label {
    display: block;
    margin: 10px 0 5px;
    font-weight: bold;
}
.login-box input,
.login-box select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    font-family: inherit;
}
.login-box button {
    width: 100%;
    padding: 12px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}
.login-box button:hover {
    background: #135e96;
}
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}
.success {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

/* ----- کانتینر اصلی و هدر ----- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    overflow: hidden;
    min-height: 80vh;
}

.header {
    background: #1e293b;
    color: #fff;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.header .header-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header .btn-logout {
    background: #ef4444;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    transition: 0.2s;
}
.header .btn-logout:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.header .btn-register-header {
    background: #8b5cf6;
    color: #fff;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    transition: 0.2s;
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}
.header .btn-register-header:hover {
    background: #7c3aed;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.4);
}
.header .btn-register-header:active {
    transform: scale(0.95);
}

.header .btn-register {
    background: #3b82f6;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    transition: 0.2s;
}
.header .btn-register:hover {
    background: #2563eb;
}

/* ----- داشبورد ----- */
.dashboard {
    padding: 30px 40px 50px;
    text-align: center;
}

.dashboard-title {
    font-size: 24px;
    color: #1e293b;
    margin-bottom: 30px;
    font-weight: bold;
}

.menu-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    background: #3b82f6;
    color: #fff;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 20px;
    font-weight: bold;
    transition: 0.3s;
}
.btn:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.btn-small {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 8px;
    background: #8b5cf6;
}
.btn-small:hover {
    background: #7c3aed;
}

/* =============================================
   صفحه محصولات
   ============================================= */
.products-panel {
    display: flex;
    flex-direction: row;
    padding: 20px;
    gap: 20px;
    align-items: stretch;
}

/* رفع کامل مشکل اسکرول با پیاده‌سازی Flexbox عمودی برای محاسبه دقیق فضای جدول */
.table-wrap {
    flex: 1;
    min-width: 340px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    height: 530px;
    display: flex;
    flex-direction: column; 
}

.table-scroll {
    flex: 1; 
    overflow-y: auto;
    overflow-x: auto;
}

.table-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.table-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.table-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.table-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 0;
    table-layout: auto;
}

.product-table th {
    background: #f1f5f9;
    padding: 8px 8px;
    border-bottom: 2px solid #cbd5e1;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
    text-align: right;
}

.product-table td {
    padding: 7px 8px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.product-table th:not(:first-child),
.product-table td:not(:first-child) {
    text-align: center;
}

.product-table tr {
    cursor: pointer;
    transition: 0.2s;
}
.product-table tr:hover {
    background: #e0f2fe;
}
.product-table tr.active {
    background: #bae6fd;
}

.product-table tr.row-error {
    background: #fee2e2;
}
.product-table tr.row-error:hover {
    background: #fecaca;
}
.product-table tr.row-error.active {
    background: #fca5a5;
}

.product-link {
    display: inline-block;
    color: #2563eb;
    text-decoration: none;
    font-size: 12px;
    padding: 3px 8px;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    background: #eff6ff;
    white-space: nowrap;
}

.product-link:hover {
    background: #dbeafe;
    text-decoration: underline;
}

.filter-bar {
    padding: 15px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    height: 40px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.filter-form select {
    padding: 6px 12px;
    border: none;
    font-family: inherit;
    font-size: 13px;
    background: transparent;
    cursor: pointer;
    outline: none;
    min-height: 32px;
    height: 32px;
    color: #1e293b;
    font-weight: 500;
    min-width: 160px;
}

.filter-form select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.edit-wrap {
    flex: 0 0 380px;
    min-width: 300px;
    max-width: 380px;
    background: #f8fafc;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    height: 530px;
    overflow-y: auto;
}

.edit-wrap h3 {
    margin-bottom: 15px;
    color: #1e293b;
    font-size: 16px;
}

.edit-wrap label {
    display: block;
    margin: 20px 0 8px;
    font-weight: bold;
    color: #334155;
    font-size: 12px;
}

.edit-wrap input,
.edit-wrap textarea,
.edit-wrap select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-family: inherit;
    font-size: 13px;
    background: #fff;
}

.edit-wrap input[readonly] {
    background: #f1f5f9;
    color: #475569;
    cursor: default;
}

.edit-wrap select {
    height: 35px;
    min-height: 35px;
    appearance: auto;
    cursor: pointer;
}

.edit-wrap input,
.edit-wrap textarea {
    min-height: 35px;
}

.edit-wrap textarea {
    resize: vertical;
    min-height: 80px;
}

.inline-row {
    display: flex;
    gap: 12px;
}

.inline-row .inline-item {
    flex: 1;
    min-width: 0;
}

.inline-row .inline-item label {
    margin: 20px 0 8px;
    font-size: 12px;
    display: block;
    font-weight: bold;
    color: #334155;
}

.inline-row .inline-item input {
    min-height: 35px;
    padding: 6px 10px;
    font-size: 13px;
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-family: inherit;
    background: #fff;
}

.inline-row .inline-item input[readonly] {
    background: #f1f5f9;
    color: #475569;
    cursor: default;
}

.edit-wrap #saveBtn {
    width: 100%;
    padding: 12px;
    background: #22c55e;
    color: #1e293b;
    border: none;
    border-radius: 5px;
    font-family: 'IRANYekanX';
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.2s;
}

.edit-wrap #saveBtn:hover {
    background: #16a34a;
    color: #fff;
}

/* =============================================
   پیام کشویی از سمت راست
   ============================================= */
#msg {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 9999;
    min-width: 280px;
    max-width: 450px;
    transform: translateX(120%);
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.15);
    direction: rtl;
}

#msg.show {
    transform: translateX(0);
}

#msg .success,
#msg .error {
    display: block;
    padding: 18px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#msg .success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

#msg .error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

#msg .success::before {
    content: "✓ ";
    font-weight: bold;
}

#msg .error::before {
    content: "✗ ";
    font-weight: bold;
}

/* =============================================
   صفحه تنظیمات (Settings)
   ============================================= */
.settings-panel {
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.settings-divider {
    margin: 35px 0;
    border: none;
    border-top: 2px dashed #e2e8f0;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    margin-bottom: 20px;
    color: #1e293b;
    font-size: 18px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.permissions-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.permissions-table th {
    background: #f1f5f9;
    padding: 12px 15px;
    text-align: center;
    border-bottom: 2px solid #cbd5e1;
}

.permissions-table td {
    padding: 10px 15px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.permissions-table td:first-child {
    text-align: right;
    font-weight: bold;
}

.permissions-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.btn-save {
    display: block;
    width: 100%;
    padding: 12px;
    background: #22c55e;
    color: #1e293b;
    border: none;
    border-radius: 5px;
    font-family: 'IRANYekanX';
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.2s;
}

.btn-save:hover {
    background: #16a34a;
    color: #fff;
}

/* =============================================
   مدیریت کاربران (Users Management)
   ============================================= */
.user-management-box {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.user-management-box h4 {
    margin-bottom: 15px;
    color: #1e293b;
    font-size: 15px;
}

.inline-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-row label {
    font-weight: bold;
    color: #334155;
    font-size: 13px;
}

.form-row input[type="text"],
.form-row input[type="password"] {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-family: inherit;
    font-size: 13px;
    background: #fff;
    min-height: 38px;
}

.form-row input[type="text"]:focus,
.form-row input[type="password"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.checkbox-row {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #dc2626;
}

.checkbox-row label {
    font-weight: normal;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
}

.warning-text {
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 15px;
    padding: 10px;
    background: #fef2f2;
    border-radius: 5px;
    border: 1px solid #fecaca;
}

.btn-update {
    padding: 10px 20px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-family: 'IRANYekanX';
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    align-self: flex-start;
}

.btn-update:hover {
    background: #2563eb;
}

.btn-delete {
    padding: 10px 20px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-family: 'IRANYekanX';
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    align-self: flex-start;
}

.btn-delete:hover {
    background: #b91c1c;
}

.delete-box {
    border-color: #fecaca;
    background: #fef2f2;
}

.users-management-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.users-management-table th {
    background: #f1f5f9;
    padding: 12px 15px;
    text-align: center;
    border-bottom: 2px solid #cbd5e1;
    font-size: 13px;
    white-space: nowrap;
}

.users-management-table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    font-size: 13px;
}

.users-management-table tr:hover {
    background: #f8fafc;
}

.users-management-table td:first-child {
    text-align: right;
    font-weight: bold;
}

.current-user-row {
    background: #f0fdf4;
}

.current-user-row:hover {
    background: #dcfce7;
}

.current-user-badge {
    display: inline-block;
    padding: 2px 10px;
    background: #22c55e;
    color: #fff;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin-right: 6px;
}

.disabled-action {
    padding: 4px 8px;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 12px;
    color: #94a3b8;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
}

.role-badge.role-admin {
    background: #8b5cf6;
}

.role-badge.role-observer {
    background: #3b82f6;
}

.user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.inline-action-form {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.role-select {
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
    background: #fff;
    min-height: 30px;
    min-width: 70px;
    cursor: pointer;
}

.role-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.action-input {
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
    min-height: 30px;
    min-width: 100px;
    background: #fff;
}

.action-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.action-input::placeholder {
    color: #94a3b8;
    font-size: 11px;
}

.btn-action {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    font-family: 'IRANYekanX';
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
    min-height: 30px;
}

.btn-action.btn-role {
    background: #8b5cf6;
    color: #fff;
}

.btn-action.btn-role:hover {
    background: #7c3aed;
}

.btn-action.btn-username {
    background: #3b82f6;
    color: #fff;
}

.btn-action.btn-username:hover {
    background: #2563eb;
}

.btn-action.btn-password {
    background: #f59e0b;
    color: #fff;
}

.btn-action.btn-password:hover {
    background: #d97706;
}

.btn-action.btn-delete {
    background: #ef4444;
    color: #fff;
}

.btn-action.btn-delete:hover {
    background: #dc2626;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #ef4444;
    margin: 0;
}

.delete-form {
    background: #fef2f2;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #fecaca;
}

/* =============================================
   MEDIA QUERIES (پاسخگرایی کامل کدهای جدید)
   ============================================= */

@media (max-width: 1024px) {
    .products-panel {
        flex-direction: column;
        align-items: stretch;
    }
    .table-wrap {
        width: 100%;
        min-width: unset;
        height: 400px;
        display: flex;
        flex-direction: column; /* اصلاح استایل مجدد فلکس در رزولوشن تبلت */
    }
    .edit-wrap {
        width: 100%;
        min-width: unset;
        height: 400px;
    }
    .settings-panel {
        padding: 20px;
    }
    .user-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .inline-action-form {
        flex-wrap: wrap;
    }
    .users-management-table {
        font-size: 12px;
    }
    .users-management-table th,
    .users-management-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 12px 15px;
    }
    .header .header-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    .header .btn-logout,
    .header .btn-register-header,
    .header .btn-register {
        font-size: 12px;
        padding: 6px 14px;
    }
    .dashboard {
        padding: 20px 15px 30px;
    }
    .dashboard-title {
        font-size: 20px;
    }
    .btn {
        padding: 12px 24px;
        font-size: 16px;
    }
    .btn-small {
        padding: 8px 16px;
        font-size: 14px;
    }
    .products-panel {
        padding: 10px;
        gap: 15px;
    }
    .table-wrap {
        height: 350px;
        display: flex;
        flex-direction: column; /* تضمین رفتار فلکس‌باکس در موبایل افقی */
    }
    .edit-wrap {
        height: 350px;
    }
    .product-table {
        font-size: 12px;
        min-width: 450px;
    }
    .product-table th,
    .product-table td {
        padding: 8px 10px;
    }
    .edit-wrap {
        padding: 15px;
    }
    .edit-wrap h3 {
        font-size: 16px;
    }
    .edit-wrap label {
        font-size: 12px;
        margin: 15px 0 6px;
    }
    .edit-wrap input,
    .edit-wrap textarea,
    .edit-wrap select {
        font-size: 13px;
        padding: 8px 10px;
        min-height: 38px;
        height: 38px;
    }
    .edit-wrap textarea {
        min-height: 70px;
    }
    .edit-wrap #saveBtn {
        font-size: 14px;
        padding: 10px;
    }
    .login-box {
        margin: 50px auto;
        padding: 20px;
    }
    .settings-panel {
        padding: 15px;
    }
    .form-row input[type="text"],
    .form-row input[type="password"] {
        font-size: 14px;
        padding: 10px 12px;
    }
    .btn-update,
    .btn-delete {
        width: 100%;
        align-self: stretch;
        text-align: center;
    }
    .checkbox-row {
        flex-wrap: wrap;
    }
    .filter-bar {
        padding: 10px 12px;
        justify-content: flex-start;
    }
    .filter-form {
        padding: 4px 12px;
        height: 36px;
        width: 100%;
        max-width: 240px;
    }
    .filter-form select {
        padding: 4px 10px;
        font-size: 13px;
        min-height: 28px;
        height: 28px;
        min-width: 120px;
    }
    .inline-row {
        flex-direction: column;
        gap: 0;
    }
    .inline-row .inline-item label {
        margin: 15px 0 6px;
    }
    #msg {
        top: 20px;
        right: 20px;
        left: 20px;
        min-width: unset;
        max-width: none;
        transform: translateY(-120%);
    }
    #msg.show {
        transform: translateY(0);
    }
    .users-management-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .users-management-table th,
    .users-management-table td {
        padding: 6px 8px;
        font-size: 11px;
    }
    .users-management-table td:first-child {
        text-align: center;
    }
    .user-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    .inline-action-form {
        flex-wrap: wrap;
        justify-content: center;
    }
    .action-input {
        min-width: 80px;
        font-size: 11px;
    }
    .role-select {
        font-size: 11px;
        min-width: 60px;
    }
    .btn-action {
        font-size: 11px;
        padding: 3px 10px;
        min-height: 26px;
    }
    .current-user-badge {
        font-size: 10px;
        padding: 1px 8px;
    }
}

@media (max-width: 480px) {
    .product-table {
        font-size: 11px;
        min-width: 350px;
    }
    .product-table th,
    .product-table td {
        padding: 6px 8px;
    }
    .edit-wrap label {
        font-size: 11px;
        margin: 12px 0 5px;
    }
    .edit-wrap input,
    .edit-wrap textarea,
    .edit-wrap select {
        font-size: 12px;
        padding: 6px 8px;
        min-height: 34px;
        height: 34px;
    }
    .header span {
        font-size: 14px;
    }
    .header .btn-logout,
    .header .btn-register-header,
    .header .btn-register {
        font-size: 11px;
        padding: 5px 12px;
    }
    .settings-panel {
        padding: 10px;
    }
    .user-management-box {
        padding: 15px;
    }
    .form-row input[type="text"],
    .form-row input[type="password"] {
        font-size: 13px;
        padding: 8px 10px;
        min-height: 34px;
    }
    .btn-update,
    .btn-delete {
        font-size: 13px;
        padding: 8px 16px;
    }
    .filter-bar {
        padding: 8px 10px;
    }
    .filter-form {
        padding: 4px 10px;
        height: 32px;
        max-width: 180px;
    }
    .filter-form select {
        padding: 2px 8px;
        font-size: 12px;
        min-height: 24px;
        height: 24px;
        min-width: 100px;
    }
    .table-wrap {
        height: 300px;
        display: flex;
        flex-direction: column; /* تضمین رفتار فلکس‌باکس در موبایل عمودی کوچک */
    }
    .edit-wrap {
        height: 300px;
    }
    #msg {
        top: 15px;
        right: 15px;
        left: 15px;
    }
}

/* =============================================
   بخش دریافت خودکار قیمت از سایت دیگر (products.php)
   ============================================= */
.divider-tight {
    margin: 16px 0;
}

.section-title-bold {
    font-weight: bold;
}

.field-label-mt10 {
    margin-top: 10px;
}

.price-mode-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.radio-option-label{
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: normal;
    white-space: nowrap;
    margin: 6px 0 6px !important;
}

.radio-option-label input[type="radio"] {
    width: auto;
    min-height: auto;
    height: auto;
    margin: 3px 3px 0px;
    flex-shrink: 3;
}

.price-mode-per-unit-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

#pack_quantity {
    width: 60px;
    max-width: 60px;
    flex: 0 0 60px;
    text-align: center;
    display: none;
}

#pack_quantity_suffix {
    display: none;
    white-space: nowrap;
}

#pack_quantity_hint {
    font-size: 11px;
    color: #94a3b8;
    margin: 2px 0 8px;
    display: none;
}

#scrapeInfo {
    font-size: 12px;
    color: #64748b;
    margin: 4px 0 10px;
}

.last-update-info {
    font-size: 12px;
    color: #64748b;
    margin: 10px 0 4px;
}

.btn-block-mb12 {
    width: 100%;
    margin-bottom: 12px;
}

.empty-state-cell {
    text-align: center;
    padding: 30px;
    color: #6b7280;
}

.text-muted {
    color: #94a3b8;
}