@font-face {
  font-family: IRANSans;
  src: url("./fonts/IRANSans-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: IRANSans;
  src: url("./fonts/IRANSans-Medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: IRANSans;
  src: url("./fonts/IRANSans-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #25263a;
  --surface: #2f3045;
  --surface-raised: #35364b;
  --surface-soft: #292a3d;
  --line: rgba(209, 211, 231, .09);
  --text: #e7e7f2;
  --muted: #a4a5bd;
  --faint: #777991;
  --primary: #796cf4;
  --primary-soft: rgba(121, 108, 244, .15);
  --success: #28c76f;
  --warning: #ff9f43;
  --danger: #ea5455;
  font-family: IRANSans, Tahoma, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--page); color: var(--text); font-size: 14px; line-height: 1.8; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 18px; overflow: hidden; position: relative; background: radial-gradient(ellipse at 50% 42%, #353650 0%, #25263a 55%, #202133 100%); }
.auth-card { width: min(100%, 430px); position: relative; z-index: 1; background: rgba(47, 48, 69, .94); border: 1px solid var(--line); border-radius: 18px; padding: 38px 40px 30px; box-shadow: 0 24px 70px rgba(0, 0, 0, .28); }
.brand-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; color: white; font-size: 25px; font-weight: 700; background: linear-gradient(140deg, #9b8cff, #6558e8); box-shadow: 0 8px 24px rgba(121, 108, 244, .34); }
.auth-card > .brand-mark { margin-bottom: 25px; }
.auth-card h1 { margin: 0 0 8px; font-size: 25px; }
.auth-card > p { margin: 0 0 23px; }
.eyebrow { color: var(--faint); font-size: 11px; display: block; letter-spacing: .02em; }
.muted { color: var(--muted); }
.auth-footnote { margin: 22px 0 0 !important; padding-top: 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; text-align: center; }
.auth-caption { position: absolute; bottom: 22px; color: #777991; font-size: 12px; }
.auth-decoration { width: 300px; height: 300px; border: 1px solid rgba(121, 108, 244, .1); border-radius: 50%; position: absolute; }
.auth-decoration-one { top: -190px; right: -120px; box-shadow: 0 0 0 34px rgba(121,108,244,.025), 0 0 0 68px rgba(121,108,244,.02); }
.auth-decoration-two { bottom: -240px; left: -100px; width: 410px; height: 410px; }

.stack-form { display: grid; gap: 17px; }
.field { display: grid; gap: 7px; color: #c8c9da; font-size: 12px; }
.field input, .field select, .field textarea, .input-control { width: 100%; min-width: 0; min-height: 44px; border: 1px solid rgba(209, 211, 231, .13); border-radius: 8px; outline: none; background: #292a3d; color: var(--text); padding: 9px 12px; transition: border-color .16s, box-shadow .16s; }
.field textarea { min-height: 74px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(121, 108, 244, .13); }
.field input[readonly] { color: var(--muted); cursor: default; }
.field input::placeholder, .field textarea::placeholder { color: #777991; }
.field input[type="number"] { direction: ltr; text-align: right; }
.field-hint { color: var(--faint); font-size: 11px; font-weight: 400; }
.form-error { color: #ff8b8b; margin: 0; font-size: 12px; }

.button { border: 1px solid transparent; border-radius: 8px; min-height: 42px; padding: 9px 17px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; transition: transform .12s, background .15s, border-color .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.button-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 15px rgba(121,108,244,.18); }
.button-primary:hover { background: #685be6; }
.button-outline { border-color: rgba(209, 211, 231, .18); background: transparent; color: var(--text); }
.button-outline:hover { border-color: var(--primary); }
.button-danger { background: rgba(234,84,85,.12); border-color: rgba(234,84,85,.24); color: #ff9292; }
.button-small { min-height: 34px; padding: 5px 11px; font-size: 12px; }
.button-wide { width: 100%; margin-top: 3px; }
.button-quiet { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.button-quiet:hover { color: var(--text); }

.app-shell { min-height: 100vh; }
.sidebar { width: 250px; position: fixed; z-index: 5; inset: 0 0 0 auto; display: flex; flex-direction: column; padding: 21px 14px 16px; background: #2d2e42; border-left: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; padding: 3px 8px 24px; }
.brand-mark-small { width: 41px; height: 41px; font-size: 19px; border-radius: 12px; flex: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { color: var(--faint); font-size: 10px; }
.sidebar-label { padding: 12px 12px 8px; color: #73758d; font-size: 10px; }
.side-nav { display: grid; gap: 6px; }
.nav-link { min-height: 44px; width: 100%; display: flex; align-items: center; gap: 12px; text-align: right; color: #b4b5c9; border: 0; border-radius: 8px; padding: 9px 12px; background: transparent; cursor: pointer; }
.nav-link:hover { color: white; background: rgba(255,255,255,.035); }
.nav-link.active { background: linear-gradient(90deg, rgba(121,108,244,.18), rgba(121,108,244,.09)); color: #a99eff; box-shadow: inset -3px 0 #796cf4; }
.nav-icon { display: inline-grid; place-items: center; width: 21px; font-size: 19px; line-height: 1; }
.sidebar-bottom { margin-top: auto; }
.sidebar-help { display: flex; align-items: center; gap: 10px; padding: 13px 10px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); }
.sidebar-help strong, .sidebar-help small { display: block; }
.sidebar-help strong { font-size: 11px; }
.sidebar-help small { color: var(--faint); font-size: 9px; }
.help-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: #a99eff; background: var(--primary-soft); font-weight: 700; }
.logout-button { width: 100%; text-align: right; border: 0; border-radius: 7px; padding: 10px 12px; background: transparent; color: #b5b6c8; cursor: pointer; }
.logout-button span { margin-left: 8px; font-size: 17px; }
.logout-button:hover { color: #ff9292; background: rgba(234,84,85,.08); }
.main-shell { min-height: 100vh; margin-right: 250px; display: flex; flex-direction: column; }
.topbar { height: 76px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; border-bottom: 1px solid var(--line); background: rgba(45,46,66,.72); }
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-title strong { display: block; font-size: 15px; }
.profile-chip { display: flex; align-items: center; gap: 10px; }
.profile-copy strong, .profile-copy small { display: block; }
.profile-copy strong { font-size: 12px; }
.profile-copy small { color: var(--faint); font-size: 10px; }
.avatar { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 50%; color: #b1a8ff; background: rgba(121,108,244,.17); font-weight: 700; }
.menu-toggle { display: none; border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.main-content { width: min(100%, 1320px); margin: 0 auto; padding: 28px 32px 40px; flex: 1; }
.footer { display: flex; justify-content: space-between; padding: 14px 32px; color: #70728b; border-top: 1px solid var(--line); font-size: 10px; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 23px; }
.page-heading h1 { margin: 3px 0 4px; font-size: 21px; }
.page-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.heading-actions { display: flex; gap: 9px; align-items: center; }
.panel, .stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 5px 15px rgba(18,19,32,.08); }
.panel { padding: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-heading h2, .panel-heading h3 { margin: 0; font-size: 14px; }
.panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.company-summary-panel { margin-bottom: 20px; }
.company-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.company-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.018); }
.company-card-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.company-avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: none; border-radius: 10px; color: #b7adff; background: rgba(121,108,244,.15); font-size: 15px; font-weight: 700; }
.company-card-heading > div:last-child { min-width: 0; }
.company-card-heading h3 { margin: 0; overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.company-card-heading span { display: block; overflow: hidden; color: var(--faint); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.company-metrics { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; padding: 12px 0 10px; margin-top: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.company-metrics span, .company-metrics strong { display: block; }
.company-metrics span { color: var(--faint); font-size: 9px; }
.company-metrics strong { margin-top: 2px; color: #d7d7e5; font-size: 11px; }
.company-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 10px; }
.stat-card { min-height: 122px; display: flex; align-items: center; gap: 14px; padding: 16px; }
.stat-icon { width: 43px; height: 43px; display: grid; place-items: center; flex: none; border-radius: 10px; font-size: 20px; }
.stat-icon.purple { background: rgba(121,108,244,.15); color: #a89dff; }
.stat-icon.green { background: rgba(40,199,111,.13); color: #57d98e; }
.stat-icon.orange { background: rgba(255,159,67,.13); color: #ffb56e; }
.stat-icon.blue { background: rgba(0,207,232,.12); color: #59dff0; }
.stat-copy { min-width: 0; }
.stat-copy span, .stat-copy strong, .stat-copy small { display: block; }
.stat-copy span { color: var(--muted); font-size: 10px; }
.stat-copy strong { margin: 4px 0; font-size: 21px; line-height: 1.3; }
.stat-copy small { color: var(--faint); font-size: 10px; }
.inline-link { color: #a99eff; font-size: 11px; cursor: pointer; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 620px; text-align: right; }
th { padding: 10px 12px; color: #8e90aa; font-size: 10px; font-weight: 500; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid rgba(209,211,231,.055); color: #d3d4e2; font-size: 11px; }
tbody tr:last-child td { border-bottom: 0; }
.table-primary { font-weight: 600; color: var(--text); }
.table-secondary { display: block; color: var(--faint); font-size: 10px; }
.status-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; color: #63d995; background: rgba(40,199,111,.1); font-size: 10px; white-space: nowrap; }
.status-badge.neutral { color: #b1a8ff; background: rgba(121,108,244,.13); }
.empty-state { padding: 29px 14px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--text); font-size: 13px; margin-bottom: 5px; }
.empty-state p { margin: 0 0 14px; font-size: 11px; }

.period-card { max-width: 760px; }
.period-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.period-preview { margin-top: 17px; padding: 12px 14px; border-radius: 8px; background: var(--surface-soft); color: var(--muted); font-size: 11px; }
.period-preview strong { color: var(--text); }
.form-actions { display: flex; justify-content: flex-start; gap: 10px; margin-top: 21px; }

.wizard-card { overflow: hidden; }
.wizard-card > .panel-heading { padding: 20px 22px 0; }
.bs-stepper-header { display: grid; grid-template-columns: repeat(4, 1fr); padding: 19px 22px; border-bottom: 1px solid var(--line); }
.step { display: flex; position: relative; min-width: 0; }
.step:not(:last-child)::after { content: ""; height: 1px; position: absolute; top: 17px; left: 0; right: 44px; background: rgba(209,211,231,.13); }
.step-trigger { min-width: 0; display: flex; align-items: center; gap: 9px; position: relative; z-index: 1; border: 0; padding: 0; text-align: right; background: transparent; color: var(--faint); cursor: default; }
.step-trigger.clickable { cursor: pointer; }
.bs-stepper-circle { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border: 1px solid rgba(209,211,231,.17); border-radius: 50%; background: var(--surface); color: #999bb4; font-size: 11px; }
.step.active .bs-stepper-circle, .step.completed .bs-stepper-circle { color: #fff; border-color: var(--primary); background: var(--primary); box-shadow: 0 4px 12px rgba(121,108,244,.25); }
.step.completed .bs-stepper-circle { background: #5549c9; }
.step-label { min-width: 0; }
.step-label strong, .step-label small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-label strong { color: #b8b9cb; font-size: 11px; font-weight: 500; }
.step.active .step-label strong, .step.completed .step-label strong { color: var(--text); }
.step-label small { color: var(--faint); font-size: 9px; }
.wizard-content { padding: 22px; }
.wizard-step-heading { margin-bottom: 19px; }
.wizard-step-heading h2 { margin: 0 0 3px; font-size: 16px; }
.wizard-step-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.form-grid.four { grid-template-columns: repeat(4,minmax(0,1fr)); }
.form-section { padding: 17px; margin-bottom: 15px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.012); }
.form-section:last-child { margin-bottom: 0; }
.form-section-title { display: flex; align-items: baseline; gap: 9px; margin: 0 0 13px; font-size: 12px; }
.form-section-title small { color: var(--faint); font-size: 10px; font-weight: 400; }
.read-only-strip { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 15px; }
.info-pill { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 7px; background: var(--surface-soft); color: var(--muted); font-size: 10px; }
.info-pill strong { color: var(--text); font-weight: 500; }
.computed-box { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 8px; background: var(--primary-soft); color: var(--muted); font-size: 11px; }
.computed-box strong { color: #b4aaff; font-size: 15px; }
.computed-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.reasons-table { display: grid; gap: 10px; }
.reason-row { display: grid; grid-template-columns: 1.05fr 1.4fr 1.4fr; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.reason-row:last-child { border-bottom: 0; padding-bottom: 0; }
.reason-index { color: var(--faint); font-size: 10px; margin-bottom: 4px; }
.wizard-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.wizard-footer-group { display: flex; gap: 9px; }
.preview-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }
.preview-metric { padding: 13px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; }
.preview-metric span, .preview-metric strong { display: block; }
.preview-metric span { color: var(--muted); font-size: 10px; }
.preview-metric strong { margin-top: 4px; font-size: 17px; }
.review-note { padding: 11px 13px; border-right: 3px solid var(--warning); color: #c1c2d1; background: rgba(255,159,67,.07); border-radius: 5px; font-size: 10px; }

.result-banner { padding: 22px; margin-bottom: 16px; border: 1px solid rgba(121,108,244,.21); border-radius: 12px; background: linear-gradient(115deg, rgba(121,108,244,.14), rgba(121,108,244,.035)); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.result-banner h1 { margin: 2px 0 4px; font-size: 20px; }
.result-banner p { margin: 0; color: var(--muted); font-size: 11px; }
.result-meter { width: 175px; flex: none; display: grid; justify-items: center; gap: 5px; }
.result-meter strong { font-size: 20px; }
.result-meter small, .result-meter span { color: var(--muted); font-size: 9px; }
.result-meter progress { width: 100%; height: 8px; border: 0; border-radius: 8px; accent-color: var(--primary); }
.result-meter progress::-webkit-progress-bar { border-radius: 8px; background: rgba(209,211,231,.12); }
.result-meter progress::-webkit-progress-value { border-radius: 8px; background: var(--primary); }
.result-meter progress::-moz-progress-bar { border-radius: 8px; background: var(--primary); }
.result-pills { margin-top: 12px; }
.admin-account-panel { max-width: 780px; margin-bottom: 16px; }
.account-form-actions { grid-column: 1 / -1; margin-top: 0; }
.profile-panel { max-width: 850px; }
.profile-form-actions { grid-column: 1 / -1; margin-top: 0; }
.user-edit-dialog { width: min(720px, calc(100% - 24px)); max-height: calc(100vh - 40px); overflow: auto; padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,.4); }
.user-edit-dialog::backdrop { background: rgba(10,11,22,.72); backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.dialog-heading h2 { margin: 3px 0 0; font-size: 17px; }
.dialog-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.dialog-close:hover { color: var(--text); border-color: var(--primary); }
.checkbox-field { display: flex; align-items: center; gap: 9px; color: #c8c9da; font-size: 12px; }
.checkbox-field input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.result-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.result-list { display: grid; }
.result-row { display: flex; justify-content: space-between; gap: 15px; padding: 9px 0; border-bottom: 1px solid rgba(209,211,231,.055); font-size: 11px; }
.result-row:last-child { border-bottom: 0; }
.result-row span { color: var(--muted); }
.result-row strong { text-align: left; font-weight: 500; }
.detail-section { margin-top: 15px; }
.toast { max-width: min(430px, calc(100vw - 32px)); position: fixed; z-index: 20; bottom: 20px; left: 20px; padding: 11px 16px; opacity: 0; transform: translateY(10px); pointer-events: none; border: 1px solid var(--line); border-radius: 9px; background: #393a50; color: var(--text); box-shadow: 0 10px 35px rgba(0,0,0,.27); transition: opacity .2s, transform .2s; font-size: 12px; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { border-color: rgba(234,84,85,.4); }
.toast.success { border-color: rgba(40,199,111,.35); }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .company-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .form-grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .step-label small { display: none; }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(100%); transition: transform .2s ease; box-shadow: -15px 0 35px rgba(0,0,0,.24); }
  .sidebar.open { transform: translateX(0); }
  .main-shell { margin-right: 0; }
  .menu-toggle { display: inline-block; }
  .topbar { height: 66px; padding: 0 17px; }
  .main-content { padding: 20px 15px 30px; }
  .footer { padding: 12px 15px; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .heading-actions { flex-wrap: wrap; }
  .stats-grid { gap: 9px; }
  .company-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .stat-card { min-height: 105px; padding: 12px; gap: 10px; }
  .stat-icon { width: 37px; height: 37px; }
  .stat-copy strong { font-size: 17px; }
  .bs-stepper-header { padding: 16px 13px; }
  .step { justify-content: center; }
  .step:not(:last-child)::after { right: 50%; left: -50%; top: 16px; }
  .step-trigger { flex-direction: column; gap: 5px; }
  .step-label { display: none; }
  .wizard-content { padding: 16px; }
  .form-grid, .form-grid.two, .form-grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .reason-row { grid-template-columns: 1fr; gap: 8px; }
  .result-grid { grid-template-columns: 1fr; }
  .result-banner { padding: 16px; }
  .result-meter { width: 130px; }
}
@media (max-width: 480px) {
  .auth-card { padding: 30px 23px 24px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .company-grid { grid-template-columns: 1fr; }
  .stat-card { align-items: flex-start; flex-direction: column; }
  .form-grid, .form-grid.two, .form-grid.four, .period-grid, .preview-grid { grid-template-columns: 1fr; }
  .wizard-footer { align-items: stretch; flex-direction: column; }
  .wizard-footer-group { justify-content: space-between; }
  .profile-copy { display: none; }
  .result-banner { align-items: flex-start; }
  .result-banner h1 { font-size: 16px; }
  .result-meter { width: 110px; }
}
