/* ==================================================
   🎨 پوسته مدرن — فونت کامل با تست و بررسی
   ================================================== */
/* پس‌زمینه گرادیانی جذاب */
body.login-bg {
    margin: 0;
    font-family: Vazirmatn, sans-serif;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* باکس اصلی */
.login-container {
    width: 100%;
    max-width: 360px;
    padding: 20px;
}

.login-card {
    background: #ffffffdd;
    backdrop-filter: blur(10px);
    padding: 35px 30px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    text-align: center;
}

.login-card h2 {
    margin-bottom: 25px;
    color: #333;
    font-weight: 700;
}

/* پیام خطا */
.alert.error {
    background: #ffdddd;
    color: #a30000;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* ورودی‌ها */
.input-group {
    position: relative;
    margin-bottom: 22px;
}

.input-group input {
    width: 100%;
    padding: 12px 10px;
    font-size: 15px;
    border: 2px solid #ccc;
    border-radius: 10px;
    outline: none;
    transition: 0.3s;
    background: #fff;
}

.input-group input:focus {
    border-color: #4f46e5;
}

.input-group label {
    position: absolute;
    right: 12px;
    top: -8px;
    background: white;
    padding: 0 4px;
    font-size: 13px;
    color: #444;
}

/* دکمه ورود */
.login-btn {
    width: 100%;
    padding: 12px;
    background: #4f46e5;
    border: none;
    color: white;
    font-size: 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.25s;
}

.login-btn:hover {
    background: #4239d3;
}

/* رمز پیش‌فرض */
.default-pass {
    margin-top: 15px;
    font-size: 13px;
    color: #555;
}

.default-pass code {
    background: #eee;
    padding: 2px 6px;
    border-radius: 6px;
}

/* --- فونت وزیر با fallback بیشتر --- */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2'),
         url('../fonts/Vazirmatn-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2'),
         url('../fonts/Vazirmatn-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2'),
         url('../fonts/Vazirmatn-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* --- ریست و اعمال فونت به همه چیز --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body,
div,
span,
h1, h2, h3, h4, h5, h6,
p,
a,
em,
strong,
ul, ol, li,
form,
label,
table,
tbody,
thead,
tr,
th,
td,
article,
aside,
footer,
header,
nav,
section,
input,
button,
select,
textarea,
option {
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif !important;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif !important;
    background-color: #f5f7fb;
    color: #333;
    line-height: 1.6;
    direction: rtl;
    padding-bottom: 2rem;
}

/* --- متغیرهای رنگی --- */
:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --success: #4cc9f0;
    --danger: #e63946;
    --danger-dark: #d62839;
    --light: #f8f9fa;
    --dark: #212529;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-600: #6c757d;
    --border-radius: 8px;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.3s ease;
}

/* === هدر === */
header {
    background: linear-gradient(135deg, var(--primary), #3a05a3);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif !important;
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === منو === */
nav {
    background: white;
    padding: 0.5rem 2rem;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
    border-bottom: 1px solid var(--gray-200);
}

nav a {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif !important;
    text-decoration: none;
    color: var(--gray-600);
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    display: inline-block;
}

nav a:hover, nav a.active {
    background: var(--primary);
    color: white;
}

/* === محتوا اصلی === */
main {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1rem;
}

/* === کارت‌ها === */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
}

.card h2, .card h3 {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif !important;
    color: var(--dark);
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === فرم‌ها === */
form {
    display: grid;
    gap: 1rem;
}

label {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif !important;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.3rem;
    display: block;
}

input, select, textarea {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif !important;
    padding: 0.65rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

input::placeholder,
textarea::placeholder {
    color: #999;
}

select option {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif !important;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

button {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif !important;
    font-weight: 600;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(67, 97, 238, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(67, 97, 238, 0.05);
}

.btn-logout,
.logout {
    background: var(--danger) !important;
    color: white !important;
    border: none !important;
}

.btn-logout:hover,
.logout:hover {
    background: var(--danger-dark) !important;
    box-shadow: 0 4px 8px rgba(230, 57, 70, 0.3) !important;
}

/* === آلرت‌ها === */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-top: 0.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* === جدول === */
.table-responsive {
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--gray-200);
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--dark);
}

tr:hover td {
    background-color: #f8fafc;
}

/* === مودال === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    animation: slideUp 0.4s;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 1.2rem;
    left: 1.2rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    background: #f8f9fa;
    border: none;
}

.close-modal:hover {
    background: #e9ecef;
    color: var(--danger);
}

.modal h2 {
    margin-bottom: 1.5rem;
    color: var(--dark);
    font-weight: 700;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal h3 {
    font-weight: 600;
}

.score-group {
    margin: 1.5rem 0;
}

.score-group h3 {
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-scores {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.quick-score-btn {
    background: #eef2ff;
    color: var(--primary);
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-score-btn:hover {
    background: #dbeafe;
    transform: translateY(-2px);
}

.quick-score-btn.reset-score {
    background: #fee2e2;
    color: var(--danger);
    border-color: #fecaca;
}

.quick-score-btn.reset-score:hover {
    background: #fecaca;
}

/* === Toast === */
#toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    z-index: 2000;
    transform: translateX(200%);
    transition: transform 0.4s ease;
    max-width: 380px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* === جستجوی زنده === */
.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-box input {
    padding-right: 40px;
    width: 100%;
}

/* === دکمه بالا === */
#backToTop {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    border: none;
}

#backToTop.show {
    opacity: 1;
}

#backToTop:hover {
    transform: translateY(-3px);
}

/* === برچسب‌های پلتفرم === */
.platform-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.platform-badge.whatsapp { background: #25D366; color: white; }
.platform-badge.eitaa { background: #f57803; color: white; }
.platform-badge.bale { background: #00AEEF; color: white; }
.platform-badge.soroush { background: #6A4DFF; color: white; }
.platform-badge.rubika { background: #ff0090; color: white; }

.score-badge {
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.score-badge .icon {
    margin-left: 4px;
}

/* === hover سطرها === */
#customersTable tbody tr {
    transition: background-color 0.2s;
}

#customersTable tbody tr:hover {
    background-color: #f8fafc;
}

#customersTable tbody tr:hover .edit-btn {
    background: #e3f2fd;
    border-color: #2196f3;
}

.edit-btn {
    padding: 0.4rem 0.6rem;
    transition: all 0.2s;
}

/* === ریسپانسیو === */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    nav {
        padding: 0.5rem 1rem;
    }
    nav a {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }
    main {
        padding: 0 0.5rem;
    }
    .card {
        padding: 1.2rem;
    }
    .quick-scores {
        grid-template-columns: repeat(3, 1fr);
    }
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem auto;
    }
    table {
        font-size: 0.9rem;
    }
    th, td {
        padding: 0.5rem;
    }
}
/* ===============================
   🌗 سوییچ دارک‌مود (نسخه بدون تداخل)
================================ */

/* سوییچ دارک مود وسط هدر */
.theme-toggle {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;

}

.theme-toggle input {
    display: none;
}

.toggle-label {
    width: 60px;
    height: 30px;
    background: #cbd5e1;
    border-radius: 50px;
    position: relative;
    cursor: pointer;
    padding: 4px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-label .sun,
.toggle-label .moon {
    position: absolute;
    font-size: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.toggle-label .sun { left: 8px; }
.toggle-label .moon { right: 8px; }

.toggle-label::after {
    content: "";
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    position: absolute;
    right: 4px;
    top: 4px;
    transition: 0.3s;
}

.theme-toggle input:checked + .toggle-label {
    background: #1e293b;
}

.theme-toggle input:checked + .toggle-label::after {
    transform: translateX(-32px);
}

/* ===============================
      🌙 Dark Mode — Panel
================================ */

/* پس‌زمینه کلی */
body.dark-mode {
    background: #0f172a !important;
    color: #e2e8f0 !important;
}

/* هدر */
body.dark-mode header {
    background: linear-gradient(135deg, #1e293b, #0f172a) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4) !important;
}

/* منو */
body.dark-mode nav {
    background: #1e293b !important;
    border-bottom-color: #334155 !important;
}

body.dark-mode nav a {
    color: #cbd5e1 !important;
}

body.dark-mode nav a:hover,
body.dark-mode nav a.active {
    background: #334155 !important;
}

/* کارت‌ها */
body.dark-mode .card {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    box-shadow: 0 0 20px rgba(0,0,0,0.4) !important;
}

/* تیتر کارت‌ها */
body.dark-mode .card h2,
body.dark-mode .card h3 {
    color: #f1f5f9 !important;
}

/* ورودی‌ها */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(96,165,250,0.25) !important;
}

/* دکمه‌ها */
body.dark-mode .btn-primary {
    background: #3b82f6 !important;
}
body.dark-mode .btn-outline {
    border-color: #3b82f6 !important;
    color: #3b82f6 !important;
}

/* جدول */
body.dark-mode table {
    color: #e2e8f0 !important;
}
body.dark-mode th {
    background: #1e293b !important;
}
body.dark-mode td {
    background: #0f172a !important;
}
body.dark-mode tr:hover td {
    background: #1e2535 !important;
}

/* مودال */
body.dark-mode .modal-content {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

/* Toast */
body.dark-mode #toast {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}
