/*
  MizanSoft design system (میزان سافت). RTL, Bootstrap 5.3 RTL underneath, self-hosted assets only.
  Brand: deep navy (trust) + teal (balance, «میزان») + warm gold (value). Everything is responsive: check 390px and 1366px.
  Sections: tokens · base · buttons/forms · cards/tables · site shell · home · account shell · app shell · admin shell ·
            components (date picker, search select, charts, stat, empty) · print.
*/

/* ---------- tokens ---------- */
:root {
    --mz-navy-900: #081a33;
    --mz-navy-800: #0b2447;
    --mz-navy-700: #12335f;
    --mz-teal-600: #0d8a7c;
    --mz-teal-500: #10a191;
    --mz-teal-100: #d9f3ef;
    --mz-teal-50: #eefaf8;
    --mz-gold-500: #d9a441;
    --mz-gold-100: #fbf0d9;

    --mz-bg: #f5f7fb;
    --mz-surface: #ffffff;
    --mz-surface-2: #f9fbfd;
    --mz-border: #e2e8f0;
    --mz-border-strong: #cbd5e1;
    --mz-text: #0f1b2d;
    --mz-muted: #5b6b82;
    --mz-subtle: #8a98ad;

    --mz-success: #15803d;
    --mz-danger: #c0362c;
    --mz-warning: #b7791f;
    --mz-info: #0b6aa2;

    /* Chart series, fixed order. Validated with the dataviz palette checker (light, white surface): lightness band,
       chroma floor, CVD and normal-vision separation, and >= 3:1 contrast all pass. */
    --mz-series-1: #009784;   /* sales */
    --mz-series-2: #3867d6;   /* purchases */
    --mz-series-3: #b98316;
    --mz-series-4: #8b5cf6;
    --mz-series-5: #d9536f;

    --mz-radius: 14px;
    --mz-radius-sm: 10px;
    --mz-shadow-sm: 0 1px 2px rgba(15, 27, 45, .06);
    --mz-shadow: 0 6px 24px rgba(15, 27, 45, .08);
    --mz-shadow-lg: 0 24px 60px rgba(8, 26, 51, .18);
    --mz-gradient: linear-gradient(135deg, var(--mz-navy-800) 0%, var(--mz-navy-700) 45%, var(--mz-teal-600) 100%);

    --bs-body-font-family: var(--font-body);
    --bs-body-color: var(--mz-text);
    --bs-body-bg: var(--mz-bg);
    --bs-border-color: var(--mz-border);
    --bs-primary: var(--mz-teal-600);
    --bs-primary-rgb: 13, 138, 124;
    --bs-link-color: var(--mz-teal-600);
    --bs-link-color-rgb: 13, 138, 124;
    --bs-link-hover-color: var(--mz-navy-700);
    --bs-border-radius: var(--mz-radius-sm);
}

/* ---------- base ---------- */
html, body { background: var(--mz-bg); color: var(--mz-text); font-family: var(--font-body); }
body { font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5 { font-weight: 700; color: var(--mz-navy-900); }
/* Persian text breaks with letter-spacing; use word-spacing where extra air is needed. */
.ltr { direction: ltr; unicode-bidi: embed; }
.num { font-feature-settings: "tnum" 1; white-space: nowrap; }
.text-muted, .text-secondary { color: var(--mz-muted) !important; }
.small-muted { color: var(--mz-muted); font-size: .85rem; }
.min-w-0 { min-width: 0; }
.fw-500 { font-weight: 500; }
a { text-decoration: none; }
::selection { background: var(--mz-teal-100); }
:focus-visible { outline: 2px solid var(--mz-teal-500); outline-offset: 2px; }

.boot-screen { min-height: 100vh; display: grid; place-items: center; gap: 12px; color: var(--mz-navy-800); font-weight: 700; }
.boot-ring { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--mz-teal-100); border-top-color: var(--mz-teal-600); animation: mz-spin .8s linear infinite; }
@keyframes mz-spin { to { transform: rotate(360deg); } }

#blazor-error-ui { display: none; position: fixed; inset: auto 0 0 0; z-index: 2000; background: #fff4e5; padding: .75rem 1.25rem; box-shadow: var(--mz-shadow); }
#blazor-error-ui .dismiss { cursor: pointer; float: left; }

/* ---------- buttons & forms ---------- */
.btn { border-radius: var(--mz-radius-sm); font-weight: 500; }
.btn-primary { --bs-btn-bg: var(--mz-teal-600); --bs-btn-border-color: var(--mz-teal-600); --bs-btn-hover-bg: #0b766a; --bs-btn-hover-border-color: #0b766a; --bs-btn-active-bg: #0a6a60; --bs-btn-disabled-bg: var(--mz-teal-600); --bs-btn-disabled-border-color: var(--mz-teal-600); }
.btn-dark { --bs-btn-bg: var(--mz-navy-800); --bs-btn-border-color: var(--mz-navy-800); --bs-btn-hover-bg: var(--mz-navy-900); }
.btn-outline-primary { --bs-btn-color: var(--mz-teal-600); --bs-btn-border-color: var(--mz-teal-600); --bs-btn-hover-bg: var(--mz-teal-600); --bs-btn-hover-border-color: var(--mz-teal-600); }
.btn-gold { background: var(--mz-gold-500); color: var(--mz-navy-900); border: 0; }
.btn-gold:hover { background: #c99532; color: var(--mz-navy-900); }
.btn-soft { background: var(--mz-teal-50); color: var(--mz-teal-600); border: 1px solid var(--mz-teal-100); }
.btn-soft:hover { background: var(--mz-teal-100); color: var(--mz-navy-800); }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; }
.form-label { font-weight: 500; font-size: .9rem; color: var(--mz-navy-800); margin-bottom: .3rem; }
.form-control, .form-select { border-radius: var(--mz-radius-sm); border-color: var(--mz-border-strong); }
.form-control:focus, .form-select:focus { border-color: var(--mz-teal-500); box-shadow: 0 0 0 .2rem rgba(16, 161, 145, .15); }
.form-text { color: var(--mz-muted); }
.required::after { content: " *"; color: var(--mz-danger); }
.input-money { text-align: left; direction: ltr; font-feature-settings: "tnum" 1; }

/* ---------- cards, tables, badges ---------- */
.mz-card { background: var(--mz-surface); border: 1px solid var(--mz-border); border-radius: var(--mz-radius); box-shadow: var(--mz-shadow-sm); }
.mz-card-body { padding: 1.25rem; }
.mz-card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--mz-border); display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.mz-card-header h2, .mz-card-header h3 { font-size: 1.05rem; margin: 0; }
.mz-table { width: 100%; margin: 0; font-size: .92rem; }
.mz-table thead th { background: var(--mz-surface-2); color: var(--mz-muted); font-weight: 500; font-size: .82rem; border-bottom: 1px solid var(--mz-border); padding: .7rem .75rem; white-space: nowrap; }
.mz-table td { padding: .65rem .75rem; border-bottom: 1px solid var(--mz-border); vertical-align: middle; }
.mz-table tbody tr:hover td { background: #fbfdff; }
.mz-table tfoot td { font-weight: 700; background: var(--mz-surface-2); padding: .7rem .75rem; }
.mz-table .amount { text-align: left; direction: ltr; font-feature-settings: "tnum" 1; white-space: nowrap; }
.mz-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Bootstrap's .visually-hidden is position:absolute; inside a scrolling table its containing block is outside the wrap, so it
   escaped the clipping and widened the whole page on phones (390px). Fixed elements never add to the page scroll. */
.mz-table-wrap .visually-hidden { position: fixed !important; }
.mz-table tr.clickable { cursor: pointer; }
.badge { font-weight: 500; border-radius: 999px; padding: .35em .75em; }
.badge-soft-success { background: #e6f6ec; color: var(--mz-success); }
.badge-soft-danger { background: #fdecea; color: var(--mz-danger); }
.badge-soft-warning { background: #fdf3e1; color: var(--mz-warning); }
.badge-soft-info { background: #e5f2fb; color: var(--mz-info); }
.badge-soft-muted { background: #eef2f7; color: var(--mz-muted); }
.badge-soft-teal { background: var(--mz-teal-50); color: var(--mz-teal-600); }
.alert { border-radius: var(--mz-radius-sm); }

/* ---------- page header (inside app/account/admin) ---------- */
.mz-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.mz-page-header h1 { font-size: 1.4rem; margin: 0; }
.mz-page-header p { color: var(--mz-muted); margin: .25rem 0 0; font-size: .92rem; }
.mz-toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---------- brand ---------- */
.mz-brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--mz-navy-900); }
.mz-brand img { flex: none; }
.mz-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.mz-brand-text strong { font-size: 1.15rem; font-weight: 700; }
.mz-brand-text small { font-size: .72rem; color: var(--mz-muted); word-spacing: .15em; }
.mz-brand.light, .mz-brand.light small { color: #fff; }
.mz-brand.light small { opacity: .7; }

/* ---------- site shell ---------- */
.mz-container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 18px; }
.mz-header { position: sticky; top: 0; z-index: 1030; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid rgba(226, 232, 240, .7); }
.mz-nav { display: flex; align-items: center; gap: .25rem; }
.mz-nav a, .mz-nav .mz-nav-btn { color: var(--mz-navy-800); padding: .5rem .8rem; border-radius: 10px; font-weight: 500; font-size: .95rem; background: none; border: 0; }
.mz-nav a:hover, .mz-nav a.active { background: var(--mz-teal-50); color: var(--mz-teal-600); }
.mz-nav .mz-nav-cta { background: var(--mz-teal-600); color: #fff; }
.mz-nav .mz-nav-cta:hover { background: var(--mz-navy-800); color: #fff; }
.mz-menu-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--mz-border); background: #fff; font-size: 1.3rem; color: var(--mz-navy-800); }
@media (max-width: 991.98px) {
    .mz-nav { display: none; position: absolute; inset: 100% 12px auto 12px; flex-direction: column; align-items: stretch; gap: .15rem; padding: .75rem; background: #fff; border: 1px solid var(--mz-border); border-radius: var(--mz-radius); box-shadow: var(--mz-shadow-lg); }
    .mz-nav.open { display: flex; }
    .mz-nav a, .mz-nav .mz-nav-btn { text-align: right; }
}
.mz-footer { background: var(--mz-navy-900); color: rgba(255, 255, 255, .72); margin-top: 4rem; }
.mz-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 1rem; }
.mz-footer a { color: rgba(255, 255, 255, .72); display: block; padding: .2rem 0; }
.mz-footer a:hover { color: #fff; }
.mz-footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; }

.mz-section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.mz-eyebrow { display: inline-flex; align-items: center; gap: .4rem; color: var(--mz-teal-600); background: var(--mz-teal-50); border: 1px solid var(--mz-teal-100); padding: .3rem .85rem; border-radius: 999px; font-size: .85rem; font-weight: 500; }
.mz-h2 { font-size: clamp(1.5rem, 3.4vw, 2.3rem); line-height: 1.45; margin: .9rem 0 .6rem; }
.mz-lead { color: var(--mz-muted); font-size: clamp(1rem, 1.6vw, 1.12rem); line-height: 2; max-width: 720px; }
.mz-center { text-align: center; }
.mz-center .mz-lead { margin-inline: auto; }

/* ---------- home ---------- */
.mz-hero { position: relative; overflow: hidden; background: var(--mz-gradient); color: #fff; padding-block: clamp(3rem, 8vw, 6rem) clamp(4rem, 9vw, 7rem); }
.mz-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 60% at 15% 20%, rgba(16, 161, 145, .35), transparent 70%), radial-gradient(40% 50% at 90% 80%, rgba(217, 164, 65, .22), transparent 70%); pointer-events: none; }
.mz-hero .mz-container { position: relative; }
.mz-hero h1 { color: #fff; font-size: clamp(1.9rem, 4.6vw, 3.2rem); line-height: 1.45; font-weight: 700; margin: 1rem 0; }
.mz-hero h1 em { font-style: normal; color: var(--mz-gold-500); }
.mz-hero p { color: rgba(255, 255, 255, .82); font-size: clamp(1rem, 1.7vw, 1.18rem); line-height: 2.05; }
.mz-hero .mz-eyebrow { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; }
.mz-hero-points { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; color: rgba(255, 255, 255, .85); font-size: .92rem; }
.mz-hero-points i { color: var(--mz-gold-500); }
.mz-hero-art { position: relative; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .35)); }
.mz-hero-art svg { width: 100%; height: auto; display: block; }
.mz-float { animation: mz-float 7s ease-in-out infinite; }
.mz-float.delay { animation-delay: -3.5s; }
@keyframes mz-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.mz-wave { position: absolute; inset: auto 0 -1px 0; line-height: 0; }
.mz-wave svg { width: 100%; height: 60px; display: block; }

.mz-trust { margin-top: -2.5rem; position: relative; z-index: 2; }
.mz-stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: #fff; border-radius: var(--mz-radius); box-shadow: var(--mz-shadow); border: 1px solid var(--mz-border); }
.mz-stat-strip > div { padding: 1.2rem 1rem; text-align: center; border-inline-start: 1px solid var(--mz-border); }
.mz-stat-strip > div:first-child { border-inline-start: 0; }
.mz-stat-strip strong { display: block; font-size: 1.5rem; color: var(--mz-navy-800); }
.mz-stat-strip span { color: var(--mz-muted); font-size: .88rem; }
@media (max-width: 767.98px) {
    .mz-stat-strip { grid-template-columns: repeat(2, 1fr); }
    .mz-stat-strip > div:nth-child(3) { border-inline-start: 0; }
    .mz-stat-strip > div:nth-child(n+3) { border-top: 1px solid var(--mz-border); }
}

.mz-reason { height: 100%; padding: 1.5rem; background: #fff; border: 1px solid var(--mz-border); border-radius: var(--mz-radius); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.mz-reason:hover { transform: translateY(-4px); box-shadow: var(--mz-shadow); border-color: var(--mz-teal-100); }
.mz-reason h3 { font-size: 1.08rem; margin: 1rem 0 .5rem; }
.mz-reason p { color: var(--mz-muted); margin: 0; line-height: 1.95; font-size: .95rem; }
.mz-icon-tile { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.45rem; background: var(--mz-teal-50); color: var(--mz-teal-600); }
.mz-icon-tile.gold { background: var(--mz-gold-100); color: #9a6b12; }
.mz-icon-tile.navy { background: #e8eef8; color: var(--mz-navy-700); }

.mz-feature-row { align-items: center; }
.mz-feature-row + .mz-feature-row { margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.mz-check-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.mz-check-list li { display: flex; gap: .6rem; padding: .35rem 0; color: var(--mz-text); line-height: 1.9; }
.mz-check-list li i { color: var(--mz-teal-600); margin-top: .25rem; }
.mz-mock { background: #fff; border: 1px solid var(--mz-border); border-radius: 18px; box-shadow: var(--mz-shadow-lg); overflow: hidden; }
.mz-mock svg { width: 100%; height: auto; display: block; }

.mz-band { background: linear-gradient(180deg, #fff 0%, var(--mz-teal-50) 100%); }
.mz-steps { counter-reset: step; }
.mz-step { position: relative; padding: 1.5rem 1.25rem 1.25rem; background: #fff; border-radius: var(--mz-radius); border: 1px solid var(--mz-border); height: 100%; }
.mz-step::before { counter-increment: step; content: counter(step, persian); position: absolute; top: -18px; right: 20px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--mz-gradient); color: #fff; font-weight: 700; box-shadow: var(--mz-shadow); }
.mz-step h3 { font-size: 1.02rem; margin: .5rem 0; }
.mz-step p { color: var(--mz-muted); margin: 0; font-size: .93rem; line-height: 1.9; }

.mz-plan { height: 100%; display: flex; flex-direction: column; padding: 1.75rem 1.5rem; background: #fff; border: 1px solid var(--mz-border); border-radius: 18px; position: relative; }
.mz-plan.highlight { border: 2px solid var(--mz-teal-600); box-shadow: var(--mz-shadow-lg); }
.mz-plan-badge { position: absolute; top: -13px; right: 50%; transform: translateX(50%); background: var(--mz-gold-500); color: var(--mz-navy-900); font-size: .78rem; font-weight: 700; padding: .25rem .9rem; border-radius: 999px; white-space: nowrap; }
.mz-plan h3 { font-size: 1.2rem; margin: 0 0 .4rem; }
.mz-plan .price { font-size: 1.9rem; font-weight: 700; color: var(--mz-navy-900); margin: 1rem 0 .1rem; }
.mz-plan .price small { font-size: .85rem; color: var(--mz-muted); font-weight: 400; }
.mz-plan ul { list-style: none; padding: 0; margin: 1.25rem 0 1.5rem; flex: 1; }
.mz-plan li { display: flex; gap: .5rem; padding: .3rem 0; font-size: .93rem; }
.mz-plan li i { color: var(--mz-teal-600); }
.mz-period-toggle { display: inline-flex; padding: 4px; background: #fff; border: 1px solid var(--mz-border); border-radius: 999px; }
.mz-period-toggle button { border: 0; background: none; padding: .45rem 1.2rem; border-radius: 999px; font-weight: 500; color: var(--mz-muted); }
.mz-period-toggle button.active { background: var(--mz-navy-800); color: #fff; }

.mz-faq .accordion-button { font-weight: 500; }
.mz-faq .accordion-button:not(.collapsed) { background: var(--mz-teal-50); color: var(--mz-navy-800); box-shadow: none; }
.mz-faq .accordion-item { border-color: var(--mz-border); }

.mz-cta { background: var(--mz-gradient); color: #fff; border-radius: 22px; padding: clamp(2rem, 5vw, 3.5rem); position: relative; overflow: hidden; }
.mz-cta h2 { color: #fff; }
.mz-cta p { color: rgba(255, 255, 255, .82); }

/* ---------- auth card ---------- */
.mz-auth { min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 2rem 0; }
.mz-auth-card { width: 100%; max-width: 440px; }
.otp-input { letter-spacing: normal; text-align: center; font-size: 1.4rem; font-feature-settings: "tnum" 1; direction: ltr; }

/* ---------- account shell ---------- */
.account-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 1.5rem; padding-block: 2rem; }
.account-menu { position: sticky; top: 88px; align-self: start; background: #fff; border: 1px solid var(--mz-border); border-radius: var(--mz-radius); padding: .75rem; }
.account-user { display: flex; align-items: center; gap: .75rem; padding: .5rem .5rem 1rem; border-bottom: 1px solid var(--mz-border); margin-bottom: .5rem; }
.account-avatar { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--mz-teal-50); color: var(--mz-teal-600); font-size: 1.2rem; }
.account-user small { color: var(--mz-muted); }
.account-nav { display: flex; flex-direction: column; gap: .15rem; }
.account-nav a { display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; border-radius: 10px; color: var(--mz-navy-800); font-weight: 500; font-size: .93rem; }
.account-nav a:hover { background: var(--mz-surface-2); }
.account-nav a.active { background: var(--mz-teal-50); color: var(--mz-teal-600); }
.account-nav .account-cta { background: var(--mz-teal-600); color: #fff; margin-bottom: .35rem; }
.account-nav .account-cta:hover, .account-nav .account-cta.active { background: var(--mz-navy-800); color: #fff; }
@media (max-width: 991.98px) {
    .account-shell { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding-block: 1rem; }
    .account-menu { position: static; padding: .4rem; }
    .account-nav { flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .account-nav a { white-space: nowrap; flex: none; }
}

/* ---------- app shell (accounting) ---------- */
.app-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.app-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--mz-navy-900); color: rgba(255, 255, 255, .78); padding: 1rem .75rem 2rem; }
.app-sidebar .mz-brand { padding: .25rem .5rem 1rem; }
.app-nav-group { margin-top: 1rem; }
.app-nav-group > span { display: block; padding: 0 .75rem .35rem; font-size: .75rem; color: rgba(255, 255, 255, .45); }
.app-sidebar a { display: flex; align-items: center; gap: .65rem; padding: .55rem .75rem; border-radius: 10px; color: rgba(255, 255, 255, .8); font-size: .92rem; }
.app-sidebar a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.app-sidebar a.active { background: rgba(16, 161, 145, .22); color: #fff; box-shadow: inset -3px 0 0 var(--mz-teal-500); }
.app-sidebar a i { font-size: 1.05rem; opacity: .9; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-topbar { position: sticky; top: 0; z-index: 1020; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--mz-border); padding: .6rem 1rem; display: flex; align-items: center; gap: .75rem; }
.app-topbar .company-switch { min-width: 0; max-width: 320px; }
.app-content { padding: 1.25rem; flex: 1; }
@media (min-width: 992px) { .app-content { padding: 1.75rem 2rem; } }
.app-readonly { background: #fff7e6; border-bottom: 1px solid #f3dfb2; color: #7a5410; padding: .55rem 1rem; font-size: .9rem; }
.app-backdrop { position: fixed; inset: 0; background: rgba(8, 26, 51, .45); z-index: 1039; }
@media (max-width: 991.98px) {
    .app-shell { grid-template-columns: minmax(0, 1fr); }
    .app-sidebar { position: fixed; inset: 0 0 0 auto; width: 280px; z-index: 1040; transform: translateX(100%); transition: transform .25s ease; }
    .app-sidebar.open { transform: none; }
}

/* ---------- admin shell (Bootstrap, Rule/1.txt) ---------- */
.admin-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #111827; color: rgba(255, 255, 255, .8); }
.admin-sidebar .nav-link { color: rgba(255, 255, 255, .78); border-radius: 10px; padding: .5rem .75rem; display: flex; gap: .6rem; align-items: center; font-size: .92rem; }
.admin-sidebar .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.admin-sidebar .nav-link.active { background: var(--mz-teal-600); color: #fff; }
.admin-main { min-width: 0; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--mz-border); position: sticky; top: 0; z-index: 1020; }
.admin-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 1039; }
@media (max-width: 991.98px) {
    .admin-shell { grid-template-columns: minmax(0, 1fr); }
    .admin-sidebar { position: fixed; inset: 0 0 0 auto; width: 270px; z-index: 1040; transform: translateX(100%); transition: transform .25s ease; }
    .admin-sidebar.open { transform: none; }
}

/* ---------- stat cards ---------- */
.mz-stat { padding: 1.1rem 1.2rem; background: #fff; border: 1px solid var(--mz-border); border-radius: var(--mz-radius); height: 100%; }
.mz-stat .label { color: var(--mz-muted); font-size: .85rem; display: flex; align-items: center; gap: .4rem; }
.mz-stat .value { font-size: 1.35rem; font-weight: 700; color: var(--mz-navy-900); margin-top: .35rem; direction: ltr; text-align: right; font-feature-settings: "tnum" 1; }
.mz-stat .unit { font-size: .78rem; color: var(--mz-subtle); font-weight: 400; }
.mz-stat.accent { background: var(--mz-gradient); border: 0; }
.mz-stat.accent .label, .mz-stat.accent .unit { color: rgba(255, 255, 255, .75); }
.mz-stat.accent .value { color: #fff; }

/* ---------- empty state ---------- */
.mz-empty { text-align: center; padding: 2.5rem 1rem; color: var(--mz-muted); }
.mz-empty i { font-size: 2.2rem; color: var(--mz-border-strong); display: block; margin-bottom: .5rem; }

/* ---------- Jalali date picker ---------- */
.mz-date { position: relative; }
.mz-date .form-control { direction: ltr; text-align: right; }
.mz-date-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 1060; width: 290px; background: #fff; border: 1px solid var(--mz-border); border-radius: var(--mz-radius); box-shadow: var(--mz-shadow-lg); padding: .75rem; }
.mz-date-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.mz-date-head strong { font-size: .95rem; }
.mz-date-head select { width: auto; padding-block: .15rem; font-size: .85rem; }
.mz-date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.mz-date-grid .dow { font-size: .72rem; color: var(--mz-subtle); padding: .2rem 0; }
.mz-date-grid button { border: 0; background: none; border-radius: 8px; padding: .38rem 0; font-size: .88rem; color: var(--mz-text); }
.mz-date-grid button:hover { background: var(--mz-teal-50); }
.mz-date-grid button.today { box-shadow: inset 0 0 0 1px var(--mz-teal-500); }
.mz-date-grid button.selected { background: var(--mz-teal-600); color: #fff; }
.mz-date-grid button.friday { color: var(--mz-danger); }
.mz-date-grid button.selected.friday { color: #fff; }
.mz-date-foot { display: flex; justify-content: space-between; margin-top: .5rem; }

/* ---------- search select ---------- */
.mz-select { position: relative; }
.mz-select-list { position: absolute; top: calc(100% + 4px); right: 0; left: 0; z-index: 1060; max-height: 280px; overflow-y: auto; background: #fff; border: 1px solid var(--mz-border); border-radius: var(--mz-radius-sm); box-shadow: var(--mz-shadow-lg); padding: .25rem; }
.mz-select-list button { display: flex; width: 100%; gap: .5rem; align-items: baseline; text-align: right; border: 0; background: none; padding: .45rem .6rem; border-radius: 8px; font-size: .9rem; }
.mz-select-list button:hover, .mz-select-list button.active { background: var(--mz-teal-50); }
.mz-select-list .code { color: var(--mz-muted); font-size: .8rem; direction: ltr; font-feature-settings: "tnum" 1; }
.mz-select-list .hint { margin-inline-start: auto; color: var(--mz-subtle); font-size: .78rem; }

/* ---------- document editor lines ---------- */
.mz-lines td { padding: .35rem .4rem; }
.mz-lines .form-control, .mz-lines .form-select { padding: .35rem .5rem; font-size: .9rem; }
.mz-lines .row-no { width: 36px; text-align: center; color: var(--mz-muted); }
.mz-totals { display: grid; grid-template-columns: auto auto; gap: .35rem 1.5rem; justify-content: end; font-size: .95rem; }
.mz-totals dt { color: var(--mz-muted); font-weight: 400; }
.mz-totals dd { margin: 0; text-align: left; direction: ltr; font-feature-settings: "tnum" 1; font-weight: 500; }
.mz-totals .grand { font-size: 1.1rem; font-weight: 700; color: var(--mz-navy-900); }
.mz-balance-ok { color: var(--mz-success); }
.mz-balance-bad { color: var(--mz-danger); }

/* ---------- charts (inline SVG) ---------- */
.mz-chart { width: 100%; }
.mz-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.mz-chart .grid-line { stroke: var(--mz-border); stroke-width: 1; }
.mz-chart .axis-label { fill: var(--mz-subtle); font-size: 11px; font-family: var(--font-body); }
.mz-chart .bar { transition: opacity .2s ease; }
.mz-chart .bar:hover { opacity: .8; }
.mz-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; font-size: .85rem; color: var(--mz-muted); }
.mz-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.mz-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.mz-chart-tip { position: absolute; pointer-events: none; background: var(--mz-navy-900); color: #fff; font-size: .8rem; padding: .4rem .6rem; border-radius: 8px; white-space: nowrap; transform: translate(50%, -110%); }

/* ---------- reports ---------- */
.mz-report-tabs { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .25rem; }
.mz-report-tabs a { white-space: nowrap; padding: .5rem .9rem; border-radius: 999px; border: 1px solid var(--mz-border); background: #fff; color: var(--mz-navy-800); font-size: .9rem; }
.mz-report-tabs a.active { background: var(--mz-navy-800); color: #fff; border-color: var(--mz-navy-800); }
.mz-print-head { display: none; }

/* ---------- print ---------- */
@media print {
    @page { size: A4; margin: 12mm; }
    body { background: #fff; }
    .app-sidebar, .app-topbar, .app-readonly, .no-print, .mz-header, .mz-footer, .admin-sidebar, .admin-topbar, .mz-report-tabs { display: none !important; }
    .app-shell, .admin-shell { display: block; }
    .app-content { padding: 0; }
    .mz-card { border: 0; box-shadow: none; }
    .mz-print-head { display: block; text-align: center; margin-bottom: 1rem; }
    .mz-table td, .mz-table th { padding: .35rem .45rem; font-size: 11px; }
    a { color: inherit; }
}

/* Phones: a .g-5 row's negative margins (-1.5rem) are wider than the container padding, which pushed the public pages
   6–14px past the screen at 390px. Keep the default gutter there. */
@media (max-width: 575.98px) {
    .row.g-5, .row.gx-5 { --bs-gutter-x: 1.5rem; }
}
/* Scroll-in animations (.mz-reveal.from-side) start shifted sideways; clip them so they never widen the page. `clip` (unlike
   `hidden`) creates no scroll container, so the sticky anchor bar keeps working. */
main { overflow-x: clip; }

/* job/5.txt: rights line in the footer bottom bar, with the company link inside the sentence. */
.mz-footer .mz-footer-rights a { display: inline; padding: 0; color: #fff; font-weight: 500; border-bottom: 1px dashed rgba(255, 255, 255, .45); }
.mz-footer .mz-footer-rights a:hover { border-bottom-style: solid; }
