/* ====== سامانه فروش آسا — استایل پنل مستقل ====== */
* { box-sizing: border-box; }
.asa-body {
    margin: 0;
    font-family: 'Vazirmatn', Tahoma, system-ui, sans-serif;
    background: #f1f5f9;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; }

/* ---------- ورود ---------- */
.asa-login-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.asa-login-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 28px 24px;
    box-shadow: 0 10px 40px rgba(2, 6, 23, .06);
}
.asa-login-head { text-align: center; margin-bottom: 18px; }
.asa-login-head h1 { font-size: 20px; margin: 10px 0 2px; color: #0f172a; }
.asa-login-head p { font-size: 13px; color: #64748b; margin: 0; }
.asa-logo {
    display: inline-grid; place-items: center;
    width: 54px; height: 54px; border-radius: 16px;
    background: #0d9488; color: #fff; font-weight: 800; font-size: 20px;
    box-shadow: 0 8px 20px rgba(13, 148, 136, .35);
}
.asa-logo.sm { width: 30px; height: 30px; font-size: 13px; border-radius: 9px; box-shadow: none; }
.asa-login-foot { margin-top: 16px; font-size: 12px; color: #94a3b8; }

.asa-tabs { display: flex; gap: 6px; background: #f1f5f9; padding: 4px; border-radius: 12px; margin-bottom: 16px; }
.asa-tab {
    flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px;
    font-family: inherit; font-size: 13px; font-weight: 600; color: #64748b; cursor: pointer;
}
.asa-tab.active { background: #fff; color: #0f766e; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.asa-form { display: flex; flex-direction: column; gap: 10px; }
.asa-input {
    width: 100%; padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 12px;
    font-family: inherit; font-size: 14px; outline: none; background: #fff;
}
.asa-input:focus { border-color: #0d9488; box-shadow: 0 0 0 3px rgba(13,148,136,.12); }
.asa-otp-input { text-align: center; letter-spacing: .5em; font-size: 20px; }
.asa-btn {
    width: 100%; padding: 12px; border: 0; border-radius: 12px;
    background: #0d9488; color: #fff; font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.asa-btn:hover { background: #0f766e; }
.asa-btn-ghost { background: #f1f5f9; color: #475569; }
.asa-link { display: block; text-align: center; color: #64748b; font-size: 12px; margin-top: 4px; }
.asa-otp-note { background: #ecfdf5; border-radius: 10px; padding: 10px 12px; font-size: 12px; color: #065f46; text-align: center; }
.asa-demo-code { margin-top: 6px; color: #0d9488; }
.asa-alert { border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.asa-alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ---------- اپلیکیشن ---------- */
.asa-app { min-height: 100vh; display: flex; flex-direction: column; }
.asa-topbar {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; border-bottom: 1px solid #e2e8f0; padding: 12px 18px;
    position: sticky; top: 0; z-index: 10;
}
.asa-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: #0f172a; }
.asa-topbar-left { display: flex; align-items: center; gap: 12px; }
.asa-user { font-size: 13px; color: #475569; }
.asa-pill { background: #fef3c7; color: #92400e; font-size: 11px; padding: 3px 9px; border-radius: 999px; }
.asa-logout { background: #f1f5f9; border: 0; border-radius: 9px; padding: 7px 14px; font-family: inherit; font-size: 12px; color: #475569; cursor: pointer; }
.asa-logout:hover { background: #e2e8f0; }

.asa-layout { display: flex; flex: 1; }
.asa-side { width: 220px; background: #0f172a; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.asa-side-title { color: #64748b; font-size: 11px; padding: 4px 10px 8px; }
.asa-side-sep { height: 1px; background: #1e293b; margin: 10px 0; }
.asa-nav { color: #cbd5e1; padding: 10px 12px; border-radius: 10px; font-size: 14px; transition: .15s; }
.asa-nav:hover { background: #1e293b; }
.asa-nav.active { background: #0d9488; color: #fff; font-weight: 600; }

.asa-main { flex: 1; padding: 24px; max-width: 1000px; }
.asa-h1 { font-size: 22px; font-weight: 800; margin: 0 0 18px; color: #0f172a; }

.asa-cards { display: flex; gap: 14px; flex-wrap: wrap; }
.asa-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 18px 22px; min-width: 130px; }
.asa-card-num { font-size: 26px; font-weight: 800; color: #0d9488; }
.asa-card-label { font-size: 13px; color: #64748b; margin-top: 4px; }

.asa-note { background: #ecfdf5; border: 1px solid #6ee7b7; color: #065f46; border-radius: 12px; padding: 14px 16px; margin-top: 20px; font-size: 13px; line-height: 1.9; }
.asa-empty { background: #fff; border: 1px dashed #cbd5e1; border-radius: 14px; padding: 40px; text-align: center; color: #94a3b8; }

/* ---------- موبایل ---------- */
@media (max-width: 720px) {
    .asa-layout { flex-direction: column; }
    .asa-side { width: 100%; flex-direction: row; flex-wrap: wrap; }
    .asa-side-title, .asa-side-sep { display: none; }
    .asa-nav { font-size: 13px; padding: 8px 12px; }
    .asa-main { padding: 16px; }
    .asa-user { display: none; }
}

/* ====== اجزای بخش‌های عملیاتی ====== */
.asa-count { font-size: 13px; color: #94a3b8; font-weight: 400; }
.asa-flash { background: #ecfdf5; border: 1px solid #6ee7b7; color: #065f46; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.asa-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.asa-back { display: inline-block; color: #64748b; font-size: 13px; margin-bottom: 10px; }
.asa-detail-sub { color: #64748b; font-size: 13px; margin: -10px 0 16px; }

/* جعبه و گرید */
.asa-box { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px; }
.asa-box h3 { margin: 0 0 12px; font-size: 14px; color: #334155; }
.asa-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.asa-vform { display: flex; flex-direction: column; gap: 8px; }
.asa-hint { color: #64748b; font-size: 12px; line-height: 1.9; margin: 0 0 8px; }
.asa-hint code { background: #f1f5f9; padding: 2px 6px; border-radius: 5px; font-size: 11px; }
.asa-mini-labels { display: flex; justify-content: space-between; font-size: 11px; color: #94a3b8; margin-top: 4px; }

/* دکمه‌ها */
.asa-btn.sm { width: auto; padding: 9px 16px; font-size: 13px; }
.asa-btn-mini { background: #0d9488; color: #fff; border: 0; border-radius: 9px; padding: 7px 12px; font-family: inherit; font-size: 12px; cursor: pointer; }
.asa-btn-mini:hover { background: #0f766e; }
.asa-btn-mini.green { background: #059669; }
.asa-btn-mini.amber { background: #d97706; }
.asa-btn-mini.rose { background: #e11d48; }
.asa-btn-danger { background: #e11d48; color: #fff; border: 0; border-radius: 10px; padding: 9px 16px; font-family: inherit; font-size: 13px; cursor: pointer; }
.asa-link-mini { color: #0f766e; font-size: 12px; font-weight: 600; margin-left: 8px; }
.asa-link-del { background: none; border: 0; color: #e11d48; font-family: inherit; font-size: 12px; cursor: pointer; }

/* جست‌وجو */
.asa-search { display: flex; gap: 8px; margin: 16px 0 8px; }
.asa-search .asa-input { width: 260px; }
.asa-input-mini { padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-family: inherit; font-size: 12px; outline: none; }

/* جدول */
.asa-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; font-size: 13px; }
.asa-table th { background: #f8fafc; color: #64748b; font-weight: 600; padding: 10px 12px; text-align: right; }
.asa-table td { padding: 10px 12px; border-top: 1px solid #f1f5f9; }
.asa-table tbody tr:hover { background: #f8fafc; }
.asa-mono { font-family: monospace; font-weight: 700; }
.asa-empty-row { text-align: center; color: #94a3b8; padding: 24px; }

/* نشان‌ها */
.asa-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.asa-badge-slate { background: #f1f5f9; color: #475569; }
.asa-badge-green { background: #dcfce7; color: #15803d; }
.asa-badge-amber { background: #fef3c7; color: #b45309; }
.asa-badge-rose  { background: #ffe4e6; color: #be123c; }
.asa-badge-sky   { background: #e0f2fe; color: #0369a1; }
.asa-badge-teal  { background: #ccfbf1; color: #0f766e; }

/* فرم اقلام فاکتور */
.asa-items { width: 100%; border-collapse: collapse; font-size: 13px; }
.asa-items th { text-align: right; color: #64748b; font-size: 12px; padding: 6px; }
.asa-items td { padding: 4px; }
.asa-items .asa-input { padding: 7px 8px; font-size: 13px; }
.asa-items .it-sum { text-align: center; font-weight: 600; color: #334155; }
.asa-del-item { background: #fee2e2; color: #e11d48; border: 0; border-radius: 7px; width: 26px; height: 26px; cursor: pointer; font-size: 14px; }
.asa-total-line { margin-top: 10px; text-align: left; font-size: 14px; color: #334155; }
.asa-total-line b { color: #0f766e; font-size: 16px; }

/* مالی */
.asa-pay-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.asa-pay-info { flex: 1; min-width: 180px; }
.asa-pay-title { font-weight: 700; color: #0f172a; }
.asa-pay-sub { font-size: 12px; color: #64748b; margin-top: 2px; }
.asa-pay-date { font-size: 11px; color: #64748b; margin-right: 6px; }
.asa-pay-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.asa-inline-form { display: inline-flex; margin: 0; }
.asa-check-form { display: inline-flex; gap: 6px; align-items: center; }
.asa-debt { color: #e11d48; font-weight: 700; }
.asa-ok { color: #059669; }

/* انبار */
.asa-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 10px 14px; font-size: 12px; margin-bottom: 14px; }
.asa-wh-card { margin-bottom: 12px; }
.asa-wh-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.asa-buyer { display: flex; gap: 18px; background: #f8fafc; border-radius: 9px; padding: 8px 12px; font-size: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.asa-wh-items { margin-top: 6px; }
.asa-driver { background: #dcfce7; color: #15803d; border-radius: 9px; padding: 8px 12px; font-size: 12px; margin-top: 10px; }
.asa-wh-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; border-top: 1px solid #f1f5f9; padding-top: 12px; }
.asa-ship-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* تایم‌لاین */
.asa-timeline { list-style: none; margin: 0; padding: 0 18px 0 0; position: relative; }
.asa-timeline::before { content: ''; position: absolute; right: 6px; top: 6px; bottom: 6px; width: 2px; background: #e2e8f0; }
.asa-timeline li { position: relative; padding-bottom: 16px; }
.asa-tl-dot { position: absolute; right: -16px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #cbd5e1; border: 2px solid #fff; }
.asa-tl-done .asa-tl-dot { background: #0d9488; }
.asa-tl-label { font-weight: 600; font-size: 13px; color: #334155; }
.asa-tl-todo .asa-tl-label { color: #94a3b8; }
.asa-tl-time { font-size: 11px; color: #94a3b8; }
.asa-tl-sms { background: #ecfdf5; color: #065f46; border-radius: 8px; padding: 5px 9px; font-size: 11px; margin-top: 4px; }

/* وضعیت‌ها در جزئیات */
.asa-status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.asa-status-grid > div { background: #f8fafc; border-radius: 9px; padding: 8px; text-align: center; font-size: 12px; }
.asa-status-grid span { display: block; color: #94a3b8; font-size: 10px; margin-bottom: 4px; }
.asa-check-note { background: #fffbeb; color: #92400e; border-radius: 8px; padding: 6px 10px; font-size: 12px; margin-top: 8px; }
.asa-check-item { display: flex; justify-content: space-between; background: #fffbeb; border-radius: 8px; padding: 7px 10px; font-size: 12px; margin-bottom: 6px; }

/* کارت سفارش مشتری */
.asa-order-card { display: block; margin-bottom: 10px; transition: .15s; }
.asa-order-card:hover { border-color: #5eead4; }
.asa-order-sub { display: flex; justify-content: space-between; font-size: 12px; color: #64748b; margin-top: 8px; }

@media (max-width: 720px) {
    .asa-grid2 { grid-template-columns: 1fr; }
    .asa-status-grid { grid-template-columns: 1fr 1fr; }
}
