/* استایل‌های رسمی افزونه حسابداری دائمی (Daemi) */
.daemi-admin-wrap {
    font-family: inherit;
    direction: rtl;
    text-align: right;
}
.daemi-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
}
.daemi-version-tag {
    font-size: 12px;
    background: #2563eb;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: normal;
}
.daemi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}
@media (max-width: 782px) {
    .daemi-grid {
        grid-template-columns: 1fr;
    }
}
.daemi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.daemi-form-group {
    margin-bottom: 15px;
}
.daemi-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #334155;
}
.daemi-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}
.daemi-badge-success { background: #dcfce7; color: #15803d; }
.daemi-badge-error   { background: #fee2e2; color: #b91c1c; }
.daemi-badge-pending { background: #f1f5f9; color: #475569; }

.daemi-info-table {
    width: 100%;
    border-collapse: collapse;
}
.daemi-info-table td {
    padding: 10px 4px;
    border-bottom: 1px solid #f1f5f9;
}

/* ==================== FRONTEND WIDGET: BRANCH STOCK ==================== */
.daemi-branch-stock-box {
    margin: 20px 0;
    padding: 16px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-right: 4px solid #2563eb;
    border-radius: 8px;
    direction: rtl;
    text-align: right;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.daemi-branch-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.daemi-branch-icon {
    font-size: 18px;
}
.daemi-branch-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.daemi-branch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 6px;
    font-size: 13px;
}
.daemi-branch-name {
    font-weight: 600;
    color: #334155;
}
.daemi-branch-status {
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
}
.daemi-branch-status.in-stock {
    background: #dcfce7;
    color: #15803d;
}
.daemi-branch-status.out-of-stock {
    background: #fee2e2;
    color: #b91c1c;
}

/* ==================== DAEMI AUTO-UPDATER MODAL ==================== */
.daemi-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    direction: rtl;
    box-sizing: border-box;
}

.daemi-modal-backdrop.is-active {
    display: flex;
    animation: daemiModalFadeIn 0.25s ease-out forwards;
}

@keyframes daemiModalFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.daemi-modal-dialog {
    background: #ffffff;
    width: 860px;
    max-width: 95vw;
    height: 540px;
    max-height: 92vh;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    font-family: inherit;
    position: relative;
}

.daemi-modal-header {
    height: 56px;
    padding: 0 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

.daemi-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.daemi-modal-close-btn {
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.daemi-modal-close-btn:hover {
    background: #fee2e2;
    color: #ef4444;
}

.daemi-modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* ستون سایدبار (راست در حالت راست‌چین) */
.daemi-modal-sidebar {
    width: 330px;
    background: #f8fafc;
    border-left: 1px solid #e2e8f0;
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.daemi-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.daemi-brand-icon {
    width: 42px;
    height: 42px;
    background: #0284c7;
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.daemi-brand-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.daemi-brand-info span {
    font-size: 11.5px;
    color: #64748b;
    display: block;
    margin-top: 2px;
}

.daemi-changelog-header {
    font-size: 12.5px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.daemi-cl-block {
    margin-bottom: 18px;
}

.daemi-ver-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    direction: ltr;
}

.daemi-badge-green {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.daemi-badge-purple {
    background: #f3e8ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}

.daemi-badge-orange {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.daemi-cl-section-title {
    font-size: 12px;
    font-weight: 700;
    margin: 6px 0 2px 0;
}

.daemi-txt-green  { color: #15803d; }
.daemi-txt-purple { color: #7e22ce; }
.daemi-txt-orange { color: #c2410c; }

.daemi-cl-list {
    list-style: none !important;
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
    font-size: 11.5px;
    line-height: 1.6;
    color: #334155;
}

.daemi-cl-list li {
    position: relative;
    padding-right: 14px;
    margin-bottom: 4px;
}

.daemi-cl-list li::before {
    content: "•";
    position: absolute;
    right: 0;
    color: #94a3b8;
    font-weight: bold;
}

/* ستون اصلی عملیات (چپ در حالت راست‌چین) */
.daemi-modal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 30px;
    background: #ffffff;
    overflow-y: auto;
    position: relative;
}

.daemi-stage-wrap {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* استپ‌ها */
.daemi-steps-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0 25px 0;
    text-align: right;
}

.daemi-step-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.daemi-step-item.is-running {
    background: #f0f9ff;
    border-color: #bae6fd;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08);
}

.daemi-step-item.is-done {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.daemi-step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    background: #e2e8f0;
    color: #94a3b8;
    font-weight: bold;
    transition: all 0.3s ease;
}

.daemi-step-item.is-running .daemi-step-icon {
    background: #0284c7;
    color: #ffffff;
    animation: daemiSpin 1s linear infinite;
}

.daemi-step-item.is-done .daemi-step-icon {
    background: #10b981;
    color: #ffffff;
}

@keyframes daemiSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.daemi-step-text {
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
}

.daemi-step-item.is-running .daemi-step-text {
    color: #0369a1;
    font-weight: 700;
}

.daemi-step-item.is-done .daemi-step-text {
    color: #15803d;
}

/* نوار پیشرفت */
.daemi-progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.daemi-progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.daemi-status-caption {
    font-size: 12.5px;
    color: #64748b;
    min-height: 20px;
}

/* کنترل‌ها */
.daemi-actions-wrap {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.daemi-btn-primary-action {
    background: #0284c7;
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    font-size: 13.5px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    transition: all 0.2s ease;
}

.daemi-btn-primary-action:hover {
    background: #0369a1;
    transform: translateY(-1px);
}

.daemi-file-drop-tip {
    font-size: 11.5px;
    color: #64748b;
}

.daemi-file-input-label {
    color: #0284c7;
    cursor: pointer;
    text-decoration: underline;
}

/* مرحله دوم: اتمام فرآیند و تبریک */
.daemi-finish-stage {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.daemi-finish-badge-wrap {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: #ecfdf5;
    border: 3px solid #a7f3d0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
    animation: daemiPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes daemiPop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.daemi-finish-badge-icon {
    font-size: 40px;
    color: #10b981;
}

.daemi-finish-title {
    font-size: 19px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.daemi-finish-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 24px 0;
}

/* دکمه قرمز پایان و خروج از مراحل نصب */
.daemi-btn-exit-install {
    background: #e11d48;
    color: #ffffff;
    border: none;
    padding: 12px 34px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(225, 29, 72, 0.3);
    transition: all 0.2s ease;
}

.daemi-btn-exit-install:hover {
    background: #be123c;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(225, 29, 72, 0.4);
}

/* ==================== MODERN SUITE DASHBOARD ==================== */
.daemi-dash-container {
    margin-top: 15px;
    font-family: inherit;
    direction: rtl;
    width: 100%;
    box-sizing: border-box;
}

/* پوشش نوار ریبون در صفحات ووکامرس (کالاها و سفارشات) */
.daemi-shop-ribbon-wrap {
    clear: both !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 15px 0 20px 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    float: none !important;
}

/* نوار ریبون منوی آیکونی بنفش تیره حسابداری دائمی */
.daemi-ribbon-bar {
    display: flex;
    background: #4338ca;
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-shadow: 0 4px 15px rgba(67, 56, 202, 0.2);
    margin-bottom: 20px;
    border: 1px solid #3730a3;
    width: 100% !important;
    box-sizing: border-box !important;
    clear: both !important;
}

.daemi-ribbon-bar::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.daemi-ribbon-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 11px 4px;
    color: #e0e7ff;
    text-decoration: none !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.daemi-ribbon-item:last-child {
    border-left: none;
}

.daemi-ribbon-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: translateY(-1px);
}

.daemi-ribbon-item.is-active {
    background: #4f46e5;
    color: #ffffff;
    box-shadow: inset 0 -3px 0 #38bdf8;
    font-weight: 700;
}

.daemi-ribbon-icon {
    font-size: 20px;
    margin-bottom: 4px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.daemi-ribbon-label {
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

@media (max-width: 768px) {
    .daemi-ribbon-bar {
        overflow-x: auto;
    }
    .daemi-ribbon-item {
        min-width: 75px;
        padding: 8px 3px;
    }
    .daemi-ribbon-label {
        font-size: 10.5px;
    }
    .daemi-ribbon-icon {
        font-size: 18px;
        width: 18px;
        height: 18px;
        margin-bottom: 2px;
    }
}

/* بخش اصلی داشبورد: دو ستونه (ستون کارت‌های آماری ۴ تایی + ستون کارت برند و وضعیت) */
.daemi-dash-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1080px) {
    .daemi-dash-top-grid {
        grid-template-columns: 1fr;
    }
}

/* کارت‌های آماری ۴ تایی (۲ در ۲) */
.daemi-stat-quad-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.daemi-stat-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.daemi-stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.daemi-stat-meta h4 {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.daemi-stat-number {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.daemi-stat-circle-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.daemi-circle-green  { background: #22c55e; color: #ffffff; box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3); }
.daemi-circle-blue   { background: #3b82f6; color: #ffffff; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }
.daemi-circle-orange { background: #f97316; color: #ffffff; box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3); }
.daemi-circle-slate  { background: #64748b; color: #ffffff; box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3); }

/* کارت معرفی برند و وضعیت به‌روزرسانی (دقیقاً مشابه اسکرین‌شات) */
.daemi-brand-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.daemi-brand-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.daemi-logo-typography {
    font-size: 30px;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin: 0;
}

.daemi-logo-typography span {
    color: #0284c7;
}

.daemi-brand-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 4px 0 0 0;
}

.daemi-brand-details {
    margin: 18px 0;
    font-size: 12.5px;
    color: #475569;
    line-height: 2;
}

.daemi-brand-details .daemi-row-detail {
    display: flex;
    align-items: center;
    gap: 8px;
}

.daemi-btn-ip-badge {
    background: #0284c7;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 2px 10px;
    font-size: 11.5px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
}

.daemi-btn-ip-badge:hover {
    background: #0369a1;
}

/* دکمه بزرگ سبز به‌روزرسانی مطابق اسکرین‌شات */
.daemi-dash-big-green-btn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14.5px;
    font-weight: 800;
    padding: 13px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
    transition: all 0.25s ease;
    width: 100%;
}

.daemi-dash-big-green-btn:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.45);
}

/* ردیف باکس‌های تحلیلی پایین */
.daemi-analytics-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

@media (max-width: 900px) {
    .daemi-analytics-row {
        grid-template-columns: 1fr;
    }
}

.daemi-analytic-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.daemi-analytic-header {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


