/**
 * استایل‌های مدرن و اختصاصی دارومارو - سازگار با قالب
 */

:root {
    --dm-primary: #00b894;
    --dm-primary-dark: #00a884;
    --dm-text-main: inherit;
    --dm-text-muted: #777;
    --dm-border: #eee;
    --dm-bg-card: #fff;
    --dm-radius: 12px;
    --dm-font-family: inherit;
}

.dm-container {
    max-width: 850px;
    margin: 40px auto;
    background: var(--dm-bg-card);
    padding: 30px;
    border-radius: var(--dm-radius);
    font-family: var(--dm-font-family);
    direction: rtl;
    text-align: right;
    color: var(--dm-text-main);
}

/* --- هدر و استپ‌ها --- */
.dm-header h2 {
    text-align: center;
    font-weight: 800;
    margin-bottom: 30px;
}

.dm-progress-bar {
    display: flex;
    justify-content: space-between;
    position: relative;
    max-width: 400px;
    margin: 0 auto 40px;
}

.dm-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #eee;
    z-index: 0;
    transform: translateY(-50%);
}

.dm-step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-number {
    width: 35px;
    height: 35px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #999;
    transition: 0.3s;
}

.step-label {
    font-size: 0.8rem;
    margin-top: 5px;
    color: #999;
}

.dm-step.active .step-number {
    background: var(--dm-primary);
    border-color: var(--dm-primary);
    color: #fff;
}

.dm-step.active .step-label {
    color: var(--dm-primary);
    font-weight: bold;
}

/* --- مراحل --- */
.dm-step-content { display: none; animation: fadeIn 0.3s; }
.dm-step-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- کارت‌های نوع سفارش --- */
.dm-grid-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.dm-type-card input { position: absolute; opacity: 0; }
.card-icon {
    background: #f9f9f9;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    font-size: 2rem;
    transition: 0.2s;
}
.card-title { text-align: center; margin-top: 10px; font-weight: 600; font-size: 0.9rem; }
.dm-type-card input:checked + .card-icon {
    background: rgba(0, 184, 148, 0.1);
    border-color: var(--dm-primary);
    color: var(--dm-primary);
}

/* --- فرم‌های عمومی --- */
.dm-form-group { margin-bottom: 20px; }
.dm-form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.95rem; }
.dm-form-group input[type="text"],
.dm-form-group input[type="tel"],
.dm-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--dm-border);
    border-radius: 8px;
    font-family: inherit;
    box-sizing: border-box;
}
.dm-form-group input:focus, .dm-form-group textarea:focus {
    outline: none; border-color: var(--dm-primary);
}

/* --- استایل مدرن کارت دارو --- */
.dm-drug-row-modern {
    border: 1px solid var(--dm-border);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    background: #fff;
}

.dm-drug-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
}

.dm-drug-index {
    font-weight: 700;
    color: var(--dm-primary);
    margin: 0;
}

.dm-header-actions { display: flex; gap: 10px; }
.dm-icon-btn {
    background: none; border: none; cursor: pointer; padding: 5px;
    color: #999; transition: 0.2s; display: flex; align-items: center;
}
.dm-icon-btn:hover { color: var(--dm-primary); }
.dm-delete-btn:hover { color: #ff7675; }

.dm-drug-body-modern { display: flex; flex-direction: column; gap: 15px; }

.dm-row-modern { display: flex; gap: 15px; }
.dm-row-top { align-items: center; }
.dm-row-input { width: 100%; }

/* سلول نوع دارو */
.dm-cell { flex: 1; }
.dm-select-cell { max-width: 180px; }
.dm-custom-select-wrapper { position: relative; width: 100%; }
.dm-custom-select-wrapper select {
    width: 100%;
    padding: 10px 30px 10px 10px;
    border: 1px solid var(--dm-border);
    border-radius: 8px;
    font-family: inherit;
    appearance: none;
    background: #fff;
    cursor: pointer;
}
.dm-select-arrow {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    pointer-events: none;
}

/* سلول شمارنده */
.dm-counter-cell {
    display: flex; align-items: center; gap: 10px;
    background: #f9f9f9; padding: 5px 10px; border-radius: 8px;
    border: 1px solid var(--dm-border);
}
.dm-qty-btn-modern {
    background: none; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0; transition: 0.2s;
}
.dm-qty-btn-modern:hover { transform: scale(1.1); }
.dm-qty-btn-modern:disabled { opacity: 0.3; cursor: not-allowed; }
.dm-qty-text { font-weight: 600; min-width: 50px; text-align: center; }

/* اینپوت نام دارو */
.dm-input-wrapper-modern { width: 100%; position: relative; }
.dm-drug-name {
    width: 100%; padding: 12px; border: 1px solid var(--dm-border);
    border-radius: 8px; font-family: inherit; box-sizing: border-box;
}
.dm-input-hint {
    margin: 5px 0 0 0; font-size: 0.8rem; color: #999;
}

/* آپلود عکس */
.dm-upload-row { width: 100%; }
.dm-upload-area-modern {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    border: 2px dashed #eee; border-radius: 8px; padding: 10px;
    cursor: pointer; color: #999; font-size: 0.9rem; transition: 0.2s;
}
.dm-upload-area-modern:hover { border-color: var(--dm-primary); color: var(--dm-primary); }
.hide { display: none !important; }

/* دکمه‌ها */
.dm-actions { display: flex; justify-content: space-between; margin-top: 30px; padding-top: 20px; border-top: 1px solid #eee; }
.dm-btn {
    padding: 12px 30px; border-radius: 8px; border: none; cursor: pointer;
    font-weight: 600; font-family: inherit; transition: 0.2s;
}
.dm-btn-primary { background: var(--dm-primary); color: #fff; }
.dm-btn-primary:hover { background: var(--dm-primary-dark); }
.dm-btn-secondary { background: #f1f2f6; color: #333; }
.dm-btn-outline { background: transparent; border: 2px dashed var(--dm-primary); color: var(--dm-primary); width: 100%; margin-top: 10px; }
.dm-btn-success { background: var(--dm-primary); color: #fff; width: 100%; }

/* پیام */
.dm-message-box {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(100px);
    padding: 12px 25px; border-radius: 50px; color: white; font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); z-index: 9999; opacity: 0; transition: 0.3s;
}
.dm-message-box.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.dm-message-box.success { background: var(--dm-primary); }
.dm-message-box.error { background: #d63031; }