@font-face {
  font-family: "Vazirmatn";
  src: url("/static/accounts/fonts/vazirmatn-v33.003.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #fff;
  --ink: #182236;
  --muted: #536078;
  --subtle: #e3e9f1;
  --accent: #2355cc;
  --accent-dark: #1946b2;
  --accent-soft: #edf3ff;
  --green: #17654f;
  --shadow: 0 16px 52px #182d5212;
  font-family: "Vazirmatn", "Geeza Pro", Tahoma, system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--bg); line-height: 1.75; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.45; overflow-wrap: anywhere; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #4374eb; outline-offset: 3px; }
.skip-link { position: fixed; z-index: 9; inset-block-start: 1rem; inset-inline-start: 1rem; padding: .45rem .8rem; color: #fff; background: #112d69; border-radius: .55rem; transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.visually-hidden, .icon-library { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.icon { width: 1.2rem; height: 1.2rem; display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.eyebrow { font-size: .79rem; color: var(--accent-dark); font-weight: 700; margin-block-end: .45rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: .9rem; color: #fff; background: var(--accent); box-shadow: 0 6px 14px #2355cc30; flex: none; }
.brand-mark .icon { width: 1.45rem; height: 1.45rem; }
.brand-title { font-weight: 700; }
.button { min-height: 2.7rem; border: 1px solid transparent; border-radius: .65rem; padding: .5rem 1rem; font-size: .88rem; font-weight: 700; display: inline-flex; gap: .45rem; align-items: center; justify-content: center; text-decoration: none; }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--accent-dark); }
.button.secondary { border-color: var(--subtle); color: #35425a; background: #fff; }
.button.secondary:hover:not(:disabled) { background: var(--bg); }
.button.danger { color: #97293f; background: #fff0f3; border-color: #f6cbd4; }
.button.danger:hover:not(:disabled) { background: #ffe1e8; }
.icon-button { position: relative; display: grid; place-items: center; width: 2.7rem; height: 2.7rem; padding: 0; border: 1px solid var(--subtle); border-radius: .7rem; background: var(--surface); color: #43516b; text-decoration: none; flex: none; }
.icon-button:hover { background: var(--accent-soft); color: var(--accent-dark); }
.text-link { color: var(--accent-dark); font-size: .9rem; font-weight: 700; }
.field { display: grid; gap: .35rem; }
.field label { font-size: .85rem; font-weight: 700; }
input, select, textarea { width: 100%; min-width: 0; min-height: 2.7rem; border: 1px solid #d6dfeb; border-radius: .6rem; padding: .5rem .75rem; color: var(--ink); background: #fff; }
textarea { resize: vertical; min-height: 6rem; }
input::placeholder, textarea::placeholder { color: #58667f; opacity: 1; }
.form-message { border-radius: .6rem; background: #fff1f3; color: #8e233d; font-size: .88rem; padding: .55rem .8rem; overflow-wrap: anywhere; }

.auth-view { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(18rem, 1fr) minmax(20rem, .9fr); }
.auth-brand { display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; position: relative; isolation: isolate; overflow: hidden; padding: clamp(2rem, 6vw, 6rem); color: #fff; background: radial-gradient(ellipse at 8% 95%, #3974ec 0, transparent 45%), linear-gradient(140deg, #152d64, #224dba); }
.auth-brand::after { content: ""; position: absolute; z-index: -1; inset: 0; background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px); background-size: 42px 42px; opacity: .09; mask-image: linear-gradient(145deg, transparent 30%, #000); }
.auth-brand .brand-mark { background: #ffffff24; box-shadow: none; }
.auth-brand .eyebrow { color: #d6e5ff; margin-block-end: .8rem; }
.auth-brand-copy h1 { font-size: clamp(2rem, 4.35vw, 4.4rem); max-inline-size: 13ch; letter-spacing: -.025em; }
.auth-brand-copy > p:last-child { margin-block-start: 1rem; color: #e1ebff; font-size: clamp(1rem, 1.3vw, 1.2rem); }
.auth-workflow { display: flex; flex-wrap: wrap; gap: .65rem; }
.auth-workflow span { display: flex; align-items: center; gap: .45rem; border: 1px solid #ffffff52; color: #fff; background: #ffffff12; border-radius: .7rem; padding: .45rem .7rem; font-size: .84rem; }
.auth-panel { display: grid; place-items: center; padding: clamp(1.5rem, 5vw, 4rem); background: #fff; }
.auth-form-shell { width: min(100%, 24rem); }
.auth-form-shell h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-block-end: .4rem; }
.auth-form-shell form { margin-block: 1.6rem 1.15rem; display: grid; gap: 1rem; }
.auth-form-shell input { min-height: 3rem; }
.auth-form-shell .form-message { margin-block-start: 1rem; }
.auth-submit { width: 100%; min-height: 3rem; margin-block-start: .3rem; }
.auth-link-button { padding: .35rem 0; border: 0; background: transparent; text-align: start; }
.auth-link-button:hover:not(:disabled) { text-decoration: underline; text-underline-offset: .2em; }
.auth-switch { border-block-start: 1px solid var(--subtle); padding-block-start: .85rem; width: 100%; }
.otp-destination { display: flex; justify-content: space-between; align-items: center; gap: .3rem .65rem; flex-wrap: wrap; padding: .4rem .75rem; background: var(--accent-soft); border: 1px solid #dce7ff; border-radius: .65rem; font-size: .86rem; }
.otp-destination bdi { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
#otp-code { text-align: center; letter-spacing: .42em; padding-inline-start: 1.17rem; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.otp-resend { justify-self: center; }
.otp-resend:disabled { color: var(--muted); opacity: 1; }
.captcha-field { padding: .7rem .75rem; border: 1px solid var(--subtle); border-radius: .65rem; background: #f8faff; }
.captcha-media { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .65rem; margin-block-end: .35rem; }
.captcha-media img { display: block; max-width: 100%; max-height: 4rem; border: 1px solid var(--subtle); border-radius: .4rem; background: #fff; }
.captcha-status { font-size: .8rem; }
#otp-captcha-answer { letter-spacing: .28em; font-variant-numeric: tabular-nums; }

.app-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; inset-block-start: 0; height: 100vh; height: 100dvh; background: #fff; border-inline-end: 1px solid var(--subtle); display: flex; flex-direction: column; padding: 1.2rem .9rem; gap: 2.35rem; }
.sidebar-brand { padding: .25rem .4rem; }
.sidebar-brand small, .profile-text small { display: block; color: var(--muted); font-size: .75rem; }
.sidebar-nav, .sidebar-bottom { display: grid; gap: .3rem; }
.sidebar-bottom { margin-block-start: auto; }
.nav-label { padding-inline: .75rem; margin-block-end: .3rem; font-size: .75rem; font-weight: 700; color: var(--muted); }
.nav-item { display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 2.75rem; padding: .45rem .75rem; background: transparent; border: 0; border-radius: .65rem; text-align: start; text-decoration: none; color: #45526b; font-size: .87rem; font-weight: 700; }
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.selected { background: var(--accent-soft); color: var(--accent-dark); }
.badge-count { margin-inline-start: auto; border-radius: 2rem; background: var(--accent); color: #fff; min-width: 1.45rem; padding: 0 .25rem; text-align: center; font-size: .72rem; }
.profile { display: flex; align-items: center; gap: .55rem; min-width: 0; padding: .65rem .4rem; border-block-start: 1px solid var(--subtle); }
.avatar { display: grid; place-items: center; border-radius: .65rem; background: #edf2fb; color: #224f9e; width: 2.3rem; height: 2.3rem; font-weight: 700; flex: none; }
.profile-text { font-size: .85rem; overflow: hidden; }
.profile-text strong, .profile-text small { display: block; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.main-content { min-width: 0; }
.topbar { min-height: 4.3rem; border-block-end: 1px solid var(--subtle); background: #ffffffd9; display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .65rem clamp(1rem, 3.4vw, 3rem); }
.breadcrumb, .topbar-actions { display: flex; align-items: center; gap: .65rem; }
.breadcrumb { color: var(--muted); font-size: .84rem; }
.breadcrumb strong { color: var(--ink); }
.mobile-logout, .mobile-admin { display: none; }
.notification-dot { position: absolute; inset-block-start: .48rem; inset-inline-end: .52rem; width: .52rem; height: .52rem; background: #2355cc; border: 1px solid #fff; border-radius: 50%; }
.content-inner { max-width: 95rem; margin-inline: auto; padding: 1.8rem clamp(1rem, 3.4vw, 3rem) 3rem; display: grid; gap: 1.3rem; }
.hero { position: relative; isolation: isolate; display: flex; justify-content: space-between; align-items: center; gap: 1rem; overflow: hidden; border: 1px solid #dfe9fe; border-radius: 1.05rem; padding: clamp(1.15rem, 3vw, 2.1rem); background: linear-gradient(100deg, #e4edff, #eff5ff 70%); }
.hero::after { content: ""; position: absolute; inset-inline-end: 1rem; inset-block-start: -7rem; width: 19rem; height: 19rem; border-radius: 50%; z-index: -1; border: 1px solid #c9dafa; box-shadow: 0 0 0 1.8rem #d7e4fcaa, 0 0 0 3.7rem #dbe6fc77; }
.hero h1 { font-size: clamp(1.8rem, 3vw, 2.65rem); margin-block-end: .15rem; }
.hero p:last-child { color: #435472; font-size: .95rem; }
.hero .button { flex: none; }
.stats { display: grid; gap: .8rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card { min-width: 0; min-height: 5.7rem; display: flex; align-items: center; gap: .65rem; padding: .85rem; background: #fff; border: 1px solid var(--subtle); border-radius: .8rem; }
.stat-icon, .row-icon, .empty-icon { display: grid; place-items: center; border-radius: .7rem; width: 2.55rem; height: 2.55rem; color: #2155bc; background: #eef3ff; flex: none; }
.stat-card.review .stat-icon { color: #76510b; background: #fff4d9; }
.stat-card.pending .stat-icon { color: #5a3d9a; background: #f1ebfc; }
.stat-card.done .stat-icon { color: #17654f; background: #e7f7f1; }
.stat-label { color: var(--muted); font-size: .77rem; }
.stat-value { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }

.request-panel { border: 1px solid var(--subtle); border-radius: 1rem; background: #fff; overflow: hidden; box-shadow: 0 3px 14px #243f7310; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .7rem; padding: 1rem 1.2rem .7rem; }
.panel-heading h2 { font-size: 1.14rem; margin-block-end: .2rem; }
.panel-heading p { font-size: .8rem; }
.live-indicator { display: flex; gap: .42rem; align-items: center; color: var(--green); background: #edf9f4; padding: .15rem .58rem; border-radius: 2rem; white-space: nowrap; }
.live-indicator > span:first-child { width: .45rem; height: .45rem; border-radius: 50%; background: #23765e; }
.live-indicator[data-offline] { color: #79520c; background: #fff3db; }
.live-indicator[data-offline] > span:first-child { background: #9c6611; }
.filters { padding: .6rem 1.2rem 1rem; display: grid; grid-template-columns: minmax(11rem, 1fr) minmax(8rem, .4fr) minmax(8rem, .4fr); gap: .6rem; border-block-end: 1px solid var(--subtle); }
.filters input, .filters select { font-size: .84rem; }
@media (min-width: 62.01rem) {
  .filters:has(#attention-field:not([hidden])) { grid-template-columns: minmax(11rem, 1fr) repeat(3, minmax(8rem, .4fr)); }
}
.input-icon { position: relative; }
.input-icon .icon { position: absolute; inset-inline-start: .72rem; top: .75rem; color: #607493; pointer-events: none; }
.input-icon input { padding-inline-start: 2.35rem; }
.request-row { display: grid; width: 100%; border: 0; border-block-end: 1px solid var(--subtle); background: #fff; padding: .75rem 1.2rem; grid-template-columns: 2.55rem minmax(8rem, 1fr) auto 1.25rem; gap: .75rem; align-items: center; text-align: start; color: var(--ink); }
.request-row:last-child { border-block-end: 0; }
.request-row:hover { background: #f7faff; }
.request-row:focus-visible { outline-offset: -3px; }
.row-title, .row-meta { display: block; overflow-wrap: anywhere; }
.row-title { font-size: .94rem; font-weight: 700; }
.row-meta, .row-arrow { color: var(--muted); font-size: .77rem; }
.attention-indicators { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .42rem; }
.request-row .attention-indicators { margin-block-start: .35rem; }
.attention-chip { display: inline-block; border-radius: .45rem; padding: .04rem .43rem; color: #43526e; background: #eef2f8; font-size: .72rem; font-weight: 700; }
.attention-chip[data-attention="unassigned"] { color: #8e233d; background: #fff0f3; }
.attention-chip[data-attention="waiting_company"] { color: #7e5105; background: #fff2d5; }
.attention-chip[data-attention="waiting_customer"] { color: #63429e; background: #f0eafc; }
.attention-chip[data-attention="stale"] { color: #7c410c; background: #ffebd9; }
.waiting-since { font-size: .77rem; }
.status-chip { display: inline-flex; align-items: center; width: max-content; max-width: 100%; padding: .15rem .62rem; border-radius: 1rem; font-size: .76rem; font-weight: 700; color: #2452ac; background: #eaf1ff; }
.status-chip[data-status="reviewing"], .status-chip[data-status="waiting_external"] { color: #7e5105; background: #fff2d5; }
.status-chip[data-status="pending_confirmation"] { color: #63429e; background: #f0eafc; }
.status-chip[data-status="closed"] { color: #17654f; background: #e7f7f1; }
.empty-state { padding: 2.7rem 1rem; text-align: center; }
.empty-state .empty-icon { margin-inline: auto; margin-block-end: .8rem; width: 3rem; height: 3rem; }
.empty-state p:first-of-type { font-weight: 700; }
.empty-state .muted { font-size: .88rem; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: .65rem; padding: .75rem 1.2rem; border-block-start: 1px solid var(--subtle); font-size: .85rem; }

.dialog { width: min(34rem, calc(100% - 1.4rem)); max-height: calc(100% - 1.4rem); padding: 0; color: var(--ink); border: 1px solid var(--subtle); border-radius: 1rem; box-shadow: var(--shadow); }
.dialog::backdrop { background: #12234585; }
.detail-dialog { width: min(52rem, calc(100% - 1.4rem)); }
.dialog-heading { position: sticky; inset-block-start: 0; z-index: 1; display: flex; justify-content: space-between; align-items: start; gap: .75rem; padding: 1rem 1.15rem; border-block-end: 1px solid var(--subtle); background: #fff; }
.dialog-heading h2 { font-size: clamp(1.1rem, 2.3vw, 1.5rem); }
.dialog-heading .eyebrow { margin-block-end: .15rem; }
.dialog-body { padding: 1rem 1.15rem 1.2rem; display: grid; gap: .9rem; }
#create-fields { display: grid; gap: .85rem; }
.dialog-footer { display: flex; flex-wrap: wrap; gap: .55rem; }
.detail-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.metadata { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.metadata > div { padding: .55rem .75rem; border: 1px solid var(--subtle); border-radius: .65rem; background: #f8faff; }
.metadata dt { font-size: .76rem; color: var(--muted); }
.metadata dd { font-size: .88rem; margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.detail-section { display: grid; gap: .55rem; padding-block-start: .8rem; border-block-start: 1px solid var(--subtle); }
.detail-section h3 { font-size: .96rem; }
.detail-section p, .action-form { font-size: .89rem; }
.user-copy { white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.timeline li { padding: .52rem .75rem; border-inline-start: 2px solid #c5d8ff; border-radius: .3rem; background: #f7faff; }
.timeline-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .2rem .55rem; }
.timeline-header time { color: var(--muted); font-size: .75rem; }
.timeline-header strong { font-size: .83rem; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.action-form { display: grid; align-content: start; justify-items: start; gap: .55rem; padding: .7rem; border: 1px solid var(--subtle); border-radius: .65rem; }
.action-form .field { width: 100%; }
.action-form.full-width { grid-column: 1 / -1; }
.assignment-panel { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .55rem 1rem; padding: .75rem; border: 1px solid #dfe8f8; border-radius: .75rem; background: #f8faff; }
.assignment-current { min-width: 8rem; }
.assignment-current h3 { color: var(--muted); font-size: .79rem; }
.assignment-current p { font-weight: 700; overflow-wrap: anywhere; }
.assignment-reason { font-size: .82rem; overflow-wrap: anywhere; }
.assignment-form { flex: 1 1 19rem; max-width: 28rem; grid-template-columns: minmax(0, 1fr) auto; align-items: end; padding: 0; border: 0; }
.assignment-form .form-message { grid-column: 1 / -1; }
.notification-list { display: grid; gap: .55rem; }
.notice { display: grid; gap: .2rem; width: 100%; text-align: start; padding: .65rem .8rem; background: #fff; border: 1px solid var(--subtle); border-radius: .65rem; color: var(--ink); }
.notice:hover { background: #f7faff; }
.notice.unread { background: #f1f5ff; border-color: #cfddfd; }
.notice span { font-size: .8rem; overflow-wrap: anywhere; }
.notice strong { overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 3; inset-block-end: 1rem; inset-inline-start: 1rem; max-width: calc(100% - 2rem); padding: .65rem .9rem; border-radius: .65rem; color: #fff; background: #174e41; box-shadow: var(--shadow); font-size: .88rem; }

@media (max-width: 62rem) {
  .app-layout { grid-template-columns: 12.5rem minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .search-field { grid-column: 1 / -1; }
}

@media (max-width: 44rem) {
  .auth-view { grid-template-columns: minmax(0, 1fr); align-content: start; background: #fff; }
  .auth-brand { padding: 1.15rem 1.25rem 1.45rem; gap: 1.15rem; }
  .auth-brand-copy h1 { max-inline-size: 22ch; font-size: clamp(1.35rem, 6vw, 2.1rem); }
  .auth-brand-copy > p:last-child { font-size: .87rem; margin-block-start: .45rem; }
  .auth-brand-copy .eyebrow, .auth-workflow { display: none; }
  .auth-panel { padding: 1.4rem 1.25rem; }
  .app-layout { display: block; }
  .sidebar { display: none; }
  .mobile-admin, .mobile-logout { display: grid; }
  .content-inner { gap: 1rem; padding-block-start: 1rem; }
  .hero { align-items: flex-start; flex-direction: column; gap: .8rem; }
  .hero p:last-child { font-size: .87rem; }
  .stats { gap: .55rem; }
  .stat-card { padding: .58rem; min-height: 4.5rem; gap: .45rem; }
  .stat-icon { width: 1.95rem; height: 1.95rem; }
  .stat-icon .icon { width: 1rem; height: 1rem; }
  .stat-label { font-size: .72rem; }
  .stat-value { font-size: 1.15rem; }
  .panel-heading, .filters, .pagination { padding-inline: .75rem; }
  .request-row { grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; padding-inline: .75rem; }
  .request-row .row-icon, .request-row .row-arrow { display: none; }
  .request-row .status-chip { max-width: 7rem; }
  .metadata { grid-template-columns: repeat(auto-fit, minmax(min(8rem, 100%), 1fr)); }
  .action-grid { grid-template-columns: minmax(0, 1fr); }
}

.action-fields { display: grid; gap: .8rem; }
.file-control { padding: .4rem; font-size: .85rem; }
.file-control::file-selector-button {
  border: 0;
  border-radius: .45rem;
  padding: .35rem .65rem;
  margin-inline-end: .65rem;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font: inherit;
  cursor: pointer;
}
.file-links { display: grid; gap: .35rem; list-style: none; padding: 0; margin: .6rem 0 0; }
.file-links li { padding: 0; }
.file-link {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
  padding: .35rem .6rem;
  border-radius: .45rem;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: underline;
}
.file-name { overflow-wrap: anywhere; }
