@font-face { font-family: 'Vazirmatn'; src: url('/fonts/Vazirmatn.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --navy: #16233f;
  --navy-light: #1f3358;
  --navy-lighter: #2b477e;
  --gray-50: #f6f7f9;
  --gray-100: #eef0f3;
  --gray-200: #e2e5ea;
  --gray-400: #9aa3b2;
  --gray-600: #5b6472;
  --gray-800: #2a2f38;
  --white: #ffffff;
  --orange: #f2802e;
  --orange-dark: #d76a1c;
  --green: #2f9e5b;
  --red: #d94f4f;
  --radius: 14px;
  --shadow: 0 2px 14px rgba(22, 35, 63, 0.06);
  --shadow-md: 0 6px 24px rgba(22, 35, 63, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  direction: rtl;
}

#app { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 250px;
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 8px 8px 24px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--orange); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px;
}
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--gray-400); }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a {
  color: var(--gray-200);
  text-decoration: none;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--navy-light); color: var(--white); }
.nav a.active { background: var(--orange); color: var(--white); font-weight: 600; }
.nav-icon { font-size: 15px; opacity: .85; width: 18px; text-align: center; }
.sidebar-footer { font-size: 11px; color: var(--gray-400); padding: 10px 8px 0; }

/* ---------- content ---------- */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 5;
}
.topbar-title { font-size: 19px; font-weight: 700; color: var(--navy); }
.view { padding: 24px 28px 60px; }

/* ---------- buttons ---------- */
.btn {
  border: none; border-radius: 10px; padding: 10px 18px;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: filter .15s, transform .05s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-outline { background: var(--white); color: var(--navy); border: 1px solid var(--gray-200); }
.btn-outline:hover { background: var(--gray-100); }
.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-danger { background: #fdeceb; color: var(--red); }
.btn-danger:hover { background: #fbdcda; }
.btn-success { background: #e7f6ec; color: var(--green); }
.btn-success:hover { background: #d8f1e0; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card + .card { margin-top: 18px; }
.card-title { font-weight: 700; font-size: 15px; color: var(--navy); margin-bottom: 14px; }

/* ---------- KPI grid ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.kpi-card .kpi-label { font-size: 12.5px; color: var(--gray-600); margin-bottom: 8px; }
.kpi-card .kpi-value { font-size: 21px; font-weight: 800; color: var(--navy); }
.kpi-card .kpi-bar { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--orange); }
.kpi-card.accent-green .kpi-bar { background: var(--green); }
.kpi-card.accent-red .kpi-bar { background: var(--red); }
.kpi-card.accent-navy .kpi-bar { background: var(--navy); }

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.chart-box { height: 260px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 10px; text-align: right; }
thead th { color: var(--gray-600); font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--gray-200); }
tbody tr { border-bottom: 1px solid var(--gray-100); }
tbody tr:hover { background: var(--gray-50); }
tbody tr.row-cancelled { opacity: .55; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge-awaiting { background: #fdf1e3; color: var(--orange-dark); }
.badge-progress { background: #e8eefc; color: var(--navy-lighter); }
.badge-completed { background: #e7f6ec; color: var(--green); }
.badge-cancelled { background: var(--gray-200); color: var(--gray-600); }
.badge-deadline-ok { background: #e7f6ec; color: var(--green); }
.badge-deadline-near { background: #fdf1e3; color: var(--orange-dark); }
.badge-deadline-overdue { background: #fdeceb; color: var(--red); }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; color: var(--gray-600); margin-bottom: 6px; font-weight: 600; }
input[type=text], input[type=email], input[type=tel], input[type=number], textarea, select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--gray-200);
  font-family: inherit; font-size: 13.5px; background: var(--white); color: var(--gray-800);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--orange); }
textarea { resize: vertical; min-height: 90px; }
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field-error { color: var(--red); font-size: 12px; margin-top: 4px; }
.hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: end; }
.filters .field { margin-bottom: 0; min-width: 150px; }

/* ---------- wizard ---------- */
.stepper { display: flex; align-items: center; margin-bottom: 26px; }
.step { display: flex; align-items: center; flex: 1; }
.step-circle {
  width: 32px; height: 32px; border-radius: 50%; background: var(--gray-200); color: var(--gray-600);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.step.done .step-circle { background: var(--green); color: var(--white); }
.step.active .step-circle { background: var(--orange); color: var(--white); }
.step-label { font-size: 12.5px; margin-inline-start: 8px; color: var(--gray-600); white-space: nowrap; }
.step.active .step-label { color: var(--navy); font-weight: 700; }
.step-line { flex: 1; height: 2px; background: var(--gray-200); margin: 0 10px; }
.step.done + .step .step-line, .step-line.done { background: var(--green); }

.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.type-card {
  border: 2px solid var(--gray-200); border-radius: var(--radius); padding: 16px;
  cursor: pointer; text-align: center; font-weight: 600; font-size: 13.5px; color: var(--gray-800);
  transition: border-color .15s, background .15s;
}
.type-card:hover { border-color: var(--orange); }
.type-card.selected { border-color: var(--orange); background: #fff6ee; color: var(--orange-dark); }

.wizard-actions { display: flex; justify-content: space-between; margin-top: 24px; }

/* ---------- timeline ---------- */
.status-timeline { display: flex; align-items: center; margin: 8px 0 24px; }
.timeline-log { display: flex; flex-direction: column; gap: 14px; }
.timeline-item { display: flex; gap: 12px; }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--orange); margin-top: 5px; flex-shrink: 0; }
.timeline-text { font-size: 13.5px; }
.timeline-meta { font-size: 11.5px; color: var(--gray-400); margin-top: 2px; }

/* ---------- details grid ---------- */
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--gray-100); font-size: 13.5px; }
.info-row .label { color: var(--gray-600); }
.info-row .value { font-weight: 600; }

/* ---------- file list ---------- */
.file-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: var(--gray-50); border-radius: 10px; margin-bottom: 8px; font-size: 13px; }

/* ---------- empty / error state ---------- */
.empty-state, .error-state { text-align: center; padding: 60px 20px; color: var(--gray-400); }
.empty-state .icon, .error-state .icon { font-size: 36px; margin-bottom: 10px; }
.error-state { color: var(--red); }

/* ---------- toast ---------- */
.toast-host { position: fixed; bottom: 24px; left: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 999; }
.toast { padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow-md); font-size: 13.5px; font-weight: 600; color: var(--white); animation: toast-in .2s ease; }
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }
.toast-info { background: var(--navy); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- modal ---------- */
.modal-host { position: fixed; inset: 0; background: rgba(22,35,63,.45); display: flex; align-items: center; justify-content: center; z-index: 998; }
.modal-host.hidden { display: none; }
.modal-box { background: var(--white); border-radius: var(--radius); padding: 24px; width: 400px; max-width: 92vw; box-shadow: var(--shadow-md); }
.modal-title { font-weight: 700; font-size: 15.5px; color: var(--navy); margin-bottom: 10px; }
.modal-body { font-size: 13.5px; color: var(--gray-600); margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- calendar ---------- */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-title { font-weight: 700; font-size: 16px; color: var(--navy); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-weekday { text-align: center; font-size: 12px; color: var(--gray-600); font-weight: 600; padding-bottom: 6px; }
.cal-cell { min-height: 84px; background: var(--gray-50); border-radius: 10px; padding: 6px; font-size: 12px; }
.cal-cell.empty { background: transparent; }
.cal-cell .cal-day-num { font-weight: 700; color: var(--gray-600); margin-bottom: 4px; }
.cal-cell.today .cal-day-num { color: var(--orange); }
.cal-event { background: var(--navy); color: var(--white); border-radius: 6px; padding: 2px 6px; font-size: 10.5px; margin-bottom: 3px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event.overdue { background: var(--red); }
.cal-event.near { background: var(--orange); }

/* ---------- loading ---------- */
.spinner { width: 26px; height: 26px; border: 3px solid var(--gray-200); border-top-color: var(--orange); border-radius: 50%; animation: spin .7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  #app { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; align-items: center; padding: 10px 14px; overflow-x: auto; }
  .brand { padding: 0; margin-inline-end: 12px; }
  .brand-text { display: none; }
  .nav { flex-direction: row; flex: none; }
  .nav a { white-space: nowrap; }
  .sidebar-footer { display: none; }
  .view { padding: 16px; }
  .topbar { padding: 14px 16px; }
}

/* ---------- auth screens ---------- */
.hidden { display: none !important; }
.auth-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy);
  padding: 20px;
}
.auth-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 28px;
  width: 380px;
  max-width: 100%;
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }

/* ---------- topbar user info ---------- */
.user-chip {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--gray-600);
}
.user-chip .role-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--gray-100); color: var(--navy);
}

/* ---------- searchable dropdown (combobox) ---------- */
.field { position: relative; }
input[type=text].combo-input {
  padding-inline-start: 12px;
  padding-inline-end: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%239aa3b2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  cursor: pointer;
}
.combo-list {
  position: absolute; inset-inline: 0; top: calc(100% + 4px);
  background: var(--white); border: 1px solid var(--gray-200); border-radius: 10px;
  box-shadow: var(--shadow-md); max-height: 230px; overflow-y: auto; z-index: 60;
}
.combo-item { padding: 9px 12px; font-size: 13.5px; cursor: pointer; color: var(--gray-800); }
.combo-item:hover, .combo-item.active { background: #fff6ee; color: var(--orange-dark); }
.combo-item.selected { font-weight: 700; color: var(--navy); }
.combo-empty { padding: 10px 12px; font-size: 12.5px; color: var(--gray-400); }

/* ---------- report builder ---------- */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 14px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--gray-800); font-weight: 500; margin: 0; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--orange); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { border: 1px solid var(--gray-200); background: var(--white); border-radius: 999px; padding: 6px 14px; font-family: inherit; font-size: 12.5px; cursor: pointer; color: var(--navy); }
.chip:hover { border-color: var(--orange); color: var(--orange-dark); }
.pos { color: var(--green); font-weight: 700; }
.neg { color: var(--red); font-weight: 700; }
tr.total-row td { font-weight: 800; background: var(--gray-50); border-top: 2px solid var(--gray-200); }
.result-box { background: #f3faf6; border: 1px solid #cfe9da; border-radius: 12px; padding: 14px 16px; margin-top: 12px; }
.result-box.neg-box { background: #fdf3f3; border-color: #f2cfcf; }

#reportResults { margin-top: 18px; }

/* ===================== پیش‌فاکتور ===================== */
.sidebar { overflow-y: auto; max-height: 100vh; position: sticky; top: 0; }
.nav-group { font-size: 11px; color: var(--gray-400); padding: 12px 14px 4px; letter-spacing: .3px; }
.nav-badge { margin-inline-start: auto; background: var(--orange); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 8px; font-weight: 700; }
.nav a.active .nav-badge { background: #fff; color: var(--orange-dark); }
.muted { color: var(--gray-400); font-size: 12px; }
.clickable { cursor: pointer; }
.ver { font-size: 11px; background: var(--gray-100); color: var(--navy); border-radius: 6px; padding: 1px 6px; margin-inline-start: 4px; font-weight: 600; }

.badge.qb-draft { background: var(--gray-100); color: var(--gray-600); }
.badge.qb-pending { background: #fdf1e3; color: var(--orange-dark); }
.badge.qb-returned { background: #fde8f3; color: #a3326f; }
.badge.qb-awaiting { background: #e8eefc; color: var(--navy-lighter); }
.badge.qb-approved { background: #e7f6ec; color: var(--green); }
.badge.qb-rejected { background: #fdeceb; color: var(--red); }
.badge.qb-undecided { background: #f1ecfb; color: #6a48b8; }
.badge.qb-cancelled { background: var(--gray-200); color: var(--gray-600); }

.q-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--gray-200); margin-bottom: 4px; overflow-x: auto; }
.q-tab { border: none; background: transparent; font-family: inherit; font-size: 13px; padding: 10px 14px; cursor: pointer; color: var(--gray-600);
  border-bottom: 3px solid transparent; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.q-tab:hover { color: var(--navy); }
.q-tab.active { color: var(--navy); font-weight: 700; border-bottom-color: var(--orange); }
.q-count { background: var(--gray-100); color: var(--gray-600); border-radius: 999px; font-size: 11px; padding: 1px 8px; font-weight: 700; }
.q-tab.active .q-count { background: var(--navy); color: #fff; }
.q-tab-pending_internal .q-count { background: #fdf1e3; color: var(--orange-dark); }
.q-tab-approved .q-count { background: #e7f6ec; color: var(--green); }
.q-tab-undecided .q-count { background: #f1ecfb; color: #6a48b8; }

.q-table th.sortable { cursor: pointer; user-select: none; }
.q-table th.sortable:hover { color: var(--navy); }
.q-table .filter-row th { padding: 4px 6px 8px; border-bottom: 1px solid var(--gray-200); }
.col-filter { padding: 6px 8px !important; font-size: 12px !important; border-radius: 8px !important; background: var(--gray-50) !important; }
.q-table td { vertical-align: middle; }
.q-pager { display: flex; gap: 6px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.chip.chip-on { background: var(--navy); color: #fff; border-color: var(--navy); }
.icon-btn { border: none; background: var(--gray-50); border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 14px; color: var(--navy); }
.icon-btn:hover { background: #fff6ee; color: var(--orange-dark); }
.icon-btn.danger:hover { background: #fdeceb; color: var(--red); }

.q-readonly { padding: 10px 12px; background: var(--gray-50); border-radius: 10px; font-weight: 700; color: var(--navy); border: 1px dashed var(--gray-200); }
.inline-group { display: flex; gap: 8px; align-items: center; }
.inline-group input, .inline-group select { flex: 1; }
.inline-group .check { white-space: nowrap; }
.q-details { border: 1px solid var(--gray-200); border-radius: 10px; padding: 10px 14px; margin-top: 4px; }
.q-details summary { cursor: pointer; font-weight: 600; color: var(--navy); font-size: 13px; }

.q-items { min-width: 1050px; }
.q-items th { font-size: 12px; white-space: nowrap; }
.q-items td { padding: 6px 4px; vertical-align: top; }
.q-items input[type=text], .q-items textarea { padding: 8px; font-size: 13px; }
.q-items textarea { min-height: 38px; resize: none; overflow: hidden; line-height: 1.5; }
.q-items td.row-total { font-weight: 700; color: var(--navy); padding-top: 14px; white-space: nowrap; }
.q-items .tax-cell { font-size: 12px; padding-top: 8px; white-space: nowrap; }
.q-items .last-price { font-size: 11px; margin-top: 3px; }
.q-items .combo-list { min-width: 280px; }
.q-items-foot { display: flex; justify-content: space-between; gap: 20px; margin-top: 14px; flex-wrap: wrap; align-items: flex-start; }
.q-totals { min-width: 320px; border: 1px solid var(--gray-200); border-radius: 12px; overflow: hidden; }
.q-totals > div { display: flex; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--gray-100); font-size: 13.5px; }
.q-totals .grand { background: var(--navy); color: #fff; font-size: 15px; }
.q-totals .words { display: block; font-size: 12px; color: var(--gray-600); border: none; }
.q-actions-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; position: sticky; bottom: 0; z-index: 4; box-shadow: 0 -4px 18px rgba(22,35,63,.08); }

.alert { padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 12px; }
.alert-info { background: #eef3fd; color: var(--navy-lighter); }
.alert-warn { background: #fff4e8; color: #9a520f; }
.alert-danger { background: #fdeceb; color: #9e2f2f; }
.alert-ok { background: #e9f7ef; color: #23784a; }

.q-hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.q-hero-num { font-size: 19px; font-weight: 800; color: var(--navy); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-hero-sub { margin-top: 6px; font-size: 14px; }
.q-hero-meta { margin-top: 4px; font-size: 12.5px; color: var(--gray-600); }
.q-hero-total { text-align: left; }
.q-hero-total .big { font-size: 22px; font-weight: 800; color: var(--navy); }
.q-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.q-detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
.q-detail-grid .card + .card { margin-top: 18px; }
.q-preview { width: 100%; border: 1px solid var(--gray-200); border-radius: 10px; background: #e9ecf1; aspect-ratio: 1 / 1.414; }
.type-grid.compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.type-grid.compact .type-card { padding: 10px; font-size: 12.5px; }

.q-dash { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 1.7fr); gap: 16px; margin-bottom: 18px; }
.q-dash .card + .card { margin-top: 0; }
.q-dash-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.q-dash-big { font-size: 24px; font-weight: 800; color: var(--navy); margin-top: 4px; }
.q-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--gray-100); margin: 6px 0 16px; }
.q-bar-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--gray-600); margin-top: 14px; gap: 10px; }
.q-mini-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.q-mini { background: var(--gray-50); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 4px; }
.q-mini span { font-size: 12px; color: var(--gray-600); }
.q-mini b { font-size: 18px; color: var(--navy); }
a.q-mini:hover { background: #fff6ee; }
.mini-select { width: auto !important; padding: 5px 10px !important; font-size: 12px !important; border-radius: 8px !important; }

.settings-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; position: sticky; top: 64px; z-index: 4; background: var(--gray-50); padding: 6px 0; }
.settings-nav a { background: var(--white); border: 1px solid var(--gray-200); border-radius: 999px; padding: 6px 14px; font-size: 12.5px; color: var(--navy); cursor: pointer; }
.settings-nav a:hover { border-color: var(--orange); color: var(--orange-dark); }
.img-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.img-box { height: 100px; border: 1px dashed var(--gray-200); border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--gray-50); }
.img-box img { max-height: 90px; max-width: 90%; object-fit: contain; }
.num-preview { background: #fff6ee; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; }
.tpl-layout { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.api-box { background: var(--navy); color: #e6ebf5; border-radius: 10px; padding: 12px 14px; font-family: Consolas, monospace; font-size: 12.5px; line-height: 1.8; margin: 10px 0; word-break: break-all; }
code { background: var(--gray-100); border-radius: 5px; padding: 1px 5px; font-size: 12px; direction: ltr; display: inline-block; }
input[type=color] { width: 100%; height: 40px; border: 1px solid var(--gray-200); border-radius: 10px; padding: 3px; background: #fff; }
input[type=password] { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--gray-200); font-family: inherit; font-size: 13.5px; }

@media (max-width: 1100px) {
  .q-detail-grid, .q-dash, .tpl-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { position: static; max-height: none; overflow-x: auto; overflow-y: visible; }
  .nav-group { display: none; }
  .settings-nav { top: 0; }
}
#quoteDashHost { margin-top: 18px; }

/* فرم CRM درون پیش‌فاکتور */
.crm-frame-box { width: 980px !important; max-width: 96vw !important; padding: 0 !important; overflow: hidden; }
.crm-frame-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--gray-200); }
.crm-frame { width: 100%; height: min(82vh, 820px); border: 0; display: block; background: var(--gray-50); }

.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; }

/* ===================== صفحه خانه (سرمه‌ای، متحرک) ===================== */
body.is-home .sidebar, body.is-home .topbar { display: none; }
body.is-home { background: #183e61; }
body.is-home .view { padding: 0; }
.hx { position: relative; min-height: 100vh; overflow: hidden; color: #e6ebf5; padding: 26px 40px 40px;
  background: radial-gradient(1200px 700px at 80% -10%, #1d3566 0%, transparent 60%),
              radial-gradient(900px 600px at 0% 110%, #2a1f45 0%, transparent 55%),
              linear-gradient(160deg, #0b1733 0%, #0a1430 55%, #081026 100%); }
.hx-net { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hx-orb { position: absolute; border-radius: 50%; filter: blur(80px); z-index: 0; pointer-events: none; animation: hxFloat 18s ease-in-out infinite; }
.hx-orb.o1 { width: 420px; height: 420px; background: rgba(242,128,46,.22); top: -120px; left: 8%; }
.hx-orb.o2 { width: 520px; height: 520px; background: rgba(60,110,230,.20); bottom: -200px; right: -80px; animation-delay: -6s; }
.hx-orb.o3 { width: 300px; height: 300px; background: rgba(46,180,140,.12); top: 40%; left: 45%; animation-delay: -11s; }
@keyframes hxFloat { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(50px,-40px) scale(1.12); } }
.hx > *:not(.hx-net):not(.hx-orb) { position: relative; z-index: 1; }

.hx-top { display: flex; justify-content: space-between; align-items: center; animation: hxDrop .7s cubic-bezier(.2,.9,.2,1) both; }
@keyframes hxDrop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.hx-user { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px; padding: 6px 6px 6px 16px; backdrop-filter: blur(10px); }
.hx-user b { display: block; font-size: 14px; color: #fff; }
.hx-user small { display: block; font-size: 11px; color: #93a3c4; }
.hx-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #f2802e, #d24a1f); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; }
.hx-logout { border: 0; background: rgba(255,255,255,.08); color: #c9d4ea; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 12.5px; cursor: pointer; margin-inline-start: 6px; }
.hx-logout:hover { background: #f2802e; color: #fff; }
.hx-clock { text-align: left; }
.hx-clock b { display: block; font-size: 26px; font-weight: 800; color: #fff; letter-spacing: 1px; }
.hx-clock small { color: #93a3c4; font-size: 12.5px; }

.hx-hero { text-align: center; margin: 18px auto 38px; max-width: 720px; }
.hx-mark { position: relative; width: 112px; height: 112px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; }
.hx-mark img { width: 92px; animation: hxSpin 1.4s cubic-bezier(.2,.9,.2,1) both, hxBreath 6s ease-in-out 1.4s infinite; filter: drop-shadow(0 10px 30px rgba(242,106,61,.45)); }
@keyframes hxSpin { from { opacity: 0; transform: rotate(-200deg) scale(.3); } to { opacity: 1; transform: none; } }
@keyframes hxBreath { 0%,100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.06) rotate(8deg); } }
.hx-ring { position: absolute; inset: -6px; border-radius: 50%; border: 1.5px solid rgba(242,128,46,.35); border-top-color: #f2802e;
  animation: hxRot 6s linear infinite, hxFade 1s .8s both; }
.hx-ring.r2 { inset: -20px; border-color: rgba(120,160,240,.18); border-left-color: rgba(140,180,255,.7); animation-duration: 11s; animation-direction: reverse; }
@keyframes hxRot { to { transform: rotate(360deg); } }
@keyframes hxFade { from { opacity: 0; } to { opacity: 1; } }
.hx-word { height: 74px; margin: 4px auto 18px; display: block; animation: hxRise .9s .5s cubic-bezier(.2,.9,.2,1) both; }
.hx-hello { font-size: 28px; font-weight: 800; color: #fff; animation: hxRise .9s .7s cubic-bezier(.2,.9,.2,1) both; }
.hx-hello span { background: linear-gradient(90deg, #ffb37a, #f2802e, #ffd2a8, #f2802e); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: hxShine 6s linear infinite; }
@keyframes hxShine { to { background-position: 300% 0; } }
.hx-sub { color: #93a3c4; margin-top: 6px; font-size: 14px; animation: hxRise .9s .85s cubic-bezier(.2,.9,.2,1) both; }
@keyframes hxRise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

.hx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; max-width: 1180px; margin: 0 auto; perspective: 1100px; }
.ht { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 168px; padding: 22px; border-radius: 22px; text-decoration: none; overflow: hidden;
  color: #e6ebf5; background: linear-gradient(160deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.10); backdrop-filter: blur(14px);
  transform: rotateX(var(--rx,0)) rotateY(var(--ry,0)); transform-style: preserve-3d;
  transition: transform .18s ease-out, border-color .25s, box-shadow .25s, background .25s;
  animation: hxTile .8s calc(1s + var(--i) * 70ms) cubic-bezier(.2,.9,.2,1) both; }
@keyframes hxTile { from { opacity: 0; transform: translateY(40px) scale(.94); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
.ht-live:hover { border-color: color-mix(in srgb, var(--c) 70%, transparent);
  box-shadow: 0 24px 60px -20px color-mix(in srgb, var(--c) 65%, transparent), 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent) inset;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, rgba(255,255,255,.06)), rgba(255,255,255,.03)); }
.ht-glare { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(260px circle at var(--gx,50%) var(--gy,50%), rgba(255,255,255,.18), transparent 60%); }
.ht-live:hover .ht-glare { opacity: 1; }
.ht-ic { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 25px; color: #fff;
  background: linear-gradient(145deg, var(--c), color-mix(in srgb, var(--c) 55%, #000));
  box-shadow: 0 12px 30px -8px color-mix(in srgb, var(--c) 80%, transparent); margin-bottom: 10px; transform: translateZ(40px);
  transition: transform .3s cubic-bezier(.2,.9,.2,1); }
.ht-live:hover .ht-ic { transform: translateZ(40px) scale(1.1) rotate(-6deg); }
.ht-t { font-size: 20px; font-weight: 800; color: #fff; transform: translateZ(25px); }
.ht-s { font-size: 13px; color: #9fb0d0; transform: translateZ(15px); }
.ht-go { margin-top: auto; padding-top: 10px; font-size: 12.5px; font-weight: 700; color: var(--c); opacity: 0; transform: translateX(10px); transition: .25s; }
.ht-live:hover .ht-go { opacity: 1; transform: none; }
.ht-badge { position: absolute; top: 18px; inset-inline-end: 18px; min-width: 28px; text-align: center; background: #f2802e; color: #fff;
  font-weight: 800; font-size: 13px; border-radius: 999px; padding: 3px 10px; box-shadow: 0 0 0 0 rgba(242,128,46,.6); animation: hxPulse 2s infinite; }
@keyframes hxPulse { 0% { box-shadow: 0 0 0 0 rgba(242,128,46,.55); } 70% { box-shadow: 0 0 0 12px rgba(242,128,46,0); } 100% { box-shadow: 0 0 0 0 rgba(242,128,46,0); } }
.ht-soon { min-height: 130px; opacity: .55; filter: saturate(.4); }
.ht-soon .ht-ic { width: 44px; height: 44px; font-size: 19px; border-radius: 13px; box-shadow: none; }
.ht-soon .ht-t { font-size: 16px; }
.ht-chip { position: absolute; top: 16px; inset-inline-end: 16px; font-size: 11px; color: #c9d4ea; background: rgba(255,255,255,.08); border-radius: 999px; padding: 2px 10px; }
.hx-grid-soon { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.hx-soon-t { max-width: 1180px; margin: 44px auto 16px; display: flex; align-items: center; gap: 14px; color: #6f80a3; font-size: 12.5px; font-weight: 700; }
.hx-soon-t::before, .hx-soon-t::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent); }
.hx-empty { text-align: center; color: #93a3c4; padding: 40px; }
.hx-foot { text-align: center; color: #4f5f82; font-size: 11.5px; margin-top: 48px; letter-spacing: 2px; }

@media (max-width: 700px) {
  .hx { padding: 18px 16px 30px; }
  .hx-clock { display: none; }
  .hx-hello { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .hx *, .hx *::before, .hx *::after { animation: none !important; transition: none !important; }
}
.brand-logo-img { width: 42px; height: 42px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 4px 10px rgba(242,106,61,.35)); }

/* ---------- کاربران و دسترسی‌ها (بر پایه فهرست کارمندان HR) ---------- */
.btn-orange { background: var(--navy); color: #fff; }
.btn-orange:hover { background: #22345c; }
.ux-intro { padding: 16px 18px; }
.ux-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ux-steps > div { display: grid; grid-template-columns: 34px 1fr; column-gap: 10px; align-items: center; }
.ux-steps b { font-size: 14px; color: var(--navy); }
.ux-steps small { grid-column: 2; color: var(--gray-600); font-size: 12px; }
.ux-n { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.ux-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.ux-bar input[type=search] { flex: 1 1 240px; min-width: 200px; }
.ux-tabs { display: flex; gap: 4px; background: var(--gray-50); padding: 4px; border-radius: 12px; flex-wrap: wrap; }
.ux-tab { border: 0; background: transparent; padding: 6px 12px; border-radius: 9px; font: inherit; font-size: 13px; cursor: pointer; color: var(--gray-600); }
.ux-tab span { background: var(--gray-200, #e5e7eb); border-radius: 999px; padding: 0 7px; font-size: 11px; margin-inline-start: 4px; }
.ux-tab.on { background: #fff; color: var(--navy); font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.ux-row { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-top: 1px solid var(--gray-100, #f1f2f4); }
.ux-row:first-child { border-top: 0; }
.ux-row.ux-left { opacity: .55; }
.ux-av { width: 42px; height: 42px; border-radius: 12px; background: #7c5cd6; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; flex-shrink: 0; }
.ux-who { flex: 1; min-width: 0; }
.ux-name { font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ux-meta { font-size: 12px; color: var(--gray-600); margin-top: 2px; }
.ux-un { background: var(--gray-50); border-radius: 6px; padding: 0 6px; font-family: monospace; }
.ux-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.ux-chip { font-size: 11.5px; border-radius: 999px; padding: 2px 9px; background: color-mix(in srgb, var(--c) 13%, #fff); color: color-mix(in srgb, var(--c) 80%, #000); border: 1px solid color-mix(in srgb, var(--c) 30%, #fff); }
.ux-chip b { font-weight: 700; }
.ux-super { --c: #f2802e; font-weight: 700; }
.ux-none { font-size: 12px; color: var(--gray-500, #9aa1ad); }
.ux-tag { font-size: 11px; background: var(--gray-50); color: var(--gray-600); border-radius: 6px; padding: 1px 7px; font-weight: 500; }
.ux-tag-left { background: #fdecec; color: #b42318; }
.ux-act { flex-shrink: 0; }
.modal-box.ux-modal { width: 760px; max-height: 92vh; overflow-y: auto; }
.ux-sec { margin-bottom: 16px; }
.ux-sec-t { font-weight: 700; color: var(--navy); margin-bottom: 8px; font-size: 14px; }
.ux-sec-t small { font-weight: 400; color: var(--gray-600); font-size: 12px; margin-inline-start: 6px; }
.ux-superbox { display: flex; gap: 10px; align-items: flex-start; border: 1px dashed var(--orange); background: #fff8f1; border-radius: 12px; padding: 10px 12px; margin-bottom: 16px; cursor: pointer; }
.ux-superbox small { display: block; color: var(--gray-600); font-size: 12px; }
.ux-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.ux-preset { border: 1px solid var(--gray-200, #e5e7eb); background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.ux-preset:hover { border-color: var(--orange); }
.ux-preset.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.ux-preset-clear { color: var(--gray-600); border-style: dashed; }
.ux-apps { display: flex; flex-direction: column; gap: 6px; }
.ux-app { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--gray-100, #eef0f3); border-inline-start: 4px solid var(--c); border-radius: 12px; padding: 8px 12px; }
.ux-app.ux-off { border-inline-start-color: var(--gray-200, #e5e7eb); background: var(--gray-50); }
.ux-app-h { display: flex; align-items: center; gap: 8px; min-width: 200px; flex: 1; }
.ux-app-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--c); color: #fff; display: flex; align-items: center; justify-content: center; }
.ux-off .ux-app-ic { background: #b8bfcb; }
.ux-desc { color: var(--gray-600); font-size: 11.5px; }
.ux-seg { display: flex; background: var(--gray-50); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.ux-seg button { border: 0; background: transparent; font: inherit; font-size: 12.5px; padding: 5px 11px; border-radius: 8px; cursor: pointer; color: var(--gray-600); }
.ux-seg button:hover { background: #fff; }
.ux-seg button.on { background: var(--c); color: #fff; font-weight: 700; }
.ux-seg button[data-lv=""].on { background: #8a93a3; }
.ux-disabled { opacity: .45; pointer-events: none; }
.ux-units { margin-top: 10px; }
.ux-soon { margin-top: 10px; }
.ux-soon summary { cursor: pointer; color: var(--gray-600); font-size: 13px; margin-bottom: 8px; }
.ux-warn { color: #b45309; font-size: 12.5px; min-height: 0; margin-bottom: 6px; }
.ux-warn:empty { display: none; }
@media (max-width: 640px) { .ux-row { flex-wrap: wrap; } .ux-act { width: 100%; } .ux-act .btn { width: 100%; } }
.ux-bar input[type=search] { border: 1px solid var(--gray-200, #e5e7eb); border-radius: 10px; padding: 9px 12px; font: inherit; background: #fff; }
.ux-bar input[type=search]:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242,128,46,.15); }
.ux-bar2 { margin-top: -4px; }
.ux-dep { border: 1px solid var(--gray-200, #e5e7eb); border-radius: 10px; padding: 8px 10px; font: inherit; background: #fff; }
.ux-tag-temp { background: #fff4e5; color: #b45309; }
.ux-result { border: 1px solid #b7e4c7; background: #f0fbf4; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.ux-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.ux-table th, .ux-table td { border-bottom: 1px solid var(--gray-100, #eef0f3); padding: 6px 8px; text-align: right; }
.ux-bar .ux-dep { width: auto; flex: 0 1 240px; }
.ux-bar input[type=search] { width: auto; }

/* ================= صفحه خانه (طرح سرمه‌ای با کارت‌های قرصی) ================= */
@font-face { font-family: 'Poppins'; src: url('/fonts/poppins-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('/fonts/poppins-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('/fonts/poppins-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('/fonts/poppins-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-display: swap; }
.hv { --navy: #183e61; --ink: #183e61; --acc: #f26a3d; --bg: #183e61; position: relative; min-height: 100vh; overflow: hidden; color: #fff;
  background: radial-gradient(1100px 600px at 50% -10%, #21507c 0%, transparent 60%), #183e61; padding: 26px 40px 30px;
  font-family: 'Vazirmatn', Tahoma, sans-serif; }
.hv-net { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hv > *:not(.hv-net) { position: relative; z-index: 1; }
.hv-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 20px; animation: hvDrop .7s cubic-bezier(.2,.9,.2,1) both; }
@keyframes hvDrop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.hv-when { justify-self: start; display: flex; flex-direction: column; gap: 2px; font-family: 'Vazirmatn', Tahoma, sans-serif; text-align: right; }
.hv-when b { font-size: 30px; font-weight: 800; letter-spacing: 1px; line-height: 1.2; }
.hv-when span { font-size: 17px; font-weight: 500; color: #eef3fb; }
.hv-when small { font-size: 13.5px; color: #b9c8dd; }
.hv-logo { display: flex; align-items: center; gap: 12px; }
.hv-mark { width: 64px; animation: hvSpin 1.3s cubic-bezier(.2,.9,.2,1) both, hvBreath 7s ease-in-out 1.3s infinite; }
@keyframes hvSpin { from { opacity: 0; transform: rotate(-200deg) scale(.4); } to { opacity: 1; transform: none; } }
@keyframes hvBreath { 0%,100% { transform: rotate(0); } 50% { transform: rotate(10deg) scale(1.04); } }
@font-face { font-family: 'Poppins'; src: url('/fonts/poppins-latin-300-normal.woff2') format('woff2'); font-weight: 300; font-display: swap; }
.hv-word { font-family: 'Poppins', 'Vazirmatn', sans-serif; display: block; font-size: 46px; font-weight: 300; line-height: 1; letter-spacing: -.5px; }
.hv-logo small { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .1px; margin-top: 2px; color: #fff; }
.hv-user { justify-self: end; display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px; padding: 6px 16px 6px 6px; font-family: 'Vazirmatn', Tahoma, sans-serif; }
.hv-user b { display: block; font-size: 14px; }
.hv-user small { display: block; font-size: 11px; color: #b9c8dd; }
.hv-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #f2802e, #d24a1f); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.hv-logout { border: 0; background: rgba(255,255,255,.12); color: #e6edf7; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 12.5px; cursor: pointer; }
.hv-logout:hover { background: #f2802e; color: #fff; }

.hv-hello { text-align: center; margin: 14px 0 22px; animation: hvRise .8s .3s cubic-bezier(.2,.9,.2,1) both; }
.hv-hello h1 { margin: 0; font-size: 34px; font-weight: 700; line-height: 1.15; }
.hv-hello p { margin: 2px 0 0; font-size: 17px; color: #eef3fb; }
@keyframes hvRise { from { opacity: 0; transform: translateY(16px); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }

.hv-stats, .hv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 48px; max-width: 1100px; margin: 0 auto; }
.hv-stats { margin-bottom: 26px; }
.hv-stat { display: flex; align-items: center; gap: 12px; background: #fff; color: var(--ink); border: 0; border-radius: 16px; padding: 12px 22px 12px 14px; min-height: 76px;
  text-decoration: none; font: inherit; cursor: pointer; text-align: left; box-shadow: 0 14px 30px -18px rgba(0,0,0,.55);
  transition: transform .2s, box-shadow .2s; animation: hvPop .7s calc(.45s + var(--i) * 90ms) cubic-bezier(.2,.9,.2,1.2) both; }
.hv-stat:hover { transform: translateY(-3px); box-shadow: 0 22px 40px -18px rgba(0,0,0,.6); }
@keyframes hvPop { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }
.hv-sic { width: 46px; height: 46px; flex-shrink: 0; color: var(--ink); }
.hv-sic svg { width: 100%; height: 100%; }
.hv-sl { flex: 1; font-size: 19px; font-weight: 700; line-height: 1.2; }
.hv-sl small { display: block; font-family: 'Vazirmatn', Tahoma, sans-serif; font-size: 11.5px; font-weight: 500; color: #6b7f96; }
.hv-stat b { font-size: 50px; font-weight: 800; line-height: 1; font-family: 'Vazirmatn', sans-serif; transition: transform .3s; }
.hv-stat b.in { animation: hvNum .6s cubic-bezier(.2,.9,.2,1.4); }
@keyframes hvNum { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }

.hv-app { position: relative; display: flex; align-items: center; gap: 14px; min-height: 62px; padding: 4px 18px 4px 4px; border-radius: 999px; background: #fff;
  color: var(--ink); text-decoration: none; border: 3px solid #fff; box-shadow: 0 12px 26px -18px rgba(0,0,0,.6);
  transition: transform .2s, box-shadow .2s, filter .3s, opacity .3s; animation: hvPop .7s calc(.7s + var(--i) * 45ms) cubic-bezier(.2,.9,.2,1.2) both; }
.hv-app.on:hover { transform: translateY(-3px); box-shadow: 0 20px 34px -16px rgba(0,0,0,.6); }
.hv-ic { width: 52px; height: 52px; border-radius: 50%; background: var(--navy); color: #fff; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: transform .3s, background .3s; }
.hv-ic svg { width: 30px; height: 30px; overflow: visible; }
.hv-app.on:hover .hv-ic { transform: rotate(-8deg) scale(1.06); }
.hv-name { flex: 1; font-size: 16.5px; font-weight: 700; line-height: 1.2; }
.hv-name small { display: block; font-family: 'Vazirmatn', Tahoma, sans-serif; font-size: 11px; font-weight: 500; color: #6b7f96; margin-top: 1px; }
.hv-badge[hidden] { display: none; }
.hv-badge { min-width: 24px; height: 24px; border-radius: 999px; background: var(--acc); color: #fff; font: 700 12px 'Vazirmatn', sans-serif; display: flex; align-items: center; justify-content: center; padding: 0 7px; }
.hv-lock { font: 600 10.5px 'Vazirmatn', sans-serif; color: #6b7f96; display: flex; align-items: center; }
.hv-lock svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.hv-admin { background: #f7941d; border-color: #f7941d; color: #fff; }
.hv-admin .hv-name small, .hv-admin .hv-lock { color: rgba(255,255,255,.85); }
.hv-gap { visibility: hidden; }
/* بدون دسترسی: کمی تار و تیره */
.hv-app.off { filter: blur(1.1px) brightness(.62) saturate(.6); opacity: .82; cursor: not-allowed; box-shadow: none; }
.hv-app.off:hover { filter: blur(.4px) brightness(.7) saturate(.6); }
.hv-app.off .m, .hv-app.off svg * { animation: none !important; }

.hv-pop { position: absolute; z-index: 5 !important; background: #fff; color: var(--ink); border-radius: 14px; padding: 12px; box-shadow: 0 24px 50px -20px rgba(0,0,0,.6);
  font-family: 'Vazirmatn', Tahoma, sans-serif; direction: rtl; animation: hvPop .25s both; }
.hv-pop b { display: block; margin-bottom: 6px; font-size: 14px; }
.hv-pop a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 13px; }
.hv-pop a:hover { background: #eef3f9; }
.hv-pop em { font-style: normal; font-weight: 800; background: #eef3f9; border-radius: 999px; padding: 0 9px; }
.hv-pop p { margin: 4px 0; color: #6b7f96; font-size: 13px; }
.hv-foot { text-align: center; color: rgba(255,255,255,.45); font-size: 11px; letter-spacing: 1.5px; margin-top: 30px; }

/* ---------- آیکون‌ها و حرکت‌های کوچکشان ---------- */
.hv-ic svg, .hv-sic svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hv svg .m { transform-box: fill-box; }
/* هر آیکون هر چند ثانیه یک‌بار تکان کوچکی می‌خورد؛ با رفتن موس روی کارت، پیوسته */
.hv .m { animation-duration: 6s; animation-iteration-count: infinite; animation-delay: var(--d, 0s); animation-timing-function: ease-in-out; }
.hv-app.on:hover .m, .hv-stat:hover .m { animation-duration: 1.6s; animation-delay: 0s; }
.m-bell { transform-origin: 50% 0; animation-name: icRing; }
.m-clap { transform-origin: 50% 0; animation-name: icClap; }
.hv-stat.ring .m-bell, .hv-stat.ring .m-clap { animation-duration: 3s; }
.m-dot { transform-origin: center; animation-name: icPulse; }
@keyframes icRing { 0%, 70%, 100% { transform: rotate(0); } 74% { transform: rotate(16deg); } 78% { transform: rotate(-14deg); } 82% { transform: rotate(10deg); } 86% { transform: rotate(-6deg); } 90% { transform: rotate(3deg); } }
@keyframes icClap { 0%, 70%, 100% { transform: translateX(0); } 76% { transform: translateX(1.6px); } 82% { transform: translateX(-1.6px); } 88% { transform: translateX(.8px); } }
@keyframes icPulse { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.35); } }
.m-bub1 { animation-name: icBub; }
.m-bub2 { animation-name: icBub; animation-delay: calc(var(--d, 0s) + .25s); }
@keyframes icBub { 0%, 70%, 100% { transform: translateY(0); opacity: 1; } 78% { transform: translateY(-2.5px); } 86% { transform: translateY(0); opacity: .6; } 92% { opacity: 1; } }
.m-check { stroke-dasharray: 16; animation-name: icDraw; }
@keyframes icDraw { 0%, 66% { stroke-dashoffset: 0; } 72% { stroke-dashoffset: 16; } 86%, 100% { stroke-dashoffset: 0; } }
.m-nod { transform-origin: 50% 100%; animation-name: icNod; }
@keyframes icNod { 0%, 72%, 100% { transform: translateY(0); } 78% { transform: translateY(-1.8px); } 84% { transform: translateY(.4px); } 90% { transform: translateY(-.8px); } }
.m-swing { transform-origin: 50% 0; animation-name: icSwing; }
@keyframes icSwing { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(9deg); } 82% { transform: rotate(-7deg); } 88% { transform: rotate(4deg); } 94% { transform: rotate(-2deg); } }
.m-spark, .m-spark2 { transform-origin: center; animation-name: icTwinkle; }
.m-spark2 { animation-delay: calc(var(--d, 0s) + .3s); }
@keyframes icTwinkle { 0%, 70%, 100% { transform: scale(1) rotate(0); opacity: 1; } 78% { transform: scale(.2) rotate(45deg); opacity: .2; } 88% { transform: scale(1.35) rotate(90deg); opacity: 1; } }
.m-paper { animation-name: icPaper; }
@keyframes icPaper { 0%, 66%, 100% { transform: translateY(0); } 74% { transform: translateY(-5px); } 86% { transform: translateY(1px); } 92% { transform: translateY(0); } }
.m-bar1, .m-bar2, .m-bar3 { transform-origin: 0 50%; animation-name: icGrow; }
.m-bar2 { animation-delay: calc(var(--d, 0s) + .15s); }
.m-bar3 { animation-delay: calc(var(--d, 0s) + .3s); }
@keyframes icGrow { 0%, 66%, 100% { transform: scaleX(1); } 72% { transform: scaleX(.2); } 86% { transform: scaleX(1.08); } 92% { transform: scaleX(1); } }
.m-day { transform-origin: center; animation-name: icDay; }
@keyframes icDay { 0%, 70%, 100% { transform: scale(1) rotate(0); } 78% { transform: scale(.4) rotate(-90deg); } 88% { transform: scale(1.15) rotate(0); } }
.m-rise { animation-name: icRise; }
@keyframes icRise { 0%, 66%, 100% { transform: translate(0, 0); opacity: 1; } 74% { transform: translate(-2px, 2px); opacity: .3; } 86% { transform: translate(1px, -1.5px); opacity: 1; } 92% { transform: translate(0, 0); } }
.m-beam { transform-origin: 50% 0; animation-name: icBeam; }
@keyframes icBeam { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-18deg); } 82% { transform: rotate(18deg); } 92% { transform: rotate(0); } }
.m-wrench { transform-origin: 70% 30%; animation-name: icWrench; }
@keyframes icWrench { 0%, 68%, 100% { transform: rotate(0); } 76% { transform: rotate(-35deg); } 84% { transform: rotate(10deg); } 92% { transform: rotate(0); } }
.m-shutter { transform-origin: center; animation-name: icShutter; }
.m-flash { transform-origin: center; animation-name: icFlash; }
@keyframes icShutter { 0%, 72%, 100% { transform: scale(1); } 76% { transform: scale(.2); } 84% { transform: scale(1); } }
@keyframes icFlash { 0%, 72%, 100% { transform: scale(1); opacity: 1; } 75% { transform: scale(3); opacity: .9; } 82% { transform: scale(1); opacity: 1; } }
.m-lid { transform-origin: 0 100%; animation-name: icLid; }
.m-tag { animation-name: icTag; }
@keyframes icLid { 0%, 68%, 100% { transform: rotate(0) translateY(0); } 76% { transform: rotate(-14deg) translateY(-2px); } 86% { transform: rotate(0) translateY(0); } 90% { transform: translateY(-1px); } }
@keyframes icTag { 0%, 68%, 100% { transform: translateX(0); } 78% { transform: translateX(3px); } 88% { transform: translateX(0); } }
.m-tassel { transform-origin: 50% 0; animation-name: icTassel; }
@keyframes icTassel { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(22deg); } 82% { transform: rotate(-16deg); } 88% { transform: rotate(8deg); } 94% { transform: rotate(-3deg); } }
.m-letter { animation-name: icLetter; }
@keyframes icLetter { 0%, 64%, 100% { transform: translateY(0); } 74% { transform: translateY(-4px); } 86% { transform: translateY(0); } }
.m-gear { transform-origin: center; animation-name: icGear; }
@keyframes icGear { 0%, 60% { transform: rotate(0); } 90%, 100% { transform: rotate(120deg); } }
@media (prefers-reduced-motion: reduce) { .hv .m { animation: none !important; } }
/* v24: بدون حرکت خودکار؛ فقط افکت هنگام رفتن موس روی کارت‌ها */
.hv .m { animation: none !important; }
.hv-app, .hv-stat { animation: none !important; }
.hv-app.on { overflow: hidden; }
.hv-app.on::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(242,128,46,.16) 50%, transparent 75%); background-size: 260% 100%; background-position: 130% 0; }
.hv-app.on:hover { transform: translateY(-3px); border-color: #f2802e; box-shadow: 0 0 0 4px rgba(242,128,46,.28), 0 20px 34px -16px rgba(0,0,0,.6); }
.hv-app.on:hover::after { opacity: 1; animation: hvShine .9s ease-out forwards; }
.hv-app.on:hover .hv-ic { transform: none; background: #f2802e; }
.hv-app.on:active { transform: translateY(-1px) scale(.985); }
.hv-admin.on:hover { border-color: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.35), 0 20px 34px -16px rgba(0,0,0,.6); }
.hv-admin.on:hover .hv-ic { background: var(--navy); }
@keyframes hvShine { from { background-position: 130% 0; } to { background-position: -30% 0; } }
/* سه کارت بالا (اعلان‌ها، جلسات، کارها) رنگ متفاوت */
.hv-stat { background: linear-gradient(135deg, #fff3ea 0%, #ffe1cc 100%); border: 2px solid #ffd0b0; }
.hv-stat .hv-sic { color: #c2410c; }
.hv-stat b { color: #183e61; }
.hv-stat:hover { transform: translateY(-3px); border-color: #f2802e; box-shadow: 0 0 0 4px rgba(242,128,46,.28), 0 22px 40px -18px rgba(0,0,0,.6); }
/* کتابچه‌ها */
.hv-docs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 48px; max-width: 1100px; margin: 26px auto 0; direction: rtl; }
.hv-doc { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; border-radius: 14px; cursor: pointer; font: inherit; text-align: right;
  background: rgba(255,255,255,.07); border: 1.5px solid rgba(255,255,255,.28); color: #fff; transition: background .2s, border-color .2s, transform .2s, box-shadow .2s; }
.hv-doc:hover { background: rgba(242,128,46,.18); border-color: #f2802e; transform: translateY(-2px); box-shadow: 0 0 0 4px rgba(242,128,46,.2); }
.hv-doc .hd-ic { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hv-doc .hd-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hv-doc b { display: block; font-size: 13.5px; font-weight: 700; line-height: 1.5; }
.hv-doc small { display: block; font-size: 11px; color: #b9c8dd; }
.hv-doc.empty small { color: #ffb38f; }
.hv-doc .hd-set { position: absolute; top: 6px; left: 8px; font-size: 11px; color: #b9c8dd; background: rgba(0,0,0,.18); border-radius: 999px; padding: 1px 8px; }
.hv-doc .hd-set:hover { color: #fff; background: #f2802e; }
@media (max-width: 1000px) { .hv-docs { grid-template-columns: 1fr; gap: 10px; } }

@media (max-width: 1000px) {
  .hv { padding: 20px 18px 26px; }
  .hv-top { grid-template-columns: 1fr 1fr; }
  .hv-logo { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .hv-stats, .hv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
  .hv-gap { display: none; }
}
@media (max-width: 640px) {
  .hv-top { grid-template-columns: 1fr; }
  .hv-when, .hv-user { justify-self: center; text-align: center; }
  .hv-stats, .hv-grid { grid-template-columns: 1fr; }
  .hv-stat b { font-size: 40px; }
  .hv-hello h1 { font-size: 27px; }
}
.hv > .hv-pop { position: absolute; }
@media (max-width: 640px) { .hv-word { font-size: 32px; } .hv-mark { width: 48px; } }

/* ================= بخش مالی — طلب و بدهی ================= */
.fin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.fin-h1 { font-size: 18px; font-weight: 800; color: var(--navy); margin-bottom: 2px; }
.fin-h1 .muted-s { font-weight: 500; }
.fin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted-s { color: var(--gray-400); font-size: 12px; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.nowrap { white-space: nowrap; }
.fin-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; margin-bottom: 18px; }
.fin-grid2 > .card + .card { margin-top: 0; }
.fin-kpi { text-decoration: none; display: block; transition: transform .15s, box-shadow .15s; }
a.fin-kpi[href]:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.fin-kpi .kpi-value { font-size: 19px; direction: ltr; text-align: right; }
.fin-kpi-sub { font-size: 11.5px; color: var(--gray-400); margin-top: 4px; }
.fin-legend { float: left; font-size: 11.5px; font-weight: 500; color: var(--gray-600); display: inline-flex; gap: 6px; align-items: center; }
.fin-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-start: 8px; }
.fin-bars { display: flex; align-items: flex-end; gap: 6px; height: 220px; padding-top: 10px; }
.fin-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.fin-bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--gray-200); }
.fin-bar { width: 38%; max-width: 16px; border-radius: 4px 4px 0 0; min-height: 2px; transition: height .5s ease; }
.fin-bar.in { background: #2f9e5b; }
.fin-bar.ex { background: #d94f4f; opacity: .85; }
.fin-bar-l { font-size: 10px; color: var(--gray-600); margin-top: 6px; white-space: nowrap; transform: rotate(-30deg); transform-origin: center; height: 22px; }
.fin-hrow { display: grid; grid-template-columns: 110px 1fr 90px 30px; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.fin-hrow b { text-align: left; font-size: 12.5px; }
.fin-hbar { height: 10px; background: var(--gray-100); border-radius: 99px; overflow: hidden; }
.fin-hbar.sm { height: 6px; margin: 3px 0; }
.fin-hbar i { display: block; height: 100%; border-radius: 99px; background: var(--green); transition: width .5s ease; }
.fin-hbar i.ag0 { background: #9ccfae; } .fin-hbar i.ag1 { background: #f3c26b; } .fin-hbar i.ag2 { background: #f2a14e; } .fin-hbar i.ag3 { background: #e57a52; } .fin-hbar i.ag4 { background: #d94f4f; }
.fin-hbar i.cr { background: #2f9e5b; } .fin-hbar i.db { background: #d94f4f; }
.fin-urow { display: grid; grid-template-columns: 150px 1fr 120px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--gray-100); }
.fin-uv { display: flex; flex-direction: column; text-align: left; font-size: 12px; font-weight: 700; }
.fin-unit { display: inline-block; background: var(--uc, #eef0f3); color: #2a2f38; border: 1px solid rgba(0,0,0,.06); border-radius: 999px; padding: 2px 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.fin-top { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px solid var(--gray-100); cursor: pointer; border-radius: 8px; }
.fin-top:hover { background: var(--gray-50); }
.fin-top-n { flex: 1; font-weight: 600; font-size: 13.5px; }
.fin-table { font-size: 13px; }
.fin-table th.num, .fin-table td.num { text-align: left; direction: ltr; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fin-table thead th.num { direction: rtl; }
.fin-table tfoot td { font-weight: 800; color: var(--navy); border-top: 2px solid var(--gray-200); padding-top: 12px; }
.fin-table .fin-row, .fin-table .fin-prow { cursor: pointer; }
.fin-table .fin-prow:hover td:first-child b { color: var(--orange-dark); }
.fin-t { font-weight: 600; color: var(--gray-800); }
.fin-k { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.fin-k.cr { background: #e7f6ec; color: var(--green); }
.fin-k.db { background: #fdeceb; color: var(--red); }
.fin-k.nv { background: #e8eefc; color: var(--navy-lighter); }
.fin-src { font-size: 11px; border-radius: 6px; padding: 2px 7px; white-space: nowrap; background: var(--gray-100); color: var(--gray-600); }
.fin-src.fs-pm { background: #fdf1e3; color: var(--orange-dark); }
.fin-src.fs-ems { background: #fbeae2; color: #c2410c; }
.fin-src.fs-inv { background: #e7f6ec; color: var(--green); }
.fin-src.fs-pet { background: #f1ecfb; color: #6a48b8; }
.fin-warn { font-size: 11px; color: var(--red); white-space: nowrap; }
.fin-check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--gray-800); margin: 0; padding-bottom: 10px; cursor: pointer; }
.fin-check input { width: auto; }
.fin-dclear { position: absolute; left: 8px; top: 35px; border: none; background: var(--gray-100); color: var(--gray-600); border-radius: 50%; width: 20px; height: 20px; line-height: 18px; padding: 0; cursor: pointer; font-size: 14px; }
.fin-dclear:hover { background: var(--gray-200); }
.fin-modal { max-height: 92vh; overflow-y: auto; }
.fin-mhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.fin-modal .modal-actions { flex-wrap: wrap; align-items: center; }
.fin-sum3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.fin-sum3.four { grid-template-columns: repeat(4, 1fr); }
.fin-sum3 > div { background: var(--gray-50); border-radius: 12px; padding: 12px 14px; }
.fin-sum3 span { display: block; font-size: 12px; color: var(--gray-600); margin-bottom: 4px; }
.fin-sum3 b { font-size: 17px; color: var(--navy); }
.fin-sum3 b.pos { color: var(--green); } .fin-sum3 b.neg { color: var(--red); }
.fin-note { background: #fff8ef; border: 1px solid #fbe3c6; color: #7a4a16; border-radius: 10px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 12px; }
.fin-with { display: flex; gap: 6px; align-items: stretch; }
.fin-with .btn { padding: 0 14px; }
.fin-words { min-height: 16px; }
.fin-log { font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; background: var(--gray-50); border-radius: 10px; padding: 10px 12px; }
.fin-link { color: var(--navy); font-weight: 700; text-decoration: none; }
.fin-link:hover { color: var(--orange-dark); }
.fin-holders { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 18px; }
.fin-holder { position: relative; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; cursor: pointer; border: 2px solid transparent; transition: border-color .15s; }
.fin-holder:hover { border-color: var(--gray-200); }
.fin-holder.on { border-color: #15803d; }
.fin-holder.off { opacity: .55; }
.fin-holder-n { font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.fin-holder-b { font-size: 19px; font-weight: 800; color: #15803d; }
.fin-holder-b.neg { color: var(--red); }
.fin-holder-b small { font-size: 11px; font-weight: 500; color: var(--gray-400); }
.fin-holder-s { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11.5px; color: var(--gray-600); margin-top: 6px; }
.fin-pend { color: var(--orange-dark); font-weight: 700; }
.fin-holder-e { position: absolute; top: 8px; left: 8px; }
.fin-me { background: #e7f6ec; color: #15803d; font-size: 10.5px; border-radius: 6px; padding: 1px 6px; }
.fin-set-row { display: flex; gap: 8px; align-items: center; padding: 5px 0; }
.fin-set-row.off input[type=text] { opacity: .5; }
.fin-set-row input[type=color] { width: 42px; height: 38px; border: 1px solid var(--gray-200); border-radius: 10px; padding: 3px; background: #fff; flex-shrink: 0; }
.fin-set-row select { max-width: 200px; }
.fin-set-row .fin-check { padding: 0; white-space: nowrap; }
.fin-crm-over { position: fixed; inset: 0; z-index: 1001; background: rgba(22,35,63,.5); display: flex; align-items: center; justify-content: center; }
.fin-crm-box { background: #fff; border-radius: var(--radius); padding: 16px; width: 980px; max-width: 96vw; height: 88vh; display: flex; flex-direction: column; }
.fin-crm-box .crm-frame { flex: 1; width: 100%; border: none; }
.fin-crm-box .crm-frame-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
@media print {
  .sidebar, .topbar, .fin-noprint, .fin-actions { display: none !important; }
  .card { box-shadow: none; }
}
.fin-table .fin-t { min-width: 150px; }
.fin-table td.muted-s { min-width: 120px; }
.fin-with .btn { white-space: nowrap; }

/* ================= بخش انبار و اموال ================= */
.ast-code { font-family: 'Vazirmatn', Tahoma, sans-serif; direction: ltr; unicode-bidi: isolate; letter-spacing: .3px; color: var(--navy); }
.ast-code.big { background: #e6f4f1; color: #0f766e; border-radius: 8px; padding: 2px 10px; font-size: 15px; }
.ast-s { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 10px; background: var(--gray-100); color: var(--gray-600); white-space: nowrap; }
.ast-s-st { background: #e6f4f1; color: #0f766e; }
.ast-s-as { background: #e8eefc; color: var(--navy-lighter); }
.ast-s-out { background: #fdf1e3; color: var(--orange-dark); }
.ast-s-rep { background: #f1ecfb; color: #6a48b8; }
.ast-s-dis { background: var(--gray-200); color: var(--gray-600); }
.ast-s-mix { background: #fff7d6; color: #8a6d00; }
.ast-cust { background: #fff7d6; color: #8a6d00; border-radius: 6px; padding: 1px 6px; font-size: 11px; white-space: nowrap; }
.ast-ph { border-radius: 8px; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: var(--gray-100); color: var(--gray-400); vertical-align: middle; }
.ast-table td { vertical-align: middle; }
.ast-selbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: #e6f4f1; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.ast-locs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 18px; }
.ast-locs.big { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.ast-loc-card { display: block; text-decoration: none; color: inherit; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; border-top: 4px solid #0f766e; transition: transform .15s, box-shadow .15s; }
.ast-loc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.ast-loc-card.k-office { border-top-color: var(--navy-lighter); }
.ast-loc-card.k-site { border-top-color: var(--orange); }
.ast-loc-card.off { opacity: .55; }
.ast-loc-k { font-size: 11px; color: var(--gray-400); font-weight: 700; }
.ast-loc-n { font-size: 15.5px; font-weight: 800; color: var(--navy); margin: 3px 0 2px; }
.ast-loc-v { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--gray-600); }
.ast-loc-v b { color: var(--navy); }
.ast-item-top { display: flex; gap: 16px; align-items: stretch; margin-bottom: 18px; flex-wrap: wrap; }
.ast-item-media { width: 280px; margin-top: 0; }
.ast-big { width: 100%; height: 200px; object-fit: contain; border-radius: 10px; background: var(--gray-50); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 40px; color: var(--gray-400); }
.ast-thumbs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ast-thumbs img { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
.ast-thumbs img.on { border-color: #0f766e; }
.ast-qr { display: flex; gap: 10px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gray-100); }
.ast-qr img { width: 86px; height: 86px; }
.ast-map { flex: 1.3; min-width: 320px; padding: 10px; }
.ast-map iframe { width: 100%; height: 260px; border: 0; border-radius: 10px; background: var(--gray-50); }
.ast-map-l { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.ast-place { background: var(--gray-50); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.ast-newp { background: #f3faf8; border: 1px solid #cfe9e3; border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.ast-types { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.ast-type { border: 1px solid var(--gray-200); background: #fff; border-radius: 999px; padding: 7px 14px; font: 600 12.5px Vazirmatn, Tahoma; cursor: pointer; color: var(--gray-600); }
.ast-type.on { background: #0f766e; border-color: #0f766e; color: #fff; }
.ast-t { font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 2px 8px; white-space: nowrap; background: var(--gray-100); color: var(--gray-600); }
.ast-t.t-in { background: #e6f4f1; color: #0f766e; } .ast-t.t-assign { background: #e8eefc; color: var(--navy-lighter); } .ast-t.t-return { background: #e7f6ec; color: var(--green); }
.ast-t.t-out { background: #fdf1e3; color: var(--orange-dark); } .ast-t.t-repair { background: #f1ecfb; color: #6a48b8; } .ast-t.t-dispose { background: #fdeceb; color: var(--red); }
tr.ast-bad td { background: #fff4f3; }
.fin-src.fs-pr { background: #e0f2fe; color: #0369a1; }
.m-stamp { transform-origin: 20.5px 23px; transform-box: view-box; animation-name: icStamp; }
@keyframes icStamp { 0%, 66%, 100% { transform: scale(1); opacity: 1; } 72% { transform: scale(1.6) translateY(-3px); opacity: .2; } 80% { transform: scale(.9); opacity: 1; } 88% { transform: scale(1); } }

/* ================= بخش درخواست پرداخت ================= */
.pr-s { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pr-s-draft { background: var(--gray-100); color: var(--gray-600); }
.pr-s-sub { background: #fdf1e3; color: var(--orange-dark); }
.pr-s-ret { background: #fdeceb; color: var(--red); }
.pr-s-chk { background: #e8eefc; color: var(--navy-lighter); }
.pr-s-app { background: #e0f2fe; color: #0369a1; }
.pr-s-rej { background: #fdeceb; color: var(--red); text-decoration: line-through; }
.pr-s-paid { background: #e7f6ec; color: var(--green); }
.pr-urgent { display: inline-block; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 6px; padding: 1px 7px; }
.pr-me { font-size: 10.5px; color: #0369a1; font-weight: 800; margin-top: 3px; }
tr.pr-todo td { background: #f3f9fe; }
tr.pr-todo td:first-child { box-shadow: inset -3px 0 0 #0369a1; }
.pr-inbox { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.pr-notes { width: 330px; max-height: 620px; overflow-y: auto; }
.pr-note { display: block; text-decoration: none; color: var(--gray-800); font-size: 12.5px; padding: 9px 10px; border-radius: 10px; border-bottom: 1px solid var(--gray-100); line-height: 1.7; }
.pr-note:hover { background: var(--gray-50); }
.pr-note.new { background: #f0f8ff; font-weight: 600; }
.pr-note.new::before { content: '●'; color: #0369a1; margin-left: 6px; font-size: 10px; }
.pr-form .card { margin-bottom: 16px; }
.pr-amount { font-size: 18px !important; font-weight: 800; }
.pr-iban { display: flex; align-items: stretch; direction: ltr; }
.pr-iban span { order: -1; background: var(--gray-100); border: 1px solid var(--gray-200); border-right: none; border-radius: 10px 0 0 10px; padding: 0 12px; display: flex; align-items: center; font-weight: 800; color: var(--navy); }
.pr-iban input { border-radius: 0 10px 10px 0 !important; letter-spacing: 1px; font-family: 'Vazirmatn', Tahoma, sans-serif; }
.pr-ibanv { font-family: 'Vazirmatn', Tahoma, sans-serif; letter-spacing: .5px; }
.pr-steps { display: flex; align-items: flex-start; gap: 0; }
.pr-step { flex: 0 0 150px; text-align: center; }
.pr-line { flex: 1; height: 3px; background: var(--gray-200); margin-top: 17px; border-radius: 3px; }
.pr-step.done + .pr-line { background: var(--green); }
.pr-dot { width: 36px; height: 36px; border-radius: 50%; background: var(--gray-200); color: var(--gray-600); display: flex; align-items: center; justify-content: center; margin: 0 auto 6px; font-weight: 800; }
.pr-step.done .pr-dot { background: var(--green); color: #fff; }
.pr-step.now .pr-dot { background: #0369a1; color: #fff; box-shadow: 0 0 0 5px #e0f2fe; }
.pr-step.bad .pr-dot { background: var(--red); color: #fff; box-shadow: 0 0 0 5px #fdeceb; }
.pr-step-l { font-weight: 700; font-size: 13px; color: var(--navy); }
.pr-act { border: 2px solid #bae0f7; }
.pr-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pr-amount-box { display: flex; gap: 12px; margin: 0 0 18px; flex-wrap: wrap; }
.pr-amount-box > div { flex: 1; min-width: 220px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; }
.pr-amount-box span { display: block; font-size: 12px; color: var(--gray-600); }
.pr-amount-box b { font-size: 22px; color: var(--navy); direction: ltr; display: block; text-align: right; }
.pr-amount-box small { color: var(--gray-400); font-size: 11.5px; }
.pr-hist { max-height: 360px; overflow-y: auto; }
.pr-h { display: flex; gap: 10px; padding: 7px 0; font-size: 13px; }
.pr-h-dot { width: 9px; height: 9px; border-radius: 50%; background: #0369a1; margin-top: 6px; flex-shrink: 0; }
.pr-h.note .pr-h-dot { background: var(--orange); }
.pr-h-note { background: var(--gray-50); border-radius: 8px; padding: 6px 10px; margin: 4px 0; white-space: pre-wrap; }
.pr-s-auto { background: #fdeceb; color: var(--red); }
.pr-chk { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 2px 8px; margin-inline-start: 8px; }
.pr-chk.ok { background: #e7f6ec; color: var(--green); }
.pr-chk.bad { background: #fdeceb; color: var(--red); }
.pr-chk.unk { background: #fff7d6; color: #8a6d00; }
.file-item .pr-chk { margin-inline-start: auto; margin-inline-end: 8px; }
.pr-alarm { background: #fdeceb; border: 1px solid #f6c9c5; color: #8a2a22; border-radius: 10px; padding: 10px 14px; line-height: 2; }
.pr-ac { border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; line-height: 1.9; }
.pr-ac.ok { background: #e7f6ec; color: var(--green); }
.pr-ac.unk { background: #fff7d6; color: #8a6d00; }
.pr-ac.bad { background: #fdeceb; border: 1px solid #f6c9c5; color: #8a2a22; }
.pr-paid-btn { font-size: 14.5px; padding: 11px 22px; }

/* ---------------------------------------------------------------- CME plus */
.cme-code { font: 800 13px 'Vazirmatn', Tahoma, sans-serif; direction: ltr; display: inline-block; background: #eaf2ff; color: #1d4ed8; border-radius: 6px; padding: 2px 8px; }
.cme-code.big { font-size: 15px; }
.cme-tag { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 7px; background: var(--gray-100); color: var(--gray-600); white-space: nowrap; }
.cme-tag.org { background: #fdf1e3; color: var(--orange-dark); }
.cme-tag.pts { background: #e7f6ec; color: var(--green); }
.cme-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; margin: 16px 0; }
.cme-card { display: flex; gap: 12px; background: #fff; border: 1px solid var(--gray-200); border-radius: 14px; padding: 12px; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.cme-card:hover { box-shadow: 0 6px 20px rgba(22, 35, 63, .08); transform: translateY(-1px); }
.cme-poster-th { width: 82px; height: 112px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: #eaf2ff; }
.cme-poster-th.none { display: flex; align-items: center; justify-content: center; font-size: 30px; color: #3a86ff; }
.cme-card-b { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.cme-card-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cme-card-t { font-weight: 800; font-size: 14.5px; line-height: 1.5; }
.cme-card-f { display: flex; gap: 12px; font-size: 12px; color: var(--gray-600); margin-top: auto; }
.cme-fill { height: 6px; background: var(--gray-100); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.cme-fill i { display: block; height: 100%; background: linear-gradient(90deg, #3a86ff, #1d4ed8); border-radius: 99px; }
.cme-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.cme-sum > div { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cme-sum span { font-size: 11.5px; color: var(--gray-500); }
.cme-sum b { font-size: 15px; }
.cme-sum i { font-style: normal; font-size: 11.5px; color: var(--gray-600); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cme-sum .neg b { color: var(--red); }
.cme-form .card { margin-bottom: 14px; }
.cme-box { border: 1px dashed var(--gray-200); border-radius: 10px; padding: 10px 12px; margin-top: 6px; }
.cme-orgtick { background: #fdf6ec; border: 1px solid #f3dcbc; border-radius: 10px; padding: 8px 12px; margin: 6px 0 10px; }
.cme-off { opacity: .5; }
.cme-es, .cme-ss { font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 2px 8px; white-space: nowrap; background: var(--gray-100); color: var(--gray-600); }
.cme-es.es-registered, .cme-ss.ss-held { background: #e7f6ec; color: var(--green); }
.cme-es.es-waitlist, .cme-ss.ss-makeup { background: #fdf1e3; color: var(--orange-dark); }
.cme-es.es-cancelled, .cme-ss.ss-cancelled { background: #fdeceb; color: var(--red); }
.cme-ss.ss-planned { background: #eaf2ff; color: #1d4ed8; }
.cme-att td, .cme-att th { text-align: center; padding: 5px 6px; }
.cme-att td:first-child { text-align: right; }
.cme-att td.ok { color: var(--green); font-weight: 800; background: #f1faf4; }
.cme-att td.no { color: var(--red); background: #fdf3f2; }
.cme-attl { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; max-height: 50vh; overflow: auto; }
.cme-ph { font-weight: 800; color: #1d4ed8; margin: 14px 0 6px; font-size: 13px; }
.cme-cl { display: grid; grid-template-columns: minmax(220px, 2fr) 110px 150px 1.5fr auto; gap: 10px; align-items: center; padding: 7px 10px; border: 1px solid var(--gray-200); border-radius: 10px; margin-bottom: 6px; background: #fff; }
.cme-cl.done { background: #f6fbf7; }
.cme-cl.done .cme-cl-t { text-decoration: line-through; color: var(--gray-500); }
.cme-cl.late { border-color: #f6c9c5; background: #fff7f6; }
.cme-cl.late .muted-s:first-of-type { color: var(--red); }
.cme-poster { max-width: 100%; max-height: 520px; border-radius: 10px; display: block; }
.cme-clrow { display: grid; grid-template-columns: 120px 1fr 70px auto; gap: 6px; margin-bottom: 6px; }
@media (max-width: 760px) { .cme-cl { grid-template-columns: 1fr; gap: 2px; } .cme-attl { grid-template-columns: 1fr; } .cme-cards { grid-template-columns: 1fr; } }
.cme-form .ast-type.on { background: #3a86ff; border-color: #3a86ff; }
.cme-m .field-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }

/* ---------------------------------------------------------------- واحد اجرایی */
.ej-code { font: 800 13px 'Vazirmatn', Tahoma, sans-serif; direction: ltr; display: inline-block; background: #fdeedd; color: #b4530f; border-radius: 6px; padding: 2px 8px; }
.ej-code.big { font-size: 15px; }
.ej-capt td, .ej-capt th { text-align: center; }
.ej-capt td:first-child, .ej-capt th:first-child { text-align: right; }
.ej-cap { border-radius: 6px; font-size: 12.5px; white-space: nowrap; }
td.ej-cap b { font-size: 14px; }
td.ej-cap i { font-style: normal; font-size: 10.5px; color: var(--orange-dark); margin-inline-start: 3px; }
.ej-cap.ok { background: #eaf7ef; color: #15803d; } .ej-cap.warn { background: #fff6e0; color: #a16207; }
.ej-cap.full { background: #fde3d0; color: #c2410c; } .ej-cap.over { background: #fbd5d1; color: #b42318; } .ej-cap.none { color: var(--gray-500); }
.ej-legend { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; font-size: 12px; }
.ej-legend .ej-cap { padding: 2px 10px; }
.ej-legend i { display: inline-block; width: 12px; height: 8px; border-radius: 3px; vertical-align: middle; }
.ej-legend i.b, .ej-bar i.b { background: #93c5fd; } .ej-legend i.a, .ej-bar i.a { background: #f2802e; }
.ej-capdef { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 10px; font-size: 13px; }
.ej-capn { border-radius: 10px; padding: 9px 12px; margin: 8px 0; font-size: 13px; }
.ej-capn.ok { background: #eaf7ef; color: #166534; } .ej-capn.full { background: #fdeceb; color: #9f1d14; border: 1px solid #f6c9c5; }
.ej-warn { background: #fff4e5 !important; border-color: #f6d3a4 !important; color: #8a4b08; }
.ej-note { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 13px; border-bottom: 1px solid var(--gray-100); }
.ej-note.new { background: #fff7ef; font-weight: 600; }
.ej-note i { font-style: normal; font-size: 11px; color: var(--gray-500); white-space: nowrap; }
.ej-task { display: grid; grid-template-columns: minmax(200px, 2fr) 140px 130px auto 60px; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--gray-200); border-radius: 10px; margin-bottom: 6px; background: #fff; cursor: pointer; }
.ej-task:hover { border-color: #f2b27c; }
.ej-task.late { border-color: #f6c9c5; background: #fff7f6; }
.ej-task.st-done { opacity: .65; }
.ej-task.st-done b { text-decoration: line-through; }
.kv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.kv-grid > div { background: var(--gray-50); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; }
.kv-grid span { font-size: 11.5px; color: var(--gray-500); }
.ej-tn { border-inline-start: 3px solid #f2b27c; padding: 4px 10px; margin: 6px 0; font-size: 13px; }
.ej-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ej-file { display: inline-flex; align-items: center; gap: 6px; background: var(--gray-50); border-radius: 8px; padding: 4px 8px; font-size: 12.5px; }
.ej-file img { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; }
.ej-ct { border: 1px solid var(--gray-200); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.ej-ct-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ej-ct-m { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 8px 0; font-size: 13px; color: var(--gray-600); }
.ej-ct-m b { color: var(--navy); }
.ej-sel { font: inherit; font-size: 12px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--gray-200); margin-inline-start: 6px; }
.ej-bar { position: relative; height: 18px; background: var(--gray-100); border-radius: 8px; margin: 12px 0 4px; overflow: visible; }
.ej-bar i { position: absolute; top: 0; right: 0; height: 9px; border-radius: 8px 8px 0 0; }
.ej-bar i.a { top: 9px; border-radius: 0 0 8px 8px; }
.ej-bar-l { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #b42318; }
.ej-bt input { width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--gray-200); border-radius: 8px; }
.ej-rep { border: 1px solid var(--gray-200); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.ej-rep-h { display: flex; gap: 10px; align-items: center; } .ej-rep-h .muted-s { margin-inline-start: auto; }
.ej-pmcard .ej-pm-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (max-width: 760px) { .ej-task { grid-template-columns: 1fr; gap: 3px; } .kv-grid { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- کانبان و آتلیه */
.ej-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.ej-col { background: var(--gray-50); border-radius: 12px; padding: 8px; min-height: 140px; }
.ej-col.over { outline: 2px dashed #f2802e; }
.ej-col-h { font-weight: 800; font-size: 13px; margin-bottom: 8px; display: flex; justify-content: space-between; }
.ej-col-h span { background: #fff; border-radius: 99px; padding: 0 8px; font-size: 12px; color: var(--gray-600); }
.ej-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; cursor: grab; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.ej-card.late { border-color: #f6c9c5; }
.ej-card-f { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--gray-600); margin-top: 3px; }
.ej-rev { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 1px 8px; background: #f3e8ff; color: #7e22ce; }
.ej-rev.over { background: #fdeceb; color: #b42318; }
.at-design { border: 1px solid var(--gray-200); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.at-design-h { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.at-timeline { border-inline-start: 2px solid var(--gray-200); margin: 10px 6px 0; padding-inline-start: 14px; display: flex; flex-direction: column; gap: 8px; }
.at-ev { border-radius: 10px; padding: 8px 10px; font-size: 13px; position: relative; }
.at-ev::before { content: ''; position: absolute; inset-inline-start: -21px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--gray-200); }
.at-ev.v { background: #eef4ff; } .at-ev.v::before { background: #3a86ff; }
.at-ev.f { background: #fff7ef; } .at-ev.f::before { background: #f2802e; }
.at-ev.f.r-approved { background: #eaf7ef; } .at-ev.f.r-approved::before { background: #16a34a; }
.at-ev-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .at-ev-h .muted-s { margin-inline-start: auto; }
.at-chg, .at-sug { margin-top: 4px; white-space: pre-wrap; } .at-chg span, .at-sug span { color: var(--gray-600); margin-inline-end: 6px; font-weight: 700; }
.at-chat summary { cursor: pointer; color: var(--gray-600); font-size: 12px; margin-top: 4px; }
.at-chat pre { white-space: pre-wrap; font: inherit; background: #fff; border-radius: 8px; padding: 8px; margin: 6px 0 0; max-height: 260px; overflow: auto; border: 1px solid var(--gray-200); }
.at-steps { display: flex; gap: 4px; margin: 8px 0; flex-wrap: wrap; }
.at-steps span { font-size: 11.5px; padding: 3px 10px; border-radius: 99px; background: var(--gray-100); color: var(--gray-500); }
.at-steps span.on { background: #fce7f3; color: #be185d; font-weight: 700; }
.at-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.at-day { background: #fff; border: 1px solid var(--gray-200); border-radius: 10px; padding: 6px; min-height: 92px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.at-day.has { border-color: #f5b6d4; }
.at-day-h { display: flex; gap: 6px; align-items: center; } .at-day-h .ej-cap { margin-inline-start: auto; padding: 0 6px; }
.at-sh { display: block; background: #fdf2f8; border-radius: 6px; padding: 4px 6px; color: inherit; text-decoration: none; }
.at-free { font-size: 11px; }
.at-phl { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow: auto; }
@media (max-width: 900px) { .at-cal { grid-template-columns: repeat(2, 1fr); } }
.fin-actions > .field { margin: 0; } .fin-actions > .field input { width: 150px; }

/* ---------------------------------------------------------------- تقویم کلی */
.cal-header { flex-wrap: wrap; gap: 10px; }
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-views { display: flex; gap: 2px; }
.cal-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cal-f { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--gray-200); border-radius: 99px; padding: 4px 12px; font-size: 12.5px; cursor: pointer; background: #fff; user-select: none; }
.cal-f input { display: none; }
.cal-f i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.cal-f span { background: var(--gray-100); border-radius: 99px; padding: 0 7px; font-size: 11px; }
.cal-f.off { opacity: .45; } .cal-f.off i { background: transparent; border: 2px solid var(--c); }
.cal-cell { cursor: pointer; overflow: hidden; min-width: 0; }
.cal-cell.has { background: #fff; border: 1px solid var(--gray-200); }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--orange); }
.cal-chip { background: color-mix(in srgb, var(--c) 14%, #fff); border-inline-start: 3px solid var(--c); color: #1f2937; border-radius: 5px; padding: 2px 6px; font-size: 11px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-chip.cont { opacity: .7; border-inline-start-style: dashed; }
.cal-chip.done { text-decoration: line-through; opacity: .6; }
.cal-chip:hover { background: color-mix(in srgb, var(--c) 26%, #fff); }
.cal-more { font-size: 11px; color: var(--gray-600); }
.cal-lday { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
.cal-lday.today .cal-ld { color: var(--orange-dark); }
.cal-ld { font-weight: 800; } .cal-ld span { display: block; font-weight: 400; font-size: 12px; color: var(--gray-600); }
.cal-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.cal-row:hover { background: var(--gray-50); }
.cal-row i { width: 4px; align-self: stretch; border-radius: 4px; background: var(--c); flex-shrink: 0; }
@media (max-width: 760px) { .cal-grid { gap: 2px; } .cal-cell { min-height: 60px; padding: 3px; } .cal-chip { font-size: 9.5px; padding: 1px 3px; } .cal-lday { grid-template-columns: 1fr; } }
/* پیش‌فاکتور: ردیف تازه زیر نوار پایین گم نشود؛ جدول در عرض صفحه جا شود */
.q-items tr, .q-items-foot { scroll-margin-bottom: 110px; scroll-margin-top: 90px; }
.q-items { min-width: 960px; }
.combo-list[style*="fixed"] { z-index: 1200; }

/* v19: ستون عملیات جدول‌های پهن همیشه دیده شود (چسبیده به لبه چپ هنگام اسکرول افقی) */
.table-wrap > .fin-table td.nowrap:last-child, .table-wrap > .fin-table th:last-child:empty { position: sticky; left: 0; background: var(--white); box-shadow: 6px 0 8px -6px rgba(0,0,0,.12); z-index: 1; }
select.ej-sel { width: auto !important; min-width: 120px; max-width: 180px; display: inline-block; padding: 4px 8px; margin-inline-start: 6px; vertical-align: middle; }
.ej-ct-h > .nowrap { display: flex; align-items: center; gap: 6px; }
@media (max-width: 1500px) { .pr-inbox { flex-direction: column; align-items: stretch; } .pr-inbox > .card { width: 100%; } .pr-notes { width: auto; max-height: 320px; } }
#fpBody .fin-table td.muted-s { min-width: 90px; } #fpBody .fin-table td, #fpBody .fin-table th { padding-inline: 8px; }
/* لپ‌تاپ‌های ۱۲۸۰–۱۴۰۰: جدول‌ها فشرده‌تر تا بدون اسکرول افقی جا شوند */
@media (max-width: 1400px) { .table-wrap th, .table-wrap td { padding: 9px 6px; } .fin-table { font-size: 12px; } .fin-table td.muted-s { min-width: 90px; } }

/* v20: تخصیص واریزی‌ها */
.al-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.al-top > .card { margin-top: 0; }
@media (max-width: 1100px) { .al-top { grid-template-columns: 1fr; } }
.al-amt { font-size: 20px !important; font-weight: 800; letter-spacing: .5px; }
.al-calc tfoot td { font-weight: 700; }
.al-calc td.num b { font-size: 15px; }
.al-chip { display: inline-block; background: var(--gray-100); border-radius: 999px; padding: 2px 9px; margin: 2px 0 2px 4px; font-size: 11.5px; white-space: nowrap; }
.al-row { cursor: pointer; }
.al-row:hover td { background: var(--gray-50); }
.al-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.al-info > div { display: flex; flex-direction: column; gap: 2px; }
.al-info span { font-size: 11.5px; color: var(--gray-600); }
.al-rule { display: grid; grid-template-columns: 1.2fr .5fr 1.3fr 1.6fr 1.2fr 1fr 1fr auto auto; gap: 8px; align-items: end; padding: 10px 0; border-bottom: 1px dashed var(--gray-200); }
.al-rule .field { margin: 0; }
.al-rule .fin-check { padding-bottom: 10px; white-space: nowrap; }
@media (max-width: 1300px) { .al-rule { grid-template-columns: 1fr 1fr 1fr; } }
.al-sum { margin: 14px 0; padding: 10px 14px; background: var(--gray-50); border-radius: 10px; }

.hv-notifset{display:flex;justify-content:center;margin:6px 0 4px}
.hv-notifset button{font:inherit;font-size:12.5px;border:1px dashed #c9d1e0;background:rgba(255,255,255,.6);color:#16233f;border-radius:999px;padding:6px 14px;cursor:pointer}
.hv-notifset button:hover,.hv-notifset a:hover{border-color:#F26B1D;color:#F26B1D}
.hv-notifset{gap:8px;flex-wrap:wrap}
.hv-notifset a{font-size:12.5px;border:1px dashed #c9d1e0;background:rgba(255,255,255,.6);color:#16233f;border-radius:999px;padding:6px 14px;text-decoration:none}

/* ---- انبار و اموال — نسخه ۲۸ */
.ast-t.t-consume { background: #fff4e0; color: #9a5b00; }
.ast-t.t-adjust_minus { background: #fdeceb; color: var(--red); border: 1px dashed #f0b5b0; }
.ast-t.t-adjust_plus { background: #e7f6ec; color: var(--green); border: 1px dashed #a9dcb9; }
.ast-map-off { height: 100%; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 20px; background: var(--gray-100); border-radius: 10px; font-size: 26px; }
.ast-map-off .muted-s { font-size: 11.5px; max-width: 280px; }
.ast-lbset { display: flex; gap: 18px; align-items: flex-start; }
.ast-lbform { flex: 1.3; min-width: 0; max-height: 64vh; overflow: auto; padding-left: 6px; }
.ast-lbprev { flex: 1; min-width: 300px; position: sticky; top: 0; background: var(--gray-100); border-radius: 10px; padding: 12px; }
#fmLbPrev { position: relative; overflow: hidden; }
.ast-lbscale { transform-origin: top right; position: absolute; top: 0; right: 0; }
.ast-lbscale .lb { box-shadow: 0 1px 6px rgba(0,0,0,.12); }
.ast-lbfields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; }
.ast-lbfields .fin-check { margin: 0; font-size: 12.5px; }
@media (max-width: 900px) { .ast-lbset { flex-direction: column; } .ast-lbprev { position: static; width: 100%; } .ast-lbfields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- موبایل: منوی کشویی (نسخه ۲۹) */
.nav-burger, .nav-backdrop { display: none; }
@media (max-width: 900px) {
  #app { flex-direction: column; }
  .nav-burger { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex-shrink: 0; margin-inline-end: 10px; border-radius: 10px; border: 1px solid var(--gray-200); background: #fff; color: var(--navy); font-size: 20px; cursor: pointer; }
  .sidebar { position: fixed !important; top: 0; bottom: 0; right: 0; width: min(300px, 86vw) !important; max-height: 100vh !important; flex-direction: column !important; align-items: stretch !important; overflow-y: auto !important; overflow-x: hidden !important; padding: 16px 12px !important; z-index: 1000; transform: translateX(105%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: -8px 0 30px rgba(0,0,0,.3); }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(10,20,40,.45); z-index: 999; }
  .nav { flex-direction: column !important; }
  .brand-text { display: block; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .topbar-title { display: flex; align-items: center; font-size: 16px; min-width: 0; }
  .user-chip .role-badge, #quickNewQuote { display: none; }
}

/* v34 پنجره کار رویداد */
.et { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.et-head { display: flex; gap: 6px; }
.et-st { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.et-new { background: #eef1f7; color: #46506a; } .et-prog { background: #fff4e0; color: #a15c00; }
.et-done { background: #e7f6ec; color: #1a7f37; } .et-late { background: #fdecec; color: #b42318; }
.et-ev { background: #f6f7fb; border-radius: 10px; padding: 8px 10px; font-weight: 700; }
.et-ev small { font-weight: 400; color: #6b7280; }
.et-row { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed #e6e8ee; padding: 4px 0; }
.et-row span { color: #6b7280; } .et-row b { font-weight: 600; }
.et-desc { background: #fbfbfd; border: 1px solid #eceef3; border-radius: 10px; padding: 8px 10px; line-height: 1.9; }
.et-exp b { display: block; margin: 6px 0 2px; }
.et-set { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.et-set label { font-weight: 700; } .et-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.et-set textarea { width: 100%; font-family: inherit; border: 1px solid var(--gray-300, #d5d9e2); border-radius: 8px; padding: 6px 8px; }

.et-list { display: flex; flex-direction: column; gap: 6px; }
.et-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: right; font-family: inherit; background: #fff; border: 1px solid #e6e8ee; border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.et-item:hover { border-color: var(--primary, #F2632B); background: #fffaf7; }
.et-item .muted-s { grid-column: 1; } .et-item .et-st { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
