@import url('https://cdn.jsdelivr.net/npm/vazirmatn@33.0.1/Vazirmatn-font-face.css');

* {
    box-sizing: border-box
}

:root {
    --bg: #f5f7fb;
    --card: #fff;
    --text: #1f2937;
    --muted: #6b7280;
    --primary: #2563eb;
    --danger: #e11d48;
    --border: #e5e7eb;
    --radius: 14px;
}

html,
body {
    height: 100%
}

body {
    direction: rtl;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Vazirmatn", system-ui, -apple-system, Segoe UI, Roboto, sans-serif
}

a {
    color: var(--primary);
    text-decoration: none
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 18px
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 26px rgba(0, 0, 0, .05);
    padding: 16px
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--card);
    border-bottom: 1px solid var(--border)
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 18px
}

.btn {
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px
}

.btn.secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border)
}

.btn.danger {
    background: var(--danger)
}

.btn:disabled {
    opacity: .6;
    cursor: not-allowed
}

.layout {
    display: flex;
    flex-direction: column;
    gap: 16px
}

/* سه باکس بالا کنار هم */
.controls {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px
}

@media (max-width:1000px) {
    .controls {
        grid-template-columns: 1fr
    }
}

.field,
select,
input[type="text"],
input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    color: var(--text)
}

.control-block h4 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--muted)
}

/* فایل‌ها */
.files {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px
}

.file-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    text-align: center
}

.file-item .name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

/* Progress */
.progress {
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden
}

.progress>div {
    height: 100%;
    width: 0;
    background: var(--primary);
    transition: width .15s
}

/* Toast & Modal */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #111;
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25)
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px
}

.modal .box {
    background: #fff;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 85vh;
    width: 100%;
    height: 100%;
    padding: 10px
}

.modal iframe {
    width: 100%;
    height: 90%;
    border: 0
}

/* login */
.center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px
}

.login-card {
    width: 100%;
    max-width: 420px
}

.err {
    color: #e11d48;
    text-align: center;
    margin-top: 10px
}

.hint {
    font-size: 12px;
    color: var(--muted)
}