/* The look of the whole app. Loaded after app.css and extra.css, which hold the layout. */
:root {
  --bg: #f2f5f6; --surface: #ffffff; --surface-2: #f6f8f9; --line: #e7ebee; --line-strong: #d5dce1;
  --text: #16212b; --muted: #65727f; --brand: #0d7a69; --brand-strong: #095c50; --brand-soft: #e2f4f0; --brand-ring: rgb(13 122 105 / 18%);
  --mint: #5eead4; --gold: #e3b256;
  --side: #0d2623; --side-2: #091917; --side-text: #a9bdb8; --side-active: rgb(94 234 212 / 11%);
  --ok: #12804a; --ok-soft: #e1f5ea; --warn: #9a6105; --warn-soft: #fcf2da; --bad: #be2a1d; --bad-soft: #fdebe8; --info: #1c5fae; --info-soft: #e5effb;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(16 24 40 / 4%), 0 4px 14px rgb(16 24 40 / 5%);
  --shadow-lift: 0 2px 4px rgb(16 24 40 / 5%), 0 12px 28px rgb(16 24 40 / 10%);
  --btn: linear-gradient(135deg, #12957f 0%, #0b6b5d 100%);
  --series-1: #0f8a76;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) { --bg: #0c1413; --surface: #141d1c; --surface-2: #1a2524; --line: #24312f; --line-strong: #344442;
    --text: #e7eeec; --muted: #94a5a1; --brand: #3fc4ae; --brand-strong: #6adac6; --brand-soft: #14352f; --brand-ring: rgb(63 196 174 / 26%);
    --side: #0a1513; --side-2: #060d0c; --side-text: #9fb3ae; --side-active: rgb(94 234 212 / 10%);
    --ok: #4ade80; --ok-soft: #12301e; --warn: #f0c04f; --warn-soft: #33280f; --bad: #f58a7e; --bad-soft: #3a1915; --info: #7db5f0; --info-soft: #152a41;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%); --shadow-lift: 0 10px 28px rgb(0 0 0 / 45%);
    --btn: linear-gradient(135deg, #17a58d 0%, #0d7868 100%);
    --series-1: #33b39d; } }
/* manual-theme */ :root[data-theme=dark] { --bg: #0c1413; --surface: #141d1c; --surface-2: #1a2524; --line: #24312f; --line-strong: #344442;
    --text: #e7eeec; --muted: #94a5a1; --brand: #3fc4ae; --brand-strong: #6adac6; --brand-soft: #14352f; --brand-ring: rgb(63 196 174 / 26%);
    --side: #0a1513; --side-2: #060d0c; --side-text: #9fb3ae; --side-active: rgb(94 234 212 / 10%);
    --ok: #4ade80; --ok-soft: #12301e; --warn: #f0c04f; --warn-soft: #33280f; --bad: #f58a7e; --bad-soft: #3a1915; --info: #7db5f0; --info-soft: #152a41;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%); --shadow-lift: 0 10px 28px rgb(0 0 0 / 45%);
    --btn: linear-gradient(135deg, #17a58d 0%, #0d7868 100%);
    --series-1: #33b39d; }

/* ---------- type ---------- */
html { scroll-behavior: smooth; }
body { font: 14.5px/1.85 var(--font, Vazirmatn), "Segoe UI", Tahoma, sans-serif; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background: radial-gradient(1100px 380px at 85% -120px, rgb(13 122 105 / 7%), transparent 70%), var(--bg); background-attachment: fixed; }
::selection { background: var(--brand); color: #fff; }
h1 { font-size: 24px; font-weight: 800; letter-spacing: -.2px; }
h2 { font-size: 15.5px; font-weight: 700; }
h3 { font-weight: 700; }
a { transition: color .12s; }
.small { font-size: 12.5px; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 16px; height: 16px; vertical-align: -3px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* ---------- side menu ---------- */
.sidebar { width: 248px; padding: 18px 12px 12px; background: linear-gradient(180deg, var(--side) 0%, var(--side-2) 100%); border-inline-end: 1px solid rgb(255 255 255 / 4%); scrollbar-color: rgb(255 255 255 / 14%) transparent; }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 16px; margin-bottom: 6px; border-bottom: 1px solid rgb(255 255 255 / 7%); font-size: 15.5px; font-weight: 800; line-height: 1.5; }
.brand .mark { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 4px 10px rgb(0 0 0 / 30%)); }
.brand small { display: block; font-size: 11px; font-weight: 400; color: var(--side-text); opacity: .8; }
.nav-title { font-size: 11px; font-weight: 600; letter-spacing: .3px; opacity: .5; padding: 16px 12px 5px; }
.nav a { position: relative; gap: 11px; padding: 8px 12px; border-radius: var(--radius-sm); margin-bottom: 2px; font-size: 13.8px; transition: background .14s, color .14s; }
.nav a:hover { background: rgb(255 255 255 / 6%); }
.nav a.active { background: var(--side-active); color: #fff; font-weight: 700; }
.nav a.active::before { content: ''; position: absolute; inset-inline-start: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 4px; background: var(--mint); }
.nav a.active svg { color: var(--mint); }
.nav svg { width: 18px; height: 18px; opacity: .92; }
.nav .count { background: #e5484d; font-weight: 700; box-shadow: 0 0 0 3px rgb(229 72 77 / 22%); }
.side-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 12px; border-top: 1px solid rgb(255 255 255 / 7%); font-size: 11.5px; }
.side-foot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgb(94 234 212 / 20%); flex: none; }
.side-foot.failed::before { background: #f97066; box-shadow: 0 0 0 3px rgb(249 112 102 / 22%); }

/* ---------- top bar ---------- */
.topbar { min-height: 62px; padding: 10px 26px; gap: 14px; background: color-mix(in srgb, var(--surface) 84%, transparent); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); }
.menu-btn { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 5px 12px; background: var(--surface); }
.global-search { position: relative; max-width: 460px; }
.global-search svg { position: absolute; inset-inline-start: 13px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.global-search input[type=search] { border-radius: 999px; padding-inline-start: 42px; background: var(--surface-2); border-color: transparent; }
.global-search input[type=search]:focus { background: var(--surface); border-color: var(--brand); }
.user-box { gap: 6px; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; color: var(--muted); transition: background .14s, color .14s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell .count { top: 1px; inset-inline-start: 0; background: #e5484d; font-weight: 700; border: 2px solid var(--surface); padding: 3px 5px; }
.user-chip { display: inline-flex; align-items: center; gap: 9px; padding: 4px 6px 4px 12px; border-radius: 999px; color: var(--text); font-weight: 600; font-size: 13.5px; transition: background .14s; }
[dir=rtl] .user-chip { padding: 4px 6px 4px 12px; }
.user-chip:hover { background: var(--surface-2); text-decoration: none; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--btn); color: #fff; font-weight: 700; font-size: 14px; flex: none; }

.avatar.soft { background: var(--brand-soft); color: var(--brand); width: 30px; height: 30px; font-size: 13px; }
.avatar.lg { width: 50px; height: 50px; border-radius: 16px; font-size: 22px; font-weight: 800; box-shadow: 0 6px 16px rgb(9 92 80 / 25%); }
.who { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); vertical-align: middle; }
.who:hover { color: var(--brand); text-decoration: none; }
td a { font-weight: 600; }

/* ---------- page ---------- */
.content { padding: 26px; animation: rise .22s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .content { animation: none; } * { transition: none !important; } }
.page-head { margin-bottom: 20px; gap: 12px; }

.card { border-radius: var(--radius); border-color: var(--line); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-head { padding: 14px 20px; min-height: 54px; }
.card-head h2 { position: relative; padding-inline-start: 12px; }
.card-head h2::before { content: ''; position: absolute; inset-inline-start: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 4px; background: var(--btn); }
.card-body { padding: 20px; }
.grid { gap: 18px; }
.grid + .grid, .grid + .card, .card + .grid { margin-top: 18px; }

.tiles { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { position: relative; overflow: hidden; border-radius: var(--radius); padding: 16px 18px 14px; box-shadow: var(--shadow); background: linear-gradient(160deg, var(--surface) 55%, var(--brand-soft) 220%); }
.tile::before { content: ''; position: absolute; inset-inline-start: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: var(--btn); }
.tile .label { font-size: 12.8px; font-weight: 600; color: var(--muted); }
.tile .value { font-size: 26px; font-weight: 800; letter-spacing: -.3px; line-height: 1.55; }
.tile .hint { font-size: 12px; }
@media (min-width: 1100px) {
  .tiles:has(> .tile:nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tiles:has(> .tile:nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.tile.bad { background: linear-gradient(160deg, var(--surface) 55%, var(--bad-soft) 220%); }
.tile.bad::before { background: var(--bad); }
.tile:has(a.label):hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.tile a.label::after { content: ' ‹'; opacity: .7; }

/* ---------- tables ---------- */
th { font-size: 12.3px; font-weight: 700; padding: 11px 16px; letter-spacing: .1px; border-bottom-color: var(--line); }
td { padding: 11px 16px; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
.card > .table-wrap:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.card > .table-wrap:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.card > .table-wrap:only-child { border-radius: var(--radius); }
.empty { padding: 44px 16px; font-size: 13.5px; }
.pager { padding: 12px 20px; font-size: 13px; }

/* ---------- buttons and fields ---------- */
.btn { min-height: 38px; padding: 6px 18px; border-radius: var(--radius-sm); border: 0; background: var(--btn); color: #fff; font-weight: 700; font-size: 13.5px; box-shadow: 0 1px 2px rgb(9 92 80 / 30%), inset 0 1px 0 rgb(255 255 255 / 16%); transition: filter .14s, transform .08s, box-shadow .14s, background .14s; }
.btn:hover { background: var(--btn); color: #fff; filter: brightness(1.08); box-shadow: 0 4px 12px rgb(9 92 80 / 28%), inset 0 1px 0 rgb(255 255 255 / 16%); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; filter: none; }
.btn.ghost, .btn.danger { background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 1px 2px rgb(16 24 40 / 4%); color: var(--text); font-weight: 600; }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); border-color: color-mix(in srgb, var(--brand) 40%, var(--line-strong)); filter: none; box-shadow: 0 1px 2px rgb(16 24 40 / 6%); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line-strong)); filter: none; box-shadow: none; }
.btn.sm { min-height: 30px; padding: 2px 12px; font-size: 12.5px; border-radius: 8px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .btn, :root:not([data-theme=light]) .btn:hover { color: #fff; } :root:not([data-theme=light]) .btn.ghost, :root:not([data-theme=light]) .btn.ghost:hover { color: var(--text); } :root:not([data-theme=light]) .btn.danger, :root:not([data-theme=light]) .btn.danger:hover { color: var(--bad); } }
/* manual-theme */ :root[data-theme=dark] .btn, :root[data-theme=dark] .btn:hover { color: #fff; } :root[data-theme=dark] .btn.ghost, :root[data-theme=dark] .btn.ghost:hover { color: var(--text); } :root[data-theme=dark] .btn.danger, :root[data-theme=dark] .btn.danger:hover { color: var(--bad); }

input[type=text], input[type=password], input[type=search], input[type=email], input[type=number], input[type=tel], input[type=url], input:not([type]), select, textarea {
  min-height: 38px; border-radius: var(--radius-sm); padding: 6px 12px; border-color: var(--line-strong); transition: border-color .14s, box-shadow .14s, background .14s; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line-strong)); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
input[type=file] { font-size: 13px; }
input[type=file]::file-selector-button { font: inherit; margin-inline-end: 10px; padding: 6px 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); cursor: pointer; }
.field { gap: 5px; }
.field label { font-size: 12.8px; font-weight: 600; }
.filters { padding: 14px 20px; gap: 10px; background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.form-grid { gap: 16px 18px; }
.form-actions { gap: 10px; margin-top: 20px; }

/* ---------- small parts ---------- */
.badge { padding: 0 10px; line-height: 23px; font-size: 12px; font-weight: 600; }
.tag { border-radius: 6px; padding: 0 9px; line-height: 22px; font-weight: 600; }
.flash { position: relative; padding: 12px 16px; padding-inline-start: 20px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 600; overflow: hidden; }
.flash::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 5px; background: currentColor; }
.tabs { gap: 4px; padding: 0 14px; }
.tabs a { padding: 13px 14px 11px; border-bottom-width: 3px; border-radius: 3px 3px 0 0; font-size: 13.8px; transition: color .12s, border-color .12s; }
.tabs a.active { font-weight: 700; }
.tabs-wrap { border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.seg { border-radius: var(--radius-sm); background: var(--surface); }
.seg a { padding: 5px 14px; font-size: 13.3px; }
.seg a.active { font-weight: 700; }
.list-row { padding: 11px 20px; gap: 12px; transition: background .1s; }
.list-row:hover { background: var(--surface-2); }
.stage-bar { padding: 10px 20px; }
.stage-bar .track, .hbar .track, .meter { height: 8px; border-radius: 8px; }
.stage-bar .fill, .hbar .fill { background: var(--btn); border-radius: 8px; }
.hbar { padding: 8px 20px; }
.progress { height: 12px; border-radius: 8px; }
.progress .done { background: var(--btn); border-radius: 8px; }
.timeline li { padding: 14px 20px; }
.insight { padding: 16px 20px; }
.purchase { padding: 12px 20px; }
.facts { gap: 8px 16px; }
.tip { padding: 5px 11px; border-radius: 8px; font-size: 12px; box-shadow: var(--shadow-lift); }
.chart .bar { rx: 5px; }
.chart .bar-value { font-weight: 700; }
.legend i { border-radius: 4px; }
details > summary { cursor: pointer; }

.board { gap: 14px; }
.column { flex-basis: 272px; border-radius: var(--radius); }
.column-head { padding: 12px 14px 10px; font-weight: 700; }
.deal { border-radius: var(--radius-sm); padding: 11px 13px; transition: border-color .12s, box-shadow .12s, transform .12s; }
.deal:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.calendar .cell.today { box-shadow: inset 0 0 0 2px var(--brand); }
.calendar .dow { font-weight: 700; padding: 9px 2px; }
.event { border-radius: 6px; padding: 1px 6px; }

.chat { padding: 16px 20px; gap: 10px; }
.chat-msg { border-radius: 16px; border-start-start-radius: 5px; padding: 9px 14px; box-shadow: 0 1px 1px rgb(16 24 40 / 4%); }
.chat-msg.mine { border-radius: 16px; border-start-end-radius: 5px; background: var(--brand-soft); }
.chat-event { background: var(--surface-2); border-radius: 999px; padding: 2px 12px; }
.composer textarea { border-radius: var(--radius); }
.jp { border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-lift); border-color: var(--line); }
.jp-grid button { border-radius: 8px; padding: 4px 0; }
.jp-grid button.on { background: var(--btn); }
.guide section { scroll-margin-top: 80px; }
.dropping { outline-color: var(--brand); border-radius: var(--radius); }

/* ---------- sign-in ---------- */
.auth { min-height: 100vh; padding: 24px; background: radial-gradient(900px 500px at 12% 0%, rgb(13 122 105 / 12%), transparent 65%), radial-gradient(700px 420px at 100% 100%, rgb(227 178 86 / 10%), transparent 60%), var(--bg); }
.auth-box { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); width: 100%; max-width: 940px; min-height: 540px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: 0 30px 70px rgb(16 24 40 / 14%), 0 4px 14px rgb(16 24 40 / 6%); animation: rise .3s ease-out; }
.auth-side { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; padding: 40px 38px; color: #dff5ef; background: linear-gradient(155deg, #12806f 0%, #0b4f46 55%, #072f2b 100%); }
.auth-side::before, .auth-side::after { content: ''; position: absolute; border-radius: 50%; border: 1px solid rgb(255 255 255 / 12%); pointer-events: none; }
.auth-side::before { width: 420px; height: 420px; inset-inline-end: -170px; top: -150px; box-shadow: 0 0 0 46px rgb(255 255 255 / 4%), 0 0 0 100px rgb(255 255 255 / 3%); }
.auth-side::after { width: 240px; height: 240px; inset-inline-start: -110px; bottom: -110px; background: rgb(94 234 212 / 8%); }
.auth-side > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 13px; font-size: 19px; font-weight: 800; color: #fff; }
.auth-brand .mark { width: 50px; height: 50px; flex: none; filter: drop-shadow(0 8px 18px rgb(0 0 0 / 30%)); }
.auth-side h2 { font-size: 26px; font-weight: 800; line-height: 1.7; color: #fff; margin: 0 0 8px; text-wrap: balance; }
.auth-side p { margin: 0; opacity: .85; font-size: 14px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 13.8px; }
.auth-points li { display: flex; align-items: center; gap: 11px; }
.auth-points li::before { content: '✓'; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: rgb(94 234 212 / 18%); color: var(--mint); font-weight: 700; font-size: 13px; flex: none; }
.auth-card { max-width: none; border: 0; border-radius: 0; padding: 46px 44px; display: flex; flex-direction: column; justify-content: center; background: var(--surface); }
.auth-card h1 { font-size: 25px; margin-bottom: 2px; }
.auth-card > p.muted { margin: 0 0 10px; }
.auth-card .field { margin-top: 16px; }
.auth-card .field input { min-height: 46px; font-size: 15px; }
.auth-card .btn { width: 100%; min-height: 48px; margin-top: 24px; font-size: 15px; }
.auth-card .flash { margin: 12px 0 0; }
.auth-foot { margin-top: 22px; font-size: 12px; color: var(--muted); text-align: center; }
.auth-card.alone { max-width: 420px; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lift); padding: 38px 34px; text-align: center; align-items: center; gap: 6px; }
.auth-card.alone .btn { width: auto; min-width: 180px; }
.qr { border-radius: 12px; padding: 10px; box-shadow: var(--shadow); }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .auth-box { grid-template-columns: minmax(0, 1fr); min-height: 0; max-width: 460px; }
  .auth-side { padding: 26px 26px 24px; gap: 14px; }
  .auth-side h2 { font-size: 19px; margin: 0; }
  .auth-points, .auth-side p { display: none; }
  .auth-card { padding: 30px 26px 34px; }
}
@media (max-width: 760px) {
  .sidebar { box-shadow: 0 0 60px rgb(0 0 0 / 40%); transition: transform .22s ease; }
  body.nav-open::after { content: ''; position: fixed; inset: 0; z-index: 40; background: rgb(9 20 18 / 45%); backdrop-filter: blur(2px); }
  .content { padding: 16px; }
  .topbar { padding: 8px 14px; min-height: 56px; }
  .user-chip .name { display: none; }
  .user-chip { padding: 3px; }
  h1 { font-size: 20px; }
  .tile .value { font-size: 21px; }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .card-head, .card-body { padding-inline: 16px; }
  th, td { padding: 10px 12px; }
}
@media print { body { background: #fff; } .tile, .card { box-shadow: none; } .content { animation: none; } }
