/* ── کانتینر اصلی ─────────────────────────────── */
.abjad-calculator-container {
    max-width: 680px; margin: 30px auto;
    font-family: Tahoma, Arial, sans-serif; direction: rtl;
}
.abjad-login-notice {
    max-width: 680px; margin: 30px auto; padding: 20px;
    background: #fff8e1; border-right: 4px solid #f0ad4e;
    border-radius: 8px; font-family: Tahoma, sans-serif; direction: rtl;
}
.abjad-login-notice a { color: #667eea; font-weight: bold; }

/* ── نوار موجودی ─────────────────────────────── */
.abjad-balance-bar {
    background: #f0f4ff; border: 1px solid #c5cff5;
    border-radius: 8px 8px 0 0; padding: 10px 18px;
    font-size: 14px; color: #444; direction: rtl;
}
.abjad-balance-num { color: #667eea; font-size: 18px; font-weight: bold; }

/* ── تب‌ها ───────────────────────────────────── */
.abjad-tabs-nav {
    display: flex; gap: 4px;
    border-bottom: 3px solid #667eea; flex-wrap: wrap;
}
.abjad-tab-btn {
    padding: 10px 22px; cursor: pointer;
    background: #f0f0f0; border: 1px solid #ddd; border-bottom: none;
    font-size: 14px; font-weight: bold; font-family: inherit;
    color: #666; border-radius: 6px 6px 0 0;
    transition: background .2s, color .2s;
}
.abjad-tab-btn.active, .abjad-tab-btn:hover {
    background: #667eea; color: #fff; border-color: #667eea;
}
.abjad-tab-panel {
    display: none; background: #fff;
    border: 1px solid #ddd; border-top: none;
    border-radius: 0 0 10px 10px; padding: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,.07);
}
.abjad-tab-panel.active { display: block; }

/* ── فرم اسامی ───────────────────────────────── */
.abjad-form-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.abjad-form-group { flex: 1; min-width: 160px; }
.abjad-form-group label {
    display: block; font-size: 13px; font-weight: bold;
    color: #444; margin-bottom: 5px;
}
.abjad-form-group input[type=text] {
    width: 100%; padding: 10px 12px; border: 2px solid #e0e0e0;
    border-radius: 6px; font-size: 15px; font-family: inherit;
    box-sizing: border-box; direction: rtl;
    transition: border-color .25s;
}
.abjad-form-group input[type=text]:focus { outline: none; border-color: #667eea; }
.abjad-form-error {
    background: #fff3f3; color: #c0392b; border: 1px solid #f5c6cb;
    border-radius: 6px; padding: 9px 13px; margin-bottom: 12px; font-size: 13px;
}

/* ── دکمه‌ها ─────────────────────────────────── */
.abjad-btn {
    border: none; border-radius: 7px; cursor: pointer;
    font-family: inherit; font-weight: bold; transition: .2s;
}
.abjad-btn-primary {
    width: 100%; padding: 13px;
    background: linear-gradient(135deg,#667eea,#764ba2);
    color: #fff; font-size: 16px;
}
.abjad-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 14px rgba(102,126,234,.4); }

/* ── لودینگ ──────────────────────────────────── */
.abjad-loading {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 0; color: #666;
}
.abjad-spinner {
    border: 3px solid #f3f3f3; border-top-color: #667eea;
    border-radius: 50%; width: 28px; height: 28px;
    animation: abjad-spin .8s linear infinite; flex-shrink: 0;
}
@keyframes abjad-spin { to { transform: rotate(360deg); } }

/* ── نتایج ابجد اسامی ────────────────────────── */
.abjad-step2 { animation: abjad-fadein .35s ease; }
@keyframes abjad-fadein { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }

.abjad-name-pills {
    display: flex; gap: 10px; flex-wrap: wrap;
    background: #f8f9fa; padding: 14px 16px;
    border-radius: 8px; margin-bottom: 20px;
}
.abjad-pill {
    background: #fff; border: 1px solid #dde;
    border-radius: 20px; padding: 6px 14px;
    display: flex; align-items: center; gap: 7px;
}
.pill-lbl { font-size: 12px; color: #888; }
.pill-num { color: #667eea; font-weight: bold; font-size: 15px; }

/* ── کارت‌های دکمه محاسبه ────────────────────── */
.abjad-calc-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px; margin-bottom: 20px;
}
.abjad-calc-card {
    background: #fff; border: 2px solid #e8e8f0;
    border-radius: 10px; padding: 14px 12px; text-align: center;
    transition: border-color .2s, box-shadow .2s;
}
.abjad-calc-card:hover { border-color: #667eea; box-shadow: 0 4px 12px rgba(102,126,234,.15); }
.abjad-calc-card-name { font-size: 13px; font-weight: bold; color: #333; margin-bottom: 4px; }
.abjad-calc-card-cost { font-size: 11px; color: #e67e22; margin-bottom: 8px; }
.abjad-btn-run {
    background: linear-gradient(135deg,#667eea,#764ba2);
    color: #fff; padding: 7px 18px; font-size: 13px; width: 100%;
}
.abjad-btn-run:hover { opacity: .9; transform: translateY(-1px); }

/* ── کادر نتیجه محاسبه ───────────────────────── */
.abjad-result-box {
    background: linear-gradient(135deg,#667eea,#764ba2);
    color: #fff; border-radius: 10px; padding: 20px 24px;
    text-align: center; animation: abjad-fadein .3s ease;
}
.abjad-result-name { font-size: 13px; opacity: .85; margin-bottom: 8px; }
.abjad-result-label { font-size: 22px; font-weight: bold; }

/* ── ریسپانسیو ───────────────────────────────── */
@media (max-width: 520px) {
    .abjad-tab-panel    { padding: 16px 12px; }
    .abjad-form-row     { flex-direction: column; }
    .abjad-calc-buttons { grid-template-columns: 1fr 1fr; }
}



/* ── فیلد اجباری ─────────────────────────────── */
.abjad-req { color: #e74c3c; font-size: 12px; }

/* ── خواهر/برادر ─────────────────────────────── */
.abjad-siblings-wrap {
    margin-bottom: 16px;
    border: 1px dashed #c5cff5;
    border-radius: 8px;
    padding: 12px 14px;
    background: #fafbff;
}
.abjad-siblings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.abjad-siblings-title {
    font-size: 13px;
    font-weight: bold;
    color: #555;
}
.abjad-btn-add-sibling {
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s;
}
.abjad-btn-add-sibling:hover { background: #5568d4; }

.abjad-siblings-list { display: flex; flex-direction: column; gap: 8px; }

.abjad-sibling-row label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: #666;
    margin-bottom: 3px;
}
.abjad-sibling-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}
.abjad-sibling-input-wrap input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    direction: rtl;
}
.abjad-sibling-input-wrap input:focus { outline: none; border-color: #667eea; }

.abjad-btn-remove-sibling {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
    color: #c0392b;
    line-height: 1;
    flex-shrink: 0;
    transition: background .2s;
}
.abjad-btn-remove-sibling:hover { background: #fff3f3; border-color: #e74c3c; }

/* ── پیل‌ها (ابجد اسامی) — ۳ خط ────────────── */
.abjad-pill {
    background: #fff;
    border: 1px solid #dde;
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 70px;
}
.pill-lbl  { font-size: 11px; color: #aaa; }
.pill-name { font-size: 13px; color: #333; font-weight: bold; }
.pill-num  { color: #667eea; font-weight: bold; font-size: 15px; }



/* ══════════════════════════════════════════════
   لاگ محاسبات — فرانت ([abjad_user_logs])
   ══════════════════════════════════════════════ */
.abjad-logs-container {
    max-width: 720px; margin: 20px auto;
    font-family: Tahoma, Arial, sans-serif; direction: rtl;
}
.abjad-logs-title {
    font-size: 20px; color: #333;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px; margin-bottom: 16px;
}
.abjad-logs-empty {
    padding: 30px; text-align: center;
    background: #f8f9ff; border: 1px dashed #c5cff5;
    border-radius: 8px; color: #999;
}
.abjad-logs-count {
    font-size: 13px; color: #888; margin-bottom: 14px;
}
.abjad-logs-list { display: flex; flex-direction: column; gap: 12px; }

.abjad-log-card {
    background: #fff;
    border: 1px solid #e8e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    transition: box-shadow .2s;
}
.abjad-log-card:hover { box-shadow: 0 4px 14px rgba(102,126,234,.12); }

.abjad-log-card-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 10px 16px;
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.abjad-log-tab {
    background: rgba(255,255,255,.25);
    color: #fff; font-size: 12px;
    padding: 2px 10px; border-radius: 10px;
}
.abjad-log-calc {
    color: #fff; font-weight: bold; font-size: 14px; flex: 1;
}
.abjad-log-time {
    color: rgba(255,255,255,.75); font-size: 11px; direction: ltr;
}
.abjad-log-cost {
    background: rgba(230,126,34,.8);
    color: #fff; font-size: 11px;
    padding: 2px 8px; border-radius: 10px;
}

.abjad-log-card-body {
    padding: 14px 16px;
    display: flex; flex-wrap: wrap;
    justify-content: space-between; align-items: center; gap: 10px;
}
.abjad-log-inputs {
    display: flex; flex-wrap: wrap; gap: 8px; flex: 1;
}
.abjad-log-input-item {
    display: flex; flex-direction: column; align-items: center;
    background: #f8f9ff; border: 1px solid #dde;
    border-radius: 8px; padding: 5px 10px; min-width: 56px;
}
.log-inp-lbl { font-size: 10px; color: #aaa; }
.log-inp-val { font-size: 14px; font-weight: bold; color: #667eea; }

.abjad-log-result {
    display: flex; flex-direction: column; align-items: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff; border-radius: 8px;
    padding: 8px 18px; min-width: 100px; text-align: center;
}
.log-result-label { font-size: 10px; opacity: .8; margin-bottom: 3px; }
.log-result-value { font-size: 17px; font-weight: bold; }








/* ── تطبیق اسماء ─────────────────────────────── */
.abjad-match-container {
    max-width: 680px; margin: 20px auto; direction: rtl;
    font-family: Tahoma, Arial, sans-serif;
}
.abjad-match-title {
    font-size: 20px; color: #333;
    border-bottom: 3px solid #667eea; padding-bottom: 10px; margin-bottom: 18px;
}
.abjad-match-abjad-row {
    background: #f0f4ff; border: 1px solid #c5cff5;
    border-radius: 8px; padding: 12px 16px; margin-bottom: 18px;
    font-size: 16px;
}
.abjad-match-abjad-row strong { color: #667eea; font-size: 20px; margin: 0 4px; }
.match-abjad-num { color: #764ba2; font-size: 22px; font-weight: bold; margin-right: 6px; }

.abjad-match-exact h4, .abjad-match-nearby h4 {
    color: #333; margin-bottom: 12px;
    border-bottom: 1px solid #eee; padding-bottom: 6px;
}
.abjad-match-exact h4 { color: #27ae60; }

.abjad-match-item {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    padding: 10px 14px; border: 1px solid #e8e8f0; border-radius: 8px;
    margin-bottom: 8px; background: #fff; transition: box-shadow .2s;
}
.abjad-match-item:hover { box-shadow: 0 2px 8px rgba(102,126,234,.15); }
.abjad-match-exact-item { border-color: #a8e6c0; background: #f0fff4; }

.mi-name  { font-weight: bold; font-size: 16px; color: #333; flex: 1; }
.mi-abjad { background: #667eea; color: #fff; padding: 2px 10px; border-radius: 10px; font-size: 13px; }
.mi-cat   { background: #f0f0f0; color: #666; padding: 2px 8px; border-radius: 8px; font-size: 12px; }
.mi-extra { color: #888; font-size: 12px; }
.abjad-no-match { color: #999; font-style: italic; padding: 10px 0; }

/* ── شریک (فرم‌های سفارشی) ───────────────────── */
.abjad-single-form .abjad-tab-body {
    border: 1px solid #ddd; border-top: none;
    border-radius: 0 0 10px 10px; padding: 24px;
    background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.07);
}



/* ── پشته نتایج محاسبات ─────────────────────── */
.abjad-results-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}
.abjad-results-stack .abjad-result-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.abjad-results-stack .abjad-result-name {
    font-size: 14px;
    opacity: 0.85;
}
.abjad-results-stack .abjad-result-label {
    font-size: 20px;
    font-weight: bold;
}

/* ── پیام محدودیت max ───────────────────────── */
.abjad-max-msg {
    display: inline-block;
    margin-right: 8px;
    font-size: 12px;
    color: #e67e22;
}

/* ── خطا در محاسبه ──────────────────────────── */
.abjad-result-box.abjad-result-error {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
}
.abjad-result-box.abjad-result-error .abjad-result-label {
    font-size: 15px;
}
