:root {
    --bg: #f6f8fc;
    --surface: #fff;
    --ink: #192644;
    --muted: #7b89a1;
    --line: #e6eaf3;
    --blue: #3e62d9;
    --blue-dark: #2f51c0;
    --green: #139679;
    --red: #b94d4e;
    --amber: #b77b1d
}
@font-face {
    font-family: iransans;
    src: url('../fonts/IRANSansWeb(FaNum).ttf');
}
*, *:before, *:after {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-size: 13px;
    line-height: 1.85;
    text-align: right;
    font-family: iransans;
}

button, input, select {
    font: inherit
}

button {
    transition: background .16s, border-color .16s, transform .16s
}

h1, h2, h3, p {
    margin: 0
}

a {
    text-decoration: none
}

.icon-svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none
}

.app-header {
    height: 78px;
    background: #fff;
    border-bottom: 1px solid #eaeef5
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1d2b45
}

.brand:hover {
    color: #1d2b45
}

.brand-mark {
    width: 41px;
    height: 41px;
    display: grid;
    place-items: center;
    background: #3f61db;
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 12px rgba(62, 98, 217, .17)
}

.brand-mark .icon-svg {
    width: 24px;
    height: 24px
}

.brand-name {
    font-size: 19px;
    font-weight: 800;
    line-height: 1.1
}

.brand-name small {
    display: block;
    font-weight: 400;
    font-size: 10px;
    color: #8f9bb0;
    margin-top: 7px
}

.header-caption {
    font-size: 11px;
    color: #8190a3;
    display: flex;
    align-items: center;
    gap: 9px
}

.online-mark {
    height: 7px;
    width: 7px;
    background: #16a989;
    border-radius: 50%;
    box-shadow: 0 0 0 4px #dff7f1
}

.main-container {
    min-height: calc(100vh - 78px);
    max-width: 1240px
}

.intro {
    text-align: center;
    padding: 15px 15px 15px
}

.intro-overline {
    display: inline-block;
    color: #5371bb;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 12px
}

.intro h1 {
    font-size: clamp(23px, 2.4vw, 31px);
    line-height: 1.8;
    font-weight: 800;
    letter-spacing: -.5px;
    color: #182847
}

.intro h1 span {
    color: var(--blue)
}

.intro p {
    margin-top: 8px;
    color: #8190a7;
    font-size: 12px
}

.workspace-layout {
    margin-bottom: 25px
}

.panel {
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 12px 42px rgba(30, 52, 92, .04);
    border-radius: 19px;
    overflow: hidden
}

.upload-panel {
    padding: 25px 26px 24px
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px
}

.panel-head h2 {
    font-size: 17px;
    font-weight: 800;
    margin: 0 0 4px
}

.panel-head p {
    font-size: 11px;
    color: #92a0b3;
    margin: 0
}

.head-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #4968d3;
    background: #f0f4ff
}

.head-icon.subtle {
    background: #f5f7fa;
    color: #8e99ad
}

.drop-area {
    min-height: 230px;
    border: 1.5px dashed #cfd9f0;
    border-radius: 15px;
    background: #fafcff;
    margin-top: 21px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    padding: 22px 18px;
    transition: .18s
}

.drop-area:focus-visible, .drop-area:hover, .drop-area.is-dragging {
    outline: none;
    background: #f5f8ff;
    border-color: #6580d9
}

.drop-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: #eaf0ff;
    color: #4a69dc;
    display: grid;
    place-items: center;
    margin-bottom: 14px
}

.drop-icon svg {
    width: 24px;
    height: 24px
}

.drop-area h3 {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 4px
}

.drop-area p {
    color: #94a0b3;
    font-size: 11px;
    margin-bottom: 15px
}

.choose-file {
    background: #3f62da;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 17px;
    border-radius: 9px
}

.choose-file svg {
    width: 16px;
    height: 16px
}

.drop-area small {
    font-size: 10px;
    margin-top: 12px;
    color: #a0aabb
}

.selected-file {
    display: flex;
    align-items: center;
    gap: 13px;
    border: 1px solid #dae3f7;
    border-radius: 12px;
    background: #f8faff;
    margin: 21px 0 0;
    padding: 16px 14px
}

.file-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    color: #4d6adb;
    background: #e8eeff;
    flex: none
}

.selected-info {
    flex: 1;
    min-width: 0
}

.selected-info strong {
    font-weight: 800;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    display: block;
    text-align: right
}

.selected-info small {
    display: block;
    color: #8999ac;
    font-size: 10px;
    margin-top: 2px
}

.icon-button {
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: #eff2f8;
    width: 31px;
    height: 31px;
    color: #7a899f
}

.icon-button svg {
    width: 16px
}

.action-row {
    margin-top: 19px;
    display: flex;
    gap: 9px;
    flex-wrap: wrap
}

.btn {
    min-height: 41px;
    border-radius: 10px;
    padding: 9px 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800
}

.btn svg {
    width: 16px;
    height: 16px
}

.btn:disabled {
    opacity: .52
}

.btn-primary {
    background: #4265de;
    border-color: #4265de
}

.btn-primary:hover:not(:disabled) {
    background: #3155d4;
    border-color: #3155d4
}

.btn-light {
    background: #f4f6fa;
    color: #68778f;
    border: 1px solid #edf0f4
}

.btn-light:hover {
    background: #e9edf6;
    color: #334969
}

.settings-panel {
    padding: 25px 20px 19px;
    height: 100%
}

.settings-panel h2 {
    font-size: 15px
}

.preview-wrap {
    background: #f6f8fc;
    border: 1px solid #e8ecf4;
    border-radius: 11px;
    margin-top: 19px;
    height: 303px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    overflow: hidden
}

.preview-empty {
    font-size: 11px;
    color: #a2aec1;
    text-align: center;
    padding: 20px
}

.preview-surface {
    position: relative;
    max-width: 100%;
    width: 240px;
    user-select: none;
    touch-action: none;
    cursor: crosshair;
    background: #fff;
    box-shadow: 0 5px 17px rgba(30, 50, 80, .15)
}

.preview-surface img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none
}

.roi-box {
    position: absolute;
    border: 2px solid #4367e6;
    background: rgba(58, 94, 210, .12);
    box-shadow: 0 0 0 999px rgba(30, 40, 65, .09);
    pointer-events: none
}

.roi-box span {
    position: absolute;
    right: 0;
    top: -20px;
    background: #4768df;
    color: #fff;
    font-size: 9px;
    padding: 0 6px;
    white-space: nowrap
}

.settings-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    margin-top: 13px
}

.settings-caption {
    font-size: 10px;
    color: #8f9aab
}

.settings-foot .btn {
    font-size: 10px;
    min-height: 29px;
    padding: 4px 8px;
    border-color: #e5eaf3;
    color: #71829e
}

.roi-values {
    font-size: 9px;
    color: #aab5c5;
    direction: ltr;
    text-align: right;
    margin-top: 9px;
    font-family: Arial, sans-serif
}

.results-panel {
    margin-bottom: 30px
}

.results-top {
    padding: 24px 26px 19px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px
}

.results-top h2 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px
}

.results-top p {
    font-size: 11px;
    color: #8796ab
}

.count-pill {
    white-space: nowrap;
    background: #f1f4fb;
    color: #6c7d9d;
    border-radius: 8px;
    padding: 6px 11px;
    font-size: 11px
}

.progress-panel {
    margin: 2px 26px 18px;
    padding: 15px 17px;
    border-radius: 11px;
    border: 1px solid #dce6fb;
    background: #f7f9ff
}

.progress-line, .progress-under {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px
}

.progress-line {
    font-size: 11px
}

.progress-line b {
    color: #4767db
}

.progress {
    height: 6px;
    background: #e7eaf5;
    border-radius: 9px;
    margin: 12px 0 8px
}

.progress-bar {
    background: #466be1
}

.progress-under {
    font-size: 10px;
    color: #8899af
}

.progress-under button {
    border: 0;
    background: none;
    color: #bd5551;
    text-decoration: none;
    font-weight: 700
}

.results-bar {
    padding: 14px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border-top: 1px solid #f0f2f7;
    border-bottom: 1px solid #e9edf3
}

.stat-inline {
    display: flex;
    gap: 11px;
    align-items: center;
    flex-wrap: wrap;
    color: #7d8ba2;
    font-size: 11px
}

.stat-inline strong {
    color: #213252;
    font-size: 13px;
    padding-right: 3px
}

.stat-sep {
    height: 18px;
    width: 1px;
    background: #e6eaf2
}

.filter-tools {
    display: flex;
    align-items: center;
    gap: 8px
}

.search-field {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e4e9f2;
    border-radius: 9px;
    padding: 0 9px;
    background: #fff;
    min-width: 185px
}

.search-field svg {
    width: 15px;
    height: 15px;
    color: #9ba9bc
}

.search-field .form-control {
    border: 0;
    box-shadow: none !important;
    height: 36px;
    min-width: 90px;
    max-width: 195px;
    font-size: 10px;
    padding: 5px
}

.filter-tools .form-select {
    width: 145px;
    border: 1px solid #e4e9f2;
    border-radius: 9px;
    font-size: 10px;
    height: 38px;
    color: #64748e;
    box-shadow: none
}

.results-scroll {
    width: 100%
}

.results-table {
    min-width: 790px;
    table-layout: fixed
}

.results-table thead {
    background: #fafbfe
}

.results-table th {
    padding: 12px 18px !important;
    border-bottom: 1px solid #ecf0f6;
    color: #96a2b2;
    font-size: 10px;
    font-weight: 700
}

.results-table th:first-child {
    width: 22%
}

.results-table th:nth-child(2) {
    width: 25%
}

.results-table th:nth-child(3) {
    width: 27%
}

.results-table th:nth-child(4) {
    width: 26%
}

.results-table td {
    border-bottom: 1px solid #f0f2f5;
    padding: 12px 18px !important;
    vertical-align: middle
}

.source-cell {
    display: flex;
    align-items: center;
    gap: 10px
}

.source-name {
    min-width: 0;
    flex: 1
}

.source-name strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
    direction: ltr;
    text-align: right;
    max-width: 190px;
    color: #283954
}

.source-name small {
    display: block;
    font-size: 9px;
    color: #a3adbe;
    margin-top: 2px
}

.preview-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #e6ebf5;
    background: #fafbfe;
    border-radius: 9px;
    display: inline-grid;
    place-items: center;
    color: #7588a8;
    flex: none
}

.preview-btn:hover {
    background: #eef3ff;
    color: #4467d9
}

.preview-btn svg {
    width: 16px;
    height: 16px
}

.crop-button {
    background: #f8f9fc;
    border: 1px solid #e7ebf3;
    border-radius: 9px;
    min-height: 54px;
    width: 180px;
    max-width: 100%;
    padding: 4px 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: zoom-in
}

.crop-button:hover {
    border-color: #9eb3ef
}

.crop-button img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 49px;
    object-fit: contain;
    mix-blend-mode: multiply
}

.crop-skeleton {
    font-size: 10px;
    color: #a4adba
}

.number-stack {
    min-width: 0
}

.file-number-field {
    width: 100%;
    max-width: 230px;
    min-width: 155px;
    height: 39px;
    border: 1px solid #dfe7f1;
    background: #fff;
    border-radius: 9px;
    font-size: 14px !important;
    font-family: "Segoe UI", Arial, sans-serif;
    font-weight: 750;
    direction: ltr;
    text-align: center;
    letter-spacing: 1.1px;
    box-shadow: none !important;
    unicode-bidi: plaintext
}

.file-number-field:focus {
    border-color: #6886e7
}

.file-number-field.is-duplicate {
    border-color: #e2bf84;
    background: #fffaf2
}

.filename-ext {
    display: block;
    font-size: 9px;
    color: #98a7b7;
    direction: ltr;
    text-align: center;
    margin-top: 4px;
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.status-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap
}

.status-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 5px 9px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 7px;
    background: #e9f8f3;
    color: #0e8b6b
}

.status-label.warn {
    background: #fff5e7;
    color: #ac7626
}

.status-label.fail {
    background: #fff0eb;
    color: #bb6250
}

.status-label.pending {
    background: #eef2f8;
    color: #77879e
}

.confirm-btn {
    border: 1px solid #e5eaf4;
    background: #fff;
    color: #526cc5;
    padding: 4px 9px;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap
}

.confirm-btn:hover {
    background: #f0f4ff
}

.status-detail {
    display: block;
    font-size: 9px;
    color: #a3acbc;
    margin-top: 6px;
    max-width: 190px
}

.table-footer {
    padding: 16px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: #92a0b5;
    font-size: 10px
}

.pagination-actions {
    display: flex;
    gap: 7px
}

.pagination-actions .btn {
    min-height: 31px;
    padding: 5px 13px;
    color: #7b8ba6;
    border-color: #e5eaf2;
    font-size: 10px
}

.export-bottom {
    border-top: 1px solid #eaeef5;
    background: #fbfcff;
    padding: 20px 26px;
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap
}

.export-cta {
    display: flex;
    align-items: center;
    gap: 13px;
    flex-wrap: wrap
}

.export-cta span {
    font-size: 10px;
    color: #8c99a9
}

.btn-export {
    background: #182c55;
    border-color: #182c55;
    color: #fff;
    min-width: 170px
}

.btn-export:hover:not(:disabled) {
    background: #264575;
    color: #fff
}

.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 12px 4px 15px;
    color: #a4aebe;
    font-size: 10px
}

.app-footer span:last-child {
    display: flex;
    align-items: center;
    gap: 6px
}

.app-footer svg {
    width: 14px;
    height: 14px
}

.toast-stack {
    position: fixed;
    top: 88px;
    right: 18px;
    left: auto;
    z-index: 1095;
    max-width: calc(100vw - 36px);
    width: 340px;
    pointer-events: none
}

.toast-stack .toast {
    pointer-events: auto;
    background: #fff;
    border: 1px solid #e3e8f1;
    box-shadow: 0 12px 35px rgba(22, 40, 80, .16);
    border-radius: 12px;
    overflow: hidden;
    max-width: 100%;
    margin: 0 0 9px
}

.toast .toast-body {
    font-size: 11px;
    line-height: 1.9
}

.toast .btn-close {
    width: .7rem;
    height: .7rem;
    background-size: .7rem
}

.modal-content {
    border-radius: 17px;
    border: 0
}

.modal-header {
    border-color: #f1f3f8
}

.modal-title {
    font-size: 13px;
    font-weight: 800
}

.modal-photo {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border: 1px solid #eaeef5;
    border-radius: 8px
}

.modal-filename {
    direction: ltr;
    font-size: 11px;
    color: #8392a9;
    margin-top: 12px
}

.empty-table {
    text-align: center !important;
    padding: 45px 12px !important;
    color: #9aa9bb;
    font-size: 11px
}

@media (max-width: 991px) {
    .main-container {
        max-width: 850px
    }

    .intro {
        padding: 36px 10px 25px
    }
}

@media (max-width: 767px) {
    .app-header {
        height: 68px
    }

    .brand-mark {
        width: 37px;
        height: 37px
    }

    .brand-name {
        font-size: 17px
    }

    .brand-name small {
        font-size: 9px
    }

    .intro {
        padding: 30px 8px 23px
    }

    .intro h1 {
        font-size: 23px
    }

    .intro p {
        font-size: 11px
    }

    .upload-panel {
        padding: 21px 18px
    }

    .drop-area {
        min-height: 241px;
        padding: 20px 14px
    }

    .panel-head h2 {
        font-size: 16px
    }

    .results-top {
        padding: 21px 17px 16px
    }

    .results-top h2 {
        font-size: 16px
    }

    .results-bar {
        padding: 12px 17px;
        gap: 13px
    }

    .filter-tools {
        width: 100%
    }

    .search-field {
        flex: 1;
        min-width: 90px
    }

    .search-field .form-control {
        width: 100%;
        max-width: none
    }

    .filter-tools .form-select {
        width: 133px
    }

    .results-table {
        min-width: 710px
    }

    .results-table td, .results-table th {
        padding: 10px 13px !important
    }

    .table-footer {
        padding: 14px 17px
    }

    .export-bottom {
        padding: 18px 17px
    }

    .export-cta {
        width: 100%;
        justify-content: space-between
    }

    .progress-panel {
        margin: 0 17px 17px
    }

    .settings-panel {
        padding: 20px 18px
    }

    .app-footer {
        flex-wrap: wrap;
        justify-content: center
    }

    .toast-stack {
        top: 76px;
        right: 12px;
        width: calc(100vw - 24px);
        max-width: 350px
    }
}

@media (max-width: 450px) {
    .header-caption {
        display: none
    }

    .intro h1 {
        font-size: 20px
    }

    .intro p {
        line-height: 2.1
    }

    .action-row .btn {
        flex: 1 1 100%
    }

    .stat-inline {
        gap: 8px;
        font-size: 10px
    }

    .stat-sep {
        height: 13px
    }

    .filter-tools {
        flex-wrap: wrap
    }

    .filter-tools .form-select {
        width: 100%
    }

    .results-table {
        min-width: 670px
    }

    .export-cta .btn {
        flex: 1;
        width: 100%
    }

    .export-cta span {
        width: 100%
    }

    .settings-foot {
        flex-wrap: wrap
    }
}

/* ردیف‌های نتایج در موبایل به کارت تبدیل می‌شوند؛ نیازی به پیمایش افقی نیست. */
@media (max-width: 767px) {
    .results-scroll {
        overflow-x: hidden !important
    }

    .results-table {
        display: block;
        width: 100%;
        min-width: 0 !important
    }

    .results-table thead {
        display: none
    }

    .results-table tbody {
        display: grid;
        grid-template-columns:minmax(0, 1fr);
        gap: 11px;
        padding: 12px
    }

    .results-table tbody tr {
        display: grid;
        grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px 10px;
        border: 1px solid #e7edf5;
        border-radius: 12px;
        padding: 11px;
        box-shadow: 0 3px 10px rgba(30, 50, 80, .025)
    }

    .results-table tbody tr td {
        display: block;
        padding: 0 !important;
        border: 0 !important;
        min-width: 0
    }

    .results-table tbody tr td:nth-child(1) {
        grid-column: 1/-1;
        grid-row: 1;
        padding-bottom: 9px !important;
        border-bottom: 1px solid #edf0f5 !important
    }

    .results-table tbody tr td:nth-child(2) {
        grid-column: 1;
        grid-row: 2
    }

    .results-table tbody tr td:nth-child(3) {
        grid-column: 2;
        grid-row: 2
    }

    .results-table tbody tr td:nth-child(4) {
        grid-column: 1/-1;
        grid-row: 3;
        border-top: 1px solid #f0f3f7 !important;
        padding-top: 9px !important
    }

    .source-name strong {
        max-width: 290px
    }

    .crop-button {
        width: 100%;
        height: 63px;
        min-height: 63px;
        padding: 3px
    }

    .crop-button img {
        max-height: 55px
    }

    .number-stack {
        width: 100%
    }

    .file-number-field {
        width: 100%;
        min-width: 0;
        max-width: none;
        height: 41px;
        font-size: 12px !important
    }

    .filename-ext {
        max-width: none;
        font-size: 9px
    }

    .status-wrap {
        display: flex;
        justify-content: flex-start
    }

    .status-detail {
        max-width: 100%;
        margin-top: 4px
    }

    .results-table .empty-table {
        grid-column: 1/-1;
        padding: 20px !important
    }
}
