/* ─── Vazirmatn Font ─── */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─── Font Inheritance ─── */
select, option, input, textarea, button {
    font-family: inherit;
}

/* ─── Light Mode (default) ─── */
:root {
    --primary:       #4f46e5;
    --primary-dark:  #4338ca;
    --primary-light: #eef2ff;
    --danger:        #ef4444;
    --success:       #22c55e;
    --warning:       #f59e0b;
    --text:          #1e293b;
    --text-muted:    #64748b;
    --border:        #e2e8f0;
    --bg:            #f8fafc;
    --white:         #ffffff;
    --card-bg:       #ffffff;
    --input-bg:      #ffffff;
    --sidebar-bg:    #ffffff;
    --radius:        12px;
    --shadow:        0 4px 24px rgba(0,0,0,0.08);
    --shadow-sm:     0 2px 8px rgba(0,0,0,0.06);
    --auth-grad-1:   #667eea;
    --auth-grad-2:   #764ba2;
}

/* ─── Dark Mode ─── */
[data-theme="dark"] {
    --primary:       #818cf8;
    --primary-dark:  #6366f1;
    --primary-light: #1e1b4b;
    --danger:        #f87171;
    --success:       #4ade80;
    --warning:       #fbbf24;
    --text:          #f1f5f9;
    --text-muted:    #94a3b8;
    --border:        #334155;
    --bg:            #0f172a;
    --white:         #1e293b;
    --card-bg:       #1e293b;
    --input-bg:      #0f172a;
    --sidebar-bg:    #1e293b;
    --shadow:        0 4px 24px rgba(0,0,0,0.4);
    --shadow-sm:     0 2px 8px rgba(0,0,0,0.3);
    --auth-grad-1:   #1e1b4b;
    --auth-grad-2:   #312e81;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    min-height: 100vh;
    transition: background .3s, color .3s;
}

/* ─── Auth Layout ─── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--auth-grad-1) 0%, var(--auth-grad-2) 100%);
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    position: relative;
    max-width: 460px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo .logo-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.auth-logo .logo-icon svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.auth-logo h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.auth-logo p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ─── Form Elements ─── */
.form-group {
    margin-bottom: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.input-wrap {
    position: relative;
}

.input-wrap svg {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    pointer-events: none;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
    width: 100%;
    padding: 11px 40px 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--input-bg);
    transition: border-color .2s, box-shadow .2s, background .3s, color .3s;
    outline: none;
}

/* فیلدهایی که placeholder فارسی دارن ولی تایپ انگلیسیه */
input[type="text"].ltr-input {
    direction: rtl;
    text-align: right;
}
input[type="text"].ltr-input.typing {
    direction: ltr;
    text-align: left;
}

/* فیلد رمز عبور: آیکون قفل راست + آیکون چشم چپ → padding هر دو طرف ۴۰px */
input[type="password"],
.input-wrap input[type="text"] {
    width: 100%;
    padding: 11px 40px 11px 40px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--input-bg);
    transition: border-color .2s, box-shadow .2s, background .3s, color .3s;
    outline: none;
    direction: rtl;
    text-align: right;
}

/* وقتی کاربر شروع به تایپ کرد، JS کلاس typing اضافه می‌کنه */
input[type="password"].typing,
.input-wrap input[type="text"].typing {
    direction: ltr;
    text-align: left;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

input.error {
    border-color: var(--danger);
}

.field-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
    display: none;
}

.field-error.show {
    display: block;
}

/* Password toggle — سمت چپ */
.toggle-pass {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    z-index: 1;
}

.toggle-pass svg {
    position: static;
    transform: none;
    width: 18px;
    height: 18px;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,70,229,.35);
}

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

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: none;
}

.btn.loading .spinner { display: block; }
.btn.loading .btn-text { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Alert ─── */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 18px;
    display: none;
    align-items: flex-start;
    gap: 10px;
}

.alert.show { display: flex; }

.alert-error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

.alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* ─── Auth Footer ─── */
.auth-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover { text-decoration: underline; }

/* ─── Auth Divider ─── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: var(--text-muted);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ─── Google OAuth Button ─── */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 20px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, border-color .2s, box-shadow .2s, transform .15s;
    margin-bottom: 4px;
}

.btn-google:hover {
    background: var(--bg);
    border-color: #4285F4;
    box-shadow: 0 2px 10px rgba(66,133,244,.15);
    transform: translateY(-1px);
}

.btn-google:active {
    transform: translateY(0);
}

[data-theme="dark"] .btn-google {
    background: var(--input-bg);
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .btn-google:hover {
    background: var(--white);
    border-color: #4285F4;
}
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ─── Dashboard Banner ─── */
.verify-banner {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    overflow: hidden;
}

.verify-banner .banner-icon {
    width: 40px;
    height: 40px;
    background: #fef3c7;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.verify-banner .banner-icon svg {
    width: 22px;
    height: 22px;
    color: var(--warning);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.verify-banner .banner-body { flex: 1; }

.verify-banner h3 {
    font-size: 15px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 4px;
}

.verify-banner p {
    font-size: 13px;
    color: #a16207;
    margin-bottom: 12px;
    line-height: 1.6;
}

.banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.banner-actions .btn-sm {
    padding: 7px 16px;
    font-size: 13px;
    border-radius: 6px;
    flex-shrink: 0;
    width: auto !important;
}

.edit-email-wrap {
    display: none;
    margin-top: 12px;
    gap: 8px;
    flex-direction: column;
}

.edit-email-wrap.show { display: flex; }

.edit-email-wrap .input-wrap {
    width: 100%;
}

.edit-email-wrap .input-wrap input {
    padding: 8px 40px 8px 14px;
    font-size: 13px;
    background: var(--input-bg);
    color: var(--text);
}

.edit-email-wrap-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.edit-email-wrap-actions .btn-sm {
    flex: 1;
    justify-content: center;
    padding: 8px 12px;
    font-size: 13px;
}

/* Countdown */
.countdown-wrap {
    font-size: 13px;
    color: var(--text-muted);
    display: none;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 4px;
}

.countdown-wrap.show { display: flex; }

.countdown-num {
    font-weight: 700;
    color: var(--warning);
    min-width: 24px;
    text-align: center;
}

/* ─── Dashboard Layout ─── */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

/* ─── Sidebar ─── */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-left: 1px solid var(--border);
    flex-shrink: 0;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform .3s ease;
}

.sidebar-logo {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar-logo h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-logo .theme-toggle {
    position: static;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: all .2s;
    border-right: 3px solid transparent;
    margin: 2px 0;
}

.sidebar-nav a:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-right-color: var(--primary);
}

.sidebar-nav a.active {
    background: var(--primary-light);
    color: var(--primary);
    border-right-color: var(--primary);
    font-weight: 600;
}

.sidebar-nav a svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    flex-shrink: 0;
}

.sidebar-nav .nav-logout {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}

.sidebar-nav .nav-logout a {
    color: var(--danger) !important;
    border-right-color: transparent !important;
}

.sidebar-nav .nav-logout a:hover {
    background: #fef2f2;
    border-right-color: var(--danger) !important;
}

[data-theme="dark"] .sidebar-nav .nav-logout a:hover {
    background: #450a0a;
}

/* ─── Topbar (mobile) ─── */
.topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 300;
}

.topbar h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar .theme-toggle {
    position: static;
    width: 32px;
    height: 32px;
}

.hamburger {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 0;
    transition: all .2s;
}

.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-muted);
    border-radius: 2px;
    transition: all .3s;
}

.hamburger:hover { border-color: var(--primary); }
.hamburger:hover span { background: var(--primary); }

/* overlay برای موبایل */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show { display: block; }

/* ─── Main Content ─── */
.main-content {
    flex: 1;
    margin-right: 260px;
    padding: 32px;
    min-width: 0;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
}

.page-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .topbar { display: flex; }

    .sidebar {
        transform: translateX(100%);
        box-shadow: var(--shadow);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
        padding: 80px 16px 24px;
    }

    .auth-card { padding: 28px 20px; }
    .form-row  { grid-template-columns: 1fr; }
}

/* ─── Captcha ─── */
.captcha-img-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.captcha-img {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    display: block;
    height: auto;
    width: auto;
    max-width: 100%;
    background: #f5f7fa;
    cursor: pointer;
    image-rendering: pixelated;
}

.captcha-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.captcha-refresh {
    background: none;
    border: 1.5px solid var(--border);
    cursor: pointer;
    padding: 8px;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    transition: all .15s;
    flex-shrink: 0;
}

.captcha-refresh:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.captcha-refresh svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
}

.captcha-refresh.spinning svg {
    animation: spin .5s linear infinite;
}

/* ─── Theme Toggle Button ─── */
/* light mode: پس‌زمینه تیره، ماه سفید */
.theme-toggle {
    position: absolute;
    top: 16px;
    left: 16px;
    background: #485770;
    border: 2px solid #334155;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all .25s;
    z-index: 10;
}

.theme-toggle:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke-width: 2;
    position: absolute;
    transition: opacity .25s, transform .25s;
}

/* light mode: ماه سفید نشون بده */
.theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg);
    stroke: #ffffff;
}
.theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(90deg);
    stroke: #ffcc00;
}

/* dark mode: پس‌زمینه روشن، خورشید زرد */
[data-theme="dark"] .theme-toggle {
    background: #393939;
    border-color: #525252;
}
[data-theme="dark"] .theme-toggle .icon-sun  { opacity: 1; transform: rotate(0deg);   }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg); }

/* کارت auth باید position:relative داشته باشه */
.auth-card {
    position: relative;
}

/* dark mode برای alert ها */
[data-theme="dark"] .alert-error   { background: #450a0a; border-color: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .alert-success { background: #052e16; border-color: #14532d; color: #86efac; }
[data-theme="dark"] .alert-warning { background: #451a03; border-color: #78350f; color: #fcd34d; }

/* dark mode برای verify banner */
[data-theme="dark"] .verify-banner {
    background: linear-gradient(135deg, #451a03, #78350f20);
    border-color: #78350f;
}
[data-theme="dark"] .verify-banner h3 { color: #fcd34d; }
[data-theme="dark"] .verify-banner p  { color: #fbbf24; }

/* dark mode برای captcha */
[data-theme="dark"] .captcha-img {
    filter: invert(0.85) hue-rotate(180deg);
}

/* transition برای همه عناصر */
.auth-card, .sidebar, input, .btn, .alert, label {
    transition: background .3s, border-color .3s, color .3s;
}

/* ─── Empty State ─── */
.empty-state {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 48px 32px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    fill: none;
    stroke: var(--border);
    stroke-width: 1.5;
    margin-bottom: 16px;
    display: block;
    margin-inline: auto;
}

.empty-state p {
    font-size: 15px;
}

/* ─── Panel Card ─── */
.panel-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    width: 100%;
}

/* ─── Badge ─── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
    vertical-align: middle;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

.badge-warning {
    background: #fef9c3;
    color: #a16207;
}

[data-theme="dark"] .badge-success { background: #14532d; color: #86efac; }
[data-theme="dark"] .badge-warning { background: #713f12; color: #fde047; }

/* ─── Field Hint ─── */
.field-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* ─── Disabled Input ─── */
input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg) !important;
}

/* ─── Profile Readonly ─── */
.profile-readonly {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.profile-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    flex-wrap: wrap;
}

.profile-label {
    font-size: 13px;
    color: var(--text-muted);
    min-width: 130px;
    flex-shrink: 0;
    text-align: right;
}

.profile-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    flex: 1;
    text-align: right;
}

.profile-field .badge {
    margin-right: 0;
    margin-left: auto;
    flex-shrink: 0;
}

.profile-locked-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: 8px;
    font-size: 13px;
    color: var(--primary);
    line-height: 1.6;
    margin-top: 8px;
}

.profile-locked-notice svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ─── User Alert Banner ─── */
.user-alert-banner {
    margin-bottom: 20px;
    border-radius: var(--radius);
}

/* ─── Alert Info ─── */
.alert-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
[data-theme="dark"] .alert-info { background: #1e3a5f; border-color: #1d4ed8; color: #93c5fd; }

/* ─── Shared Ticket UI ─── */
.search-input {
    width: 100%; padding: 9px 14px;
    border: 1.5px solid var(--border); border-radius: 8px;
    font-family: inherit; font-size: 14px; color: var(--text);
    background: var(--input-bg); outline: none; transition: border-color .2s, box-shadow .2s;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }

.filter-select {
    padding: 9px 14px; border: 1.5px solid var(--border); border-radius: 8px;
    font-family: inherit; font-size: 13px; color: var(--text);
    background: var(--input-bg); outline: none; cursor: pointer;
}

.table-wrap {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: auto;
}
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-wrap th {
    padding: 11px 14px; font-weight: 600; color: var(--text-muted);
    border-bottom: 2px solid var(--border); background: var(--bg);
    font-size: 12px; white-space: nowrap; text-align: right;
}
.table-wrap td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap tr:hover td { background: var(--primary-light); }

.page-btn {
    padding: 6px 12px; border: 1.5px solid var(--border); border-radius: 6px;
    font-family: inherit; font-size: 13px; color: var(--text-muted);
    background: var(--card-bg); cursor: pointer; text-decoration: none; transition: all .2s;
    display: inline-block;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.badge-secondary { background: #e5e7eb; color: #374151; }
.badge-primary   { background: #ede9fe; color: #4f46e5; }

/* ─── Ticket Pre-Upload ─── */
.tu-drop { border:2px dashed var(--border); border-radius:8px; padding:20px; text-align:center; cursor:pointer; transition:border-color .2s,background .2s; color:var(--text-muted); }
.tu-drop:hover, .tu-drop.drag-over { border-color:var(--primary); background:var(--primary-light); color:var(--primary); }
.tu-list { display:flex; flex-direction:column; gap:8px; margin-top:10px; }
.tu-item { background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:10px 12px; }
.tu-item-info { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; font-size:13px; }
.tu-item-name { font-weight:500; color:var(--text); word-break:break-all; flex:1; margin-right:8px; }
.tu-item-size { font-size:11px; color:var(--text-muted); flex-shrink:0; display:flex; align-items:center; gap:6px; }
.tu-progress-wrap { height:4px; background:var(--border); border-radius:2px; overflow:hidden; margin-bottom:4px; }
.tu-progress-bar { height:100%; background:var(--primary); border-radius:2px; transition:width .2s; }
.tu-item-status { font-size:11px; color:var(--text-muted); }
.tu-remove { background:none; border:none; cursor:pointer; color:var(--danger); font-size:16px; line-height:1; padding:0; display:inline-flex; align-items:center; flex-shrink:0; }

/* ─── Job Form File Uploader (fu-*) ─── */
.fu-drop { border:2px dashed var(--border); border-radius:8px; padding:20px; text-align:center; cursor:pointer; transition:border-color .2s,background .2s; color:var(--text-muted); }
.fu-drop:hover, .fu-drop.drag-over { border-color:var(--primary); background:var(--primary-light); color:var(--primary); }
.fu-list { display:flex; flex-direction:column; gap:8px; margin-top:10px; }
.fu-item { background:var(--bg); border:1px solid var(--border); border-radius:8px; padding:10px 12px; }
.fu-item-info { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; font-size:13px; }
.fu-item-name { font-weight:500; color:var(--text); word-break:break-all; flex:1; margin-right:8px; }
.fu-item-size { font-size:11px; color:var(--text-muted); flex-shrink:0; display:flex; align-items:center; gap:6px; }
.fu-progress-wrap { height:4px; background:var(--border); border-radius:2px; overflow:hidden; margin-bottom:4px; }
.fu-progress-bar { height:100%; background:var(--primary); border-radius:2px; transition:width .2s; }
.fu-item-status { font-size:11px; color:var(--text-muted); }
.fu-remove { background:none; border:none; cursor:pointer; color:var(--danger); font-size:16px; line-height:1; padding:0; display:inline-flex; align-items:center; flex-shrink:0; }
.fu-retry { background:none; border:none; cursor:pointer; color:var(--primary); font-size:15px; line-height:1; padding:0; display:inline-flex; align-items:center; flex-shrink:0; }

/* ─── Multi Entry Field ─── */
.multi-entry-container .me-row-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.me-input-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
}
.multi-entry-container .me-input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s;
    /* override width:100% از form-group input */
    width: auto !important;
}
.multi-entry-container .me-input:focus {
    outline: none;
    border-color: var(--primary);
}
.me-optional-badge {
    flex-shrink: 0;
    margin-right: 8px;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2px 8px;
    white-space: nowrap;
    pointer-events: none;
}
.me-remove-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.me-remove-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}
.me-spacer {
    flex-shrink: 0;
    width: 32px;
}
.me-add-btn {
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-muted);
    font-family: inherit;
    margin-top: 4px;
    transition: background .15s, border-color .15s, color .15s;
}
.me-add-btn:hover {
    background: var(--bg) !important;
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}
