* {margin:0;padding:0;box-sizing:border-box;}
.clear {clear:both;}
:focus {outline:none;}

@font-face {
    font-family: 'SaitakIranSans';
    src: url('assets/fonts/iransans/IRANSansWeb(FaNum).woff2') format('woff2'),
         url('assets/fonts/iransans/IRANSansWeb(FaNum).woff') format('woff'),
         url('assets/fonts/iransans/IRANSansWeb(FaNum).ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

html {-webkit-text-size-adjust:100%;}
body {
    background:#f6f6f6;
    color:#222;
    font:14px/1.9 SaitakIranSans, Tahoma, "Noto Sans Arabic", sans-serif;
    direction:rtl;
    text-align:right;
}
a {text-decoration:none;color:#28707f;}
a:hover {color:#1b4f5a;}
.ltr {direction:ltr;}
.center_align {text-align:center;}
.muted {color:#777;font-size:12px;}
.red_color {color:#b3261e;}
.empty {padding:40px 10px;text-align:center;color:#777;}

/* ---------- چیدمان ---------- */
.container {padding-right:190px;min-height:100vh;}
#menu {
    position:fixed;top:0;right:0;bottom:0;width:190px;
    background:#fff;border-left:1px solid #ddd;z-index:5;
    padding:15px 0;overflow-y:auto;
}
#menu .logo {text-align:center;padding:5px 10px 15px;border-bottom:1px solid #eee;margin-bottom:8px;}
#menu .logo img {display:block;max-width:80px;max-height:80px;margin:0 auto 6px;}
#menu .logo b {display:block;font-size:14px;line-height:1.6;word-break:break-word;}
#menu a {display:block;padding:10px 18px;color:#333;border-right:3px solid transparent;}
#menu a:hover {background:#f6f6f6;}
#menu a.selected {border-right-color:#28707f;color:#28707f;background:#f1f7f8;font-weight:bold;}
#menu a.signout {color:#b3261e;margin-top:10px;border-top:1px solid #eee;}

#left {padding:20px;max-width:1000px;margin:0 auto;}
#left h2 {font-size:18px;margin-bottom:15px;padding-bottom:10px;border-bottom:1px solid #ddd;}

/* ---------- تب‌ها ---------- */
.tabbed ul {list-style:none;display:flex;gap:6px;margin-bottom:15px;border-bottom:1px solid #ddd;}
.tabbed li {padding:9px 16px;cursor:pointer;color:#555;border-bottom:3px solid transparent;margin-bottom:-1px;}
.tabbed li.active {color:#28707f;border-bottom-color:#28707f;font-weight:bold;}
.contents .content {display:none;position:relative;}
.contents .content.content_selected {display:block;}

/* ---------- فرم ---------- */
.box {background:#fff;border:1px solid #ddd;border-radius:6px;padding:15px;margin-bottom:12px;position:relative;}
.form {display:flex;flex-wrap:wrap;margin:0 -6px;margin-bottom:12px;}
.box.form {margin:0 0 12px;}
.part {width:50%;padding:0 6px;margin-bottom:10px;}
.part10 {width:10%;} .part20 {width:20%;} .part25 {width:25%;} .part30 {width:33.333%;}
.part40 {width:40%;} .part50 {width:50%;} .part60 {width:60%;} .part_full {width:100%;}
label {display:block;font-size:12px;color:#555;margin-bottom:3px;}
.textput, select, textarea {
    width:100%;height:42px;padding:6px 10px;font-size:16px;line-height:1.6;font-family:inherit;
    color:#222;background:#fff;border:1px solid #ccc;border-radius:5px;
}
textarea {height:auto;min-height:80px;resize:vertical;}
.textput:focus, select:focus, textarea:focus {border-color:#28707f;}
.textput.number, .textput.price {direction:ltr;text-align:right;}
.subput, .btn {
    display:inline-block;padding:0 22px;height:42px;line-height:42px;
    background:#28707f;color:#fff;border:1px solid #28707f;border-radius:5px;
    font-size:15px;font-family:inherit;cursor:pointer;text-align:center;
}
.subput:hover, .btn:hover {background:#1b4f5a;border-color:#1b4f5a;color:#fff;}
.subput_line, .btn_line {background:#fff;color:#28707f;}
.subput_line:hover, .btn_line:hover {background:#f1f7f8;color:#1b4f5a;}
.btn_red {background:#fff;color:#b3261e;border-color:#b3261e;}
.btn_red:hover {background:#fdf1f0;color:#b3261e;border-color:#b3261e;}
.btn_small {height:34px;line-height:34px;padding:0 14px;font-size:13px;}
.btns {display:flex;flex-wrap:wrap;gap:8px;}
.checkbox_fake {display:flex;align-items:center;gap:8px;cursor:pointer;padding:6px 0;user-select:none;}
.checkbox_fake span {width:22px;height:22px;border:1px solid #999;border-radius:4px;background:#fff;flex:none;position:relative;}
.checkbox_fake.checkbox_checked span {background:#28707f;border-color:#28707f;}
.checkbox_fake.checkbox_checked span:after {content:"✓";color:#fff;position:absolute;top:-1px;right:4px;font-size:15px;line-height:22px;}

/* ---------- لیست ---------- */
.relative {position:relative;min-height:100px;}
.row {display:block;background:#fff;border:1px solid #ddd;border-radius:6px;padding:10px 14px;margin-bottom:8px;color:#222;line-height:1.8;}
.row:hover {background:#fafafa;color:#222;}
.row .line1 {display:flex;flex-wrap:wrap;align-items:center;gap:8px;}
.row .opts {display:flex;gap:8px;margin-top:6px;}
.row_flex {display:flex;justify-content:space-between;align-items:center;gap:10px;}
.badge {display:inline-block;padding:0 9px;border-radius:12px;font-size:12px;line-height:22px;border:1px solid #ccc;background:#f3f3f3;color:#555;white-space:nowrap;}
.st_received {background:#f3f3f3;border-color:#ccc;color:#555;}
.st_in_repair {background:#eef4fb;border-color:#a9c4e2;color:#1f5a96;}
.st_repaired {background:#eef7ee;border-color:#a5cfa7;color:#2e7d32;}
.st_unrepairable {background:#fdf1f0;border-color:#e3a8a4;color:#b3261e;}
.st_delivered {background:#fff;border-color:#bbb;color:#777;}
.st_archived {background:#fff;border-color:#ddd;color:#999;}
.sms_sent {color:#2e7d32;} .sms_failed {color:#b3261e;} .sms_queued {color:#777;}
.filters {padding:10px 8px 2px;}

/* ---------- جدول ---------- */
.table_wrap {overflow-x:auto;}
.sell_table {width:100%;border-collapse:collapse;background:#fff;font-size:13px;}
.sell_table td, .sell_table th {border:1px solid #ddd;padding:6px 10px;text-align:right;}
.sell_table th {background:#f6f6f6;font-weight:normal;color:#555;}

/* ---------- جزئیات پذیرش ---------- */
.back_link {display:inline-block;margin-bottom:10px;}
.order_title {font-size:17px;margin-bottom:4px;}
.order_meta {margin-bottom:12px;color:#555;}
.section_title {font-size:14px;font-weight:bold;margin:6px 0 8px;width:100%;padding:0 6px;}
.photos {display:flex;flex-wrap:wrap;gap:8px;width:100%;padding:0 6px;margin-bottom:8px;}
.photo {position:relative;width:96px;height:96px;border:1px solid #ddd;border-radius:5px;overflow:hidden;background:#fafafa;}
.photo img {width:100%;height:100%;object-fit:cover;display:block;}
.photo .x {position:absolute;top:3px;left:3px;width:24px;height:24px;line-height:22px;text-align:center;background:#fff;border:1px solid #ccc;border-radius:50%;color:#b3261e;cursor:pointer;font-size:16px;}
.picked_client {display:none;padding:8px 12px;border:1px solid #a9c4e2;background:#eef4fb;border-radius:5px;margin-bottom:8px;}
.client_results a {display:block;padding:8px 12px;border:1px solid #ddd;border-top:0;background:#fff;color:#222;}
.client_results a:first-child {border-top:1px solid #ddd;border-radius:5px 5px 0 0;}
.client_results a:hover {background:#f1f7f8;}
.divider {border-top:1px solid #eee;margin:10px 6px 14px;width:100%;}

/* ---------- پیام‌ها و پنجره‌ها ---------- */
.message {
    position:fixed;top:10px;left:50%;transform:translateX(-50%);z-index:30;
    width:90%;max-width:480px;padding:10px 14px;border-radius:5px;display:none;
    border:1px solid #ddd;background:#fff;cursor:pointer;text-align:center;font-size:13px;
}
.message.error {border-color:#e3a8a4;background:#fdf1f0;color:#b3261e;}
.message.success {border-color:#a5cfa7;background:#eef7ee;color:#2e7d32;}
.message.displayed {position:static;transform:none;display:block;width:auto;max-width:none;margin-bottom:10px;}
.topup {position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.35);z-index:40;display:none;}
.topupbox {width:92%;max-width:400px;margin:15vh auto 0;background:#fff;border:1px solid #ccc;border-radius:8px;padding:22px 20px;text-align:right;}
.topupbox .title {font-size:16px;font-weight:bold;margin-bottom:8px;}
.topupbox .text {color:#444;margin-bottom:16px;line-height:1.9;}
.topupbox a {display:inline-block;padding:0 20px;height:40px;line-height:40px;border-radius:5px;margin-left:8px;border:1px solid #28707f;}
.topupbox .ok_button, .topupbox .full_button {background:#28707f;color:#fff;}
.topupbox .cancle_button {background:#fff;color:#28707f;}
.fixed_loading, .absolute_loading {display:none;z-index:50;background:rgba(255,255,255,0.6);}
.fixed_loading {position:fixed;top:0;left:0;width:100%;height:100%;}
.absolute_loading {position:absolute;top:0;left:0;width:100%;height:100%;z-index:3;}
.fixed_loading:after, .absolute_loading:after {
    content:"";position:absolute;top:50%;left:50%;width:34px;height:34px;margin:-17px 0 0 -17px;
    border:3px solid #ddd;border-top-color:#28707f;border-radius:50%;animation:spin 0.8s linear infinite;
}
@keyframes spin {to {transform:rotate(360deg);}}
#paginate {text-align:center;margin:14px 0;}
#paginate a, #paginate span {display:inline-block;min-width:34px;height:34px;line-height:32px;margin:2px;padding:0 6px;border:1px solid #ddd;border-radius:5px;background:#fff;color:#444;font-size:13px;}
#paginate a.current {background:#28707f;border-color:#28707f;color:#fff;}
#paginate .disabled, #paginate .rad {color:#bbb;border-color:#eee;}

/* ---------- ورود ---------- */
.login_page {display:flex;align-items:center;justify-content:center;min-height:100vh;padding:15px;}
.login_form {width:100%;max-width:380px;padding:22px 16px 10px;}
.login_form h1 {text-align:center;font-size:26px;color:#28707f;}
.login_form .muted {margin-bottom:18px;}

/* ---------- موبایل ---------- */
@media (max-width: 800px) {
    .container {padding-right:0;padding-bottom:70px;}
    #menu {top:auto;bottom:0;left:0;right:0;width:100%;height:auto;border-left:0;border-top:1px solid #ddd;padding:0;display:flex;overflow:visible;}
    #menu .logo {display:none;}
    #menu a {flex:1;text-align:center;padding:11px 2px;border-right:0;border-top:3px solid transparent;font-size:13px;}
    #menu a.selected {border-right:0;border-top-color:#28707f;}
    #menu a.signout {margin-top:0;border-top:3px solid transparent;}
    #left {padding:12px;}
    .part, .part10, .part20, .part25, .part30, .part40, .part50, .part60 {width:100%;}
    .tabbed li {flex:1;text-align:center;padding:9px 6px;}
    .box {padding:12px;}
    .photo {width:82px;height:82px;}
}
@media print {
    #menu, .tabbed, .btns {display:none;}
    .container {padding:0;}
}
