/* ---------------------------------------------------------------------------
   فرم‌ها
--------------------------------------------------------------------------- */

.input {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--text);
  font-size: var(--fs-base);
  outline: none;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.input:hover:not(:disabled) {
  border-color: var(--text-3);
}
.input:focus {
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 4px var(--accent-bg);
}
.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.input::placeholder {
  color: var(--text-3);
}
.input--area {
  resize: vertical;
  min-height: 62px;
  line-height: 1.75;
}
.input--num {
  direction: ltr;
  text-align: end;
  font-variant-numeric: tabular-nums;
}
.input--select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(12px) calc(50% - 2px), calc(17px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-start: 30px;
  cursor: pointer;
}
.input--compact {
  width: auto;
  min-width: 140px;
  padding-block: 6px;
}
select.input option {
  background: var(--panel);
  color: var(--text);
}

.color-input {
  width: 100%;
  height: 34px;
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--field);
  cursor: pointer;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  flex: 1;
}
.field__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
}
.field__hint {
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-row {
  display: grid;
  gap: 12px;
}
.form-row--2 {
  grid-template-columns: 1fr 1fr;
}
.form-row--3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.form-row.align-end {
  align-items: flex-end;
}
@media (max-width: 700px) {
  .form-row--2,
  .form-row--3 {
    grid-template-columns: 1fr;
  }
}

.form-hint {
  font-size: var(--fs-sm);
  color: var(--text-2);
  background: var(--panel-2);
  border-radius: var(--radius-sm);
  padding: 6px 11px;
}
.form-hint--warn {
  color: var(--amber);
  background: var(--amber-bg);
}
.form-label-lg {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-2);
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.toggle-row {
  display: flex;
  align-items: center;
}

/* Switch */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.switch__track {
  width: 38px;
  height: 21px;
  border-radius: 12px;
  background: var(--line);
  position: relative;
  transition: background var(--t-fast);
  flex: 0 0 auto;
}
.switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--text-3);
  transition: left var(--t), background var(--t-fast);
}
.switch input:checked + .switch__track {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px -2px var(--accent);
}
.switch input:checked + .switch__track .switch__thumb {
  background: #fff;
  left: 20px;
}
.switch__label {
  line-height: 1.5;
}

/* Chips */
.chip-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.chip:hover {
  border-color: var(--accent);
  color: var(--text);
}
.chip--sm {
  padding: 4px 10px;
  font-size: var(--fs-xs);
}

/* ----------------------------- انتخابگر برچسب -----------------------------
   داخل یک سلولِ فرم می‌نشیند. سقف ارتفاع دارد تا هرچقدر هم برچسب زیاد شود،
   قد ردیف فرم را به هم نریزد و بقیهٔ فیلدها سر جایشان بمانند. */

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
  padding: 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--field);
  max-height: 96px;
  overflow-y: auto;
}
.tag-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 500;
  white-space: nowrap;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.tag-opt:hover {
  border-color: var(--accent);
  color: var(--text);
}
.tag-opt.is-on {
  background: var(--accent-bg);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent);
  font-weight: 600;
}
/* تیک فقط روی برچسب انتخاب‌شده دیده می‌شود، ولی جایش همیشه رزرو نیست
   تا چیپ‌های خاموش بی‌خود پهن نشوند */
.tag-opt__tick {
  display: none;
  align-items: center;
}
.tag-opt.is-on .tag-opt__tick {
  display: inline-flex;
}
.tag-opt--new {
  border-style: dashed;
  color: var(--text-3);
}
.tag-opt--new:hover {
  color: var(--accent);
}
.chip-row--big {
  gap: 9px;
}
.chip--plan {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  border-radius: var(--radius);
  padding: 9px 14px;
  min-width: 128px;
  border-color: var(--line);
}
.chip--plan:hover {
  border-color: var(--chip-color);
}
.chip--plan.is-active {
  border-color: var(--chip-color);
  background: color-mix(in srgb, var(--chip-color) 13%, transparent);
}
.chip__name {
  font-weight: 700;
  color: var(--text);
  font-size: var(--fs-base);
}
.chip__meta {
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.chip--plan.is-active .chip__name {
  color: var(--chip-color);
}

/* ---------------------------------------------------------------------------
   تاریخ شمسی
--------------------------------------------------------------------------- */

.datefield {
  position: relative;
  display: flex;
  flex-direction: column;
}
.datefield__input {
  cursor: pointer;
  padding-inline-end: 34px;
}
.datefield__btn {
  position: absolute;
  inset-inline-end: 6px;
  top: 5px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-3);
  transition: color var(--t-fast), background var(--t-fast);
}
.datefield__btn:hover {
  color: var(--accent);
  background: var(--accent-bg);
}
.datefield__sub {
  font-size: var(--fs-xs);
  color: var(--text-3);
  direction: ltr;
  text-align: end;
  padding-top: 3px;
  padding-inline-end: 4px;
}

/* ترتیب لایه‌ها در برنامه:
     ۴۵۰ کشوی پروفایل · ۵۰۰ مودال · ۶۰۰ تقویم · ۹۰۰ توست · ۱۰۰۰ صفحهٔ قفل
   تقویم باید بالاتر از مودال بنشیند، چون تقریباً همیشه از داخلِ یک فرمِ مودال
   باز می‌شود (افزودن عضو، تمدید، ثبت تراکنش). پایین‌تر بودنش یعنی تقویم پشت
   همان فرمی می‌رفت که صداش زده بود. */
.cal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 600;
}
.cal-pop {
  position: fixed;
  z-index: 601;
  width: 288px;
  background: var(--chrome);
  backdrop-filter: blur(var(--blur-lg)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(150%);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-lg);
  padding: 10px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.cal-pop.is-in {
  opacity: 1;
  transform: none;
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}
.cal-nav {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: var(--text-2);
  font-size: 19px;
  line-height: 1;
  transition: background var(--t-fast), color var(--t-fast);
}
.cal-nav:hover {
  background: var(--panel-hover);
  color: var(--text);
}
.cal-title {
  display: flex;
  gap: 5px;
  font-weight: 700;
  font-size: var(--fs-base);
}
.cal-title__btn {
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  transition: background var(--t-fast), color var(--t-fast);
}
.cal-title__btn:hover {
  background: var(--accent-bg);
  color: var(--accent);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-wd {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-3);
  padding-bottom: 4px;
  font-weight: 600;
}
.cal-day {
  height: 32px;
  border-radius: 7px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.cal-day:hover {
  background: var(--panel-hover);
  color: var(--text);
}
.cal-day--empty {
  pointer-events: none;
}
.cal-day.is-today {
  color: var(--accent);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--accent);
}
.cal-day.is-selected {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.cal-foot {
  display: flex;
  justify-content: center;
  padding-top: 8px;
  margin-top: 6px;
  border-top: 1px solid var(--line-soft);
}
.cal-mgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.cal-mbtn {
  padding: 9px 4px;
  border-radius: 7px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.cal-mbtn:hover {
  background: var(--panel-hover);
  color: var(--text);
}
.cal-mbtn.is-selected {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

/* ---------------------------------------------------------------------------
   مودال
--------------------------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity var(--t);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-overlay.is-in {
  opacity: 1;
}
.modal {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  background: var(--chrome);
  backdrop-filter: blur(var(--blur-lg)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(150%);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-xl);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: scale(0.97) translateY(8px);
  transition: transform var(--t);
}
.modal-overlay.is-in .modal {
  transform: none;
}
.modal--sm { max-width: 400px; }
.modal--md { max-width: 560px; }
.modal--lg { max-width: 760px; }

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
  flex: 0 0 auto;
}
.modal__title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: var(--fs-md);
  font-weight: 700;
}
.modal__title .icn {
  color: var(--accent);
}
.modal__body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}
.modal__foot {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--line-soft);
  flex: 0 0 auto;
  flex-direction: row-reverse;
}
.confirm-text p {
  font-size: var(--fs-base);
  line-height: 1.8;
}
.confirm-text p + p {
  margin-top: 6px;
}

/* Renew */
.renew-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.renew-member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel-2);
  border-radius: var(--radius);
}
.renew-member__name {
  font-size: var(--fs-md);
  font-weight: 700;
}
.renew-member__meta {
  font-size: var(--fs-sm);
  color: var(--text-3);
}
.renew-preview {
  background: var(--panel-2);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.renew-preview__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--fs-sm);
}
.renew-preview__row--hero {
  font-size: var(--fs-md);
  padding: 5px 0;
  border-block: 1px solid var(--line-soft);
}
.rate-hint {
  align-self: flex-end;
  padding-bottom: 8px;
}

/* ---------------------------------------------------------------------------
   Toast
--------------------------------------------------------------------------- */

.toast-host {
  position: fixed;
  bottom: 20px;
  inset-inline-end: 20px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--chrome);
  backdrop-filter: blur(var(--blur-lg)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(150%);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-lg);
  font-size: var(--fs-sm);
  max-width: 460px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--t), transform var(--t);
}
.toast.is-in {
  opacity: 1;
  transform: none;
}
.toast__icon {
  display: flex;
  flex: 0 0 auto;
}
.toast--success .toast__icon { color: var(--green); }
.toast--error .toast__icon { color: var(--red); }
.toast--warn .toast__icon { color: var(--amber); }
.toast--info .toast__icon { color: var(--blue); }
.toast__msg {
  flex: 1;
  line-height: 1.6;
}
.toast__action {
  color: var(--accent);
  font-weight: 700;
  font-size: var(--fs-sm);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  transition: background var(--t-fast);
}
.toast__action:hover {
  background: var(--accent-bg);
}
.toast__close {
  color: var(--text-3);
  font-size: 18px;
  line-height: 1;
  padding: 0 3px;
}
.toast__close:hover {
  color: var(--text);
}

/* ---------------------------------------------------------------------------
   بورد یادآورها
--------------------------------------------------------------------------- */

/* تعداد ستون‌های بورد همیشه دقیقاً ۴ است (منقضی/امروز/۳روز/۷روز، هیچ‌وقت
   کم‌وزیاد نمی‌شود). پس برخلاف .kpi-grid که تعدادش صفحه‌به‌صفحه فرق می‌کند،
   اینجا با grid ساده هم می‌شود جلوی ردیف نصفه را گرفت: کافی است شکست‌ها را
   فقط روی مقسوم‌علیه‌های ۴ (۲ و ۱) بگذاریم و از ۳ رد شویم. */
.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
@media (max-width: 1300px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .board { grid-template-columns: 1fr; }
}

.board-col {
  background: var(--panel);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 130px;
}
.board-col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.board-col__title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-sm);
  font-weight: 700;
}
.board-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}
.board-dot--over { background: var(--red); }
.board-dot--urgent { background: var(--red); }
.board-dot--soon { background: var(--amber); }
.board-dot--later { background: var(--blue); }
.board-col__count {
  background: var(--line-soft);
  color: var(--text-2);
  border-radius: 10px;
  padding: 0 8px;
  font-size: var(--fs-xs);
  font-weight: 700;
}
.board-col__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 62vh;
  overflow-y: auto;
}
.board-empty {
  text-align: center;
  color: var(--text-3);
  font-size: var(--fs-sm);
  padding: 18px 0;
}
.board-copy-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  transition: background var(--t-fast), color var(--t-fast);
}
.board-copy-all:hover {
  background: var(--accent-bg);
  color: var(--accent);
}
.board-card {
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.board-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.board-card__top {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}
.board-card__main {
  flex: 1;
  min-width: 0;
}
.board-card__name {
  font-weight: 600;
  font-size: var(--fs-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-card__meta {
  font-size: var(--fs-xs);
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: end;
}
.board-card__price {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: end;
  min-width: 0;
}
.board-card__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  border-top: 1px solid var(--line-soft);
  padding-top: 6px;
}
.board-card__price {
  font-size: var(--fs-xs);
  color: var(--text-2);
  font-weight: 600;
}
.board-card__acts {
  display: flex;
  align-items: center;
  gap: 2px;
}
.board-card__acts .icon-btn {
  width: 26px;
  height: 26px;
}

/* ---------------------------------------------------------------------------
   کشوی پروفایل
--------------------------------------------------------------------------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 450;
  background: var(--overlay);
  opacity: 0;
  transition: opacity var(--t);
}
.drawer-backdrop.is-in {
  opacity: 1;
}
.drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: 460px;
  max-width: 94vw;
  z-index: 451;
  background: var(--chrome);
  backdrop-filter: blur(var(--blur-lg)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(150%);
  border-inline-end: 1px solid var(--glass-line);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 0 24px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform var(--t);
}
.drawer.is-in {
  transform: none;
}
.drawer__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  background: var(--bg-2);
  z-index: 2;
}
.drawer__title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-2);
}

.profile-hero {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 0 18px;
}
.profile-hero__main {
  flex: 1;
  min-width: 0;
}
.profile-hero__name {
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -0.3px;
}
.profile-hero__meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.profile-hero__tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.copy-chip {
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  color: var(--text-2);
  font-size: var(--fs-xs);
  transition: color var(--t-fast), border-color var(--t-fast);
}
.copy-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.profile-sub {
  margin: 0 18px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.profile-sub__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.profile-sub__label {
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.profile-sub__date {
  font-size: var(--fs-md);
  font-weight: 700;
}
.profile-sub__gdate {
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.profile-sub__days {
  text-align: center;
  color: var(--green);
}
.profile-sub__days strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
  font-weight: 700;
}
.profile-sub__days span {
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.profile-sub__days.is-soon { color: var(--amber); }
.profile-sub__days.is-over { color: var(--red); }
.profile-sub__actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.profile-sub__actions .btn {
  flex: 1;
  min-width: 108px;
}

.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 0 18px;
}
.pstat {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.pstat__icon {
  color: var(--accent);
  display: flex;
}
.pstat__label {
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.pstat__value {
  font-size: var(--fs-sm);
  font-weight: 700;
}

.profile-section {
  padding: 0 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.profile-section__title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-2);
}

.timeline {
  display: flex;
  flex-direction: column;
}
.timeline__row {
  display: flex;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: flex-start;
}
.timeline__row:last-child {
  border-bottom: none;
}
.timeline__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 7px;
  flex: 0 0 auto;
}
.timeline__dot--income { background: var(--green); }
.timeline__dot--expense { background: var(--red); }
.timeline__main {
  flex: 1;
  min-width: 0;
}
.timeline__top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.timeline__meta {
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.timeline__note {
  font-size: var(--fs-xs);
  color: var(--text-2);
  margin-top: 2px;
}

.profile-danger {
  display: flex;
  gap: 8px;
  padding: 10px 18px 0;
  margin-top: 4px;
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
}
.profile-danger .btn {
  flex: 1;
}

/* ---------------------------------------------------------------------------
   تنظیمات
--------------------------------------------------------------------------- */

.settings-wrap {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) {
  .settings-wrap { grid-template-columns: 1fr; }
}
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
}
.settings-nav__btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: var(--fs-base);
  font-weight: 500;
  text-align: start;
  transition: background var(--t-fast), color var(--t-fast);
}
.settings-nav__btn:hover {
  background: var(--panel-hover);
  color: var(--text);
}
.settings-nav__btn.is-active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
}
.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.accent-row {
  display: flex;
  gap: 8px;
  padding-top: 3px;
}
.accent-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: transform var(--t-fast), border-color var(--t-fast);
}
.accent-dot:hover {
  transform: scale(1.12);
}
.accent-dot.is-active {
  border-color: var(--text);
  box-shadow: inset 0 0 0 2px var(--panel);
}

.plan-editor,
.cur-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-editor__row,
.cur-editor__row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 11px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.cur-editor__row.is-base {
  border-color: var(--accent);
}
.plan-editor__swatch {
  width: 5px;
  align-self: stretch;
  border-radius: 3px;
  flex: 0 0 auto;
}
.plan-editor__row .field,
.cur-editor__row .field {
  min-width: 92px;
}
.plan-editor__row .icon-btn,
.cur-editor__row .icon-btn {
  margin-bottom: 2px;
}

.tpl-preview {
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: inherit;
  font-size: var(--fs-sm);
  line-height: 1.9;
  white-space: pre-wrap;
  margin: 0;
  color: var(--text-2);
}
.tpl-preview__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.var-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}
.var-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  background: var(--panel-2);
  border-radius: var(--radius-sm);
}

.notice {
  display: flex;
  gap: 11px;
  padding: 13px 15px;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  line-height: 1.8;
}
.notice--warn {
  background: var(--amber-bg);
  color: var(--text);
}
.notice--warn > span:first-child {
  color: var(--amber);
  display: flex;
  flex: 0 0 auto;
  padding-top: 2px;
}

.path-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.path-box__text {
  flex: 1;
  min-width: 200px;
  word-break: break-all;
  background: none;
  padding: 0;
  font-size: var(--fs-xs);
  color: var(--text-2);
}

.backup-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
}
.backup-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  background: var(--panel-2);
  border-radius: var(--radius-sm);
}
.backup-row__icon {
  color: var(--text-3);
  display: flex;
}
.backup-row__main {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-sm);
}

.log-list {
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow-y: auto;
}
.log-row {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--fs-sm);
}
.log-row:last-child {
  border-bottom: none;
}
.log-time {
  color: var(--text-3);
  font-size: var(--fs-xs);
  white-space: nowrap;
  padding-top: 2px;
}
.log-text {
  color: var(--text-2);
}

.about-box {
  display: flex;
  align-items: center;
  gap: 16px;
}
.about-logo {
  display: flex;
}
.about-title {
  font-size: var(--fs-lg);
  font-weight: 700;
}

.help-list {
  margin: 0;
  padding-inline-start: 20px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: var(--fs-base);
  color: var(--text-2);
  line-height: 1.85;
}

/* ---------------------------------------------------------------------------
   جستجوی سریع
--------------------------------------------------------------------------- */

.qs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.qs__input {
  font-size: var(--fs-md);
  padding: 11px 14px;
}
.qs__results {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 100px;
  max-height: 46vh;
  overflow-y: auto;
}
.qs__hint {
  padding: 24px 0;
  text-align: center;
}
.qs__row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-align: start;
  transition: background var(--t-fast);
}
.qs__row:hover,
.qs__row.is-first {
  background: var(--panel-2);
}
.qs__row:hover {
  background: var(--accent-bg);
}
.qs__main {
  flex: 1;
  min-width: 0;
}
.qs__name {
  font-weight: 600;
}
.qs__meta {
  font-size: var(--fs-xs);
  color: var(--text-3);
}

/* ---------------------------------------------------------------------------
   صفحه قفل
--------------------------------------------------------------------------- */

.lock {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--t);
  overflow: hidden;
}
/* همان شفقِ صفحهٔ اصلی، تا اولین تصویر برنامه هم مرده نباشد */
.lock::before,
.lock::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: var(--aurora-op);
  pointer-events: none;
}
.lock::before {
  width: 620px;
  height: 620px;
  top: -220px;
  inset-inline-end: -140px;
  background: radial-gradient(circle at 50% 50%, var(--aurora-1), transparent 68%);
  animation: sy-drift-a 26s ease-in-out infinite;
}
.lock::after {
  width: 560px;
  height: 560px;
  bottom: -230px;
  inset-inline-start: -150px;
  background: radial-gradient(circle at 50% 50%, var(--aurora-3), transparent 68%);
  animation: sy-drift-b 32s ease-in-out infinite;
}
.lock.is-out {
  opacity: 0;
}
.lock__box {
  width: 330px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  padding: 34px 28px;
  background: var(--chrome);
  backdrop-filter: blur(var(--blur-lg)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(150%);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-lg);
  border-radius: var(--radius-xl);
}
.lock__logo {
  filter: drop-shadow(0 8px 22px rgba(139, 92, 246, 0.5));
}
.lock__box.shake {
  animation: shake 0.36s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.lock__logo {
  display: flex;
}
.lock__title {
  font-size: var(--fs-lg);
  font-weight: 700;
}
.lock__sub {
  font-size: var(--fs-sm);
  color: var(--text-3);
  margin-top: -6px;
}
.lock__input {
  text-align: center;
  font-size: var(--fs-md);
  letter-spacing: 3px;
  padding: 10px;
}
.lock__err {
  color: var(--red);
  font-size: var(--fs-sm);
  min-height: 18px;
}
.lock__hint {
  font-size: var(--fs-xs);
  color: var(--text-3);
  text-align: center;
}

body.has-modal .main {
  overflow: hidden;
}

/* ---------------------------------------------------------------------------
   ورود گروهی
--------------------------------------------------------------------------- */

.bulk-ta {
  min-height: 165px;
  font-family: Consolas, 'Courier New', monospace;
  font-size: var(--fs-sm);
  line-height: 1.9;
}
.bulk-summary {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.bulk-chip {
  padding: 3px 11px;
  border-radius: 20px;
  font-size: var(--fs-xs);
  font-weight: 700;
}
.bulk-chip--ok {
  background: var(--green-bg);
  color: var(--green);
}
.bulk-chip--dup {
  background: var(--amber-bg);
  color: var(--amber);
}
.bulk-chip--bad {
  background: var(--red-bg);
  color: var(--red);
}
.bulk-preview {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.bulk-preview > p {
  padding: 14px;
}
.bulk-scroll {
  max-height: 260px;
  overflow-y: auto;
}
.table--mini thead th,
.table--mini tbody td {
  padding: 6px 11px;
  font-size: var(--fs-sm);
}
.row.is-skipped {
  opacity: 0.5;
}

/* ---------------------------------------------------------------------------
   برآیندها — تقویم معاملات
--------------------------------------------------------------------------- */

.journal-modebar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 2px;
}
.seg--mode .seg__btn {
  padding: 7px 16px;
  font-size: var(--fs-base);
}
.seg--mode .seg__ico {
  display: inline-flex;
  opacity: 0.85;
}

/* عنوان ماه با دو فلش کنارش. فلش‌ها در RTL معنی «قبل/بعد» می‌دهند نه
   بالا/پایین، برای همین آیکن‌ها ۹۰ درجه چرخانده می‌شوند. */
.cal-nav-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cal-nav-group .icon-btn svg {
  transform: rotate(-90deg);
}
.cal-month-title {
  min-width: 130px;
  text-align: center;
}

.card--cal {
  padding-bottom: 12px;
}

.jcal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.jcal__wd {
  text-align: center;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-3);
  padding-bottom: 4px;
}
.jcal__wd.is-holiday {
  color: var(--red);
}
.jcal__pad {
  /* خانه خالیِ ابتدای ماه */
}

.jcal__day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 78px;
  padding: 7px 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--panel);
  text-align: start;
  transition: transform var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.jcal__day:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.jcal__num {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-2);
}
.jcal__day.is-holiday .jcal__num {
  color: var(--red);
}
.jcal__day.is-today {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.jcal__day.is-future {
  opacity: 0.42;
}
.jcal__val {
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.2;
}
.jcal__money {
  font-size: var(--fs-xs);
  color: var(--text-3);
}
/* روزِ سودده/زیان‌ده: پس‌زمینهٔ خیلی کم‌جان + یک نوار رنگی در لبه */
.jcal__day.is-win {
  background: var(--green-bg);
  border-color: color-mix(in srgb, var(--green) 32%, transparent);
}
.jcal__day.is-win .jcal__val {
  color: var(--green);
}
.jcal__day.is-loss {
  background: var(--red-bg);
  border-color: color-mix(in srgb, var(--red) 32%, transparent);
}
.jcal__day.is-loss .jcal__val {
  color: var(--red);
}
.jcal__day.is-flat .jcal__val {
  color: var(--text-3);
}

.jcal__add {
  position: absolute;
  inset-inline-end: 7px;
  bottom: 6px;
  opacity: 0;
  color: var(--text-3);
  transition: opacity var(--t-fast);
}
.jcal__day:hover .jcal__add {
  opacity: 0.7;
}

.jcal__dots {
  display: flex;
  gap: 3px;
  margin-top: auto;
}
.jdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.jdot--w { background: var(--green); }
.jdot--l { background: var(--red); }
.jdot--b { background: var(--text-3); }

.jcal__legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.jcal__lg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ------------------------------ پنجرهٔ یک روز ------------------------------ */

.dayx {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dayx__sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: var(--panel);
}
.dayx__sum.is-win {
  background: var(--green-bg);
  border-color: color-mix(in srgb, var(--green) 30%, transparent);
}
.dayx__sum.is-loss {
  background: var(--red-bg);
  border-color: color-mix(in srgb, var(--red) 30%, transparent);
}
.dayx__sumMain {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.dayx__sumVal {
  font-size: var(--fs-xl);
  font-weight: 800;
}
.dayx__sum.is-win .dayx__sumVal { color: var(--green); }
.dayx__sum.is-loss .dayx__sumVal { color: var(--red); }
.dayx__sumMoney {
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.dayx__sumMeta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.dayx__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.trow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: var(--panel);
  /* نوار رنگی لبه: برد/باخت را بدون خواندن عدد نشان می‌دهد */
  border-inline-start: 3px solid var(--text-3);
}
.trow--win { border-inline-start-color: var(--green); }
.trow--loss { border-inline-start-color: var(--red); }
.trow__main {
  flex: 1;
  min-width: 0;
}
.trow__top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.trow__sym {
  font-weight: 700;
  font-size: var(--fs-sm);
}
.trow__dir {
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 6px;
}
.trow__dir--buy,
.trow__dir--long {
  color: var(--green);
  background: var(--green-bg);
}
.trow__dir--sell,
.trow__dir--short {
  color: var(--red);
  background: var(--red-bg);
}
.trow__note {
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trow__nums {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex: 0 0 auto;
}
.trow__unit {
  font-weight: 700;
  font-size: var(--fs-sm);
}
.trow__money {
  font-size: var(--fs-xs);
}
.trow__unit.is-win, .trow__money.is-win { color: var(--green); }
.trow__unit.is-loss, .trow__money.is-loss { color: var(--red); }
.trow__unit.is-flat, .trow__money.is-flat { color: var(--text-3); }
.trow__acts {
  display: flex;
  gap: 2px;
  flex: 0 0 auto;
}

/* برد/باخت به‌صورت «۵ / ۲» */
.wl {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}
.wl__w { color: var(--green); }
.wl__l { color: var(--red); }
.wl__sep { color: var(--text-3); opacity: 0.6; }

.stack-1 {
  display: flex;
  flex-direction: column;
}

/* در عرض‌های کم، تقویم فشرده‌تر می‌شود ولی هفت‌ستونه می‌ماند */
@media (max-width: 1180px) {
  .jcal__day {
    min-height: 66px;
    padding: 6px;
  }
  .jcal__money {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   منوهای شیشه‌ای (Liquid Glass)

   فهرست بازشوی <select> و <datalist> بومی را خودِ مرورگر می‌کشد و اصلاً
   استایل نمی‌گیرد؛ برای همین با منوی سفارشی جایگزین شده‌اند.

   قاعدهٔ خوانایی: شیشه از «بلور + اشباع + بازتاب لبه» ساخته می‌شود، نه از
   کم‌کردن تیرگیِ پایه. لایهٔ پشتِ متن همیشه به‌قدر کافی مات می‌ماند و رنگ
   متن از همان توکن --text می‌آید، پس کنتراست دست‌نخورده است.
--------------------------------------------------------------------------- */

:root {
  --glass-blur: 34px;
  --glass-sat: 190%;
  /* پایهٔ مات‌کننده — بدون این، متن روی زمینهٔ شلوغ خوانده نمی‌شود */
  --glass-base: rgba(18, 21, 32, 0.9);
  --glass-rim: rgba(255, 255, 255, 0.14);
  --glass-shadow: 0 26px 64px rgba(0, 0, 0, 0.55), 0 4px 14px rgba(0, 0, 0, 0.35);
  --spring: cubic-bezier(0.22, 1.2, 0.36, 1);
}
:root[data-theme='light'] {
  --glass-base: rgba(255, 255, 255, 0.86);
  --glass-rim: rgba(255, 255, 255, 0.95);
  --glass-shadow: 0 24px 54px rgba(24, 34, 60, 0.18), 0 3px 10px rgba(24, 34, 60, 0.08);
}

.gmenu {
  position: fixed;
  z-index: 610;
  max-height: 292px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid var(--glass-line);
  /* سه لایه: تابش بالا، تهِ رنگیِ ملایم از رنگ لهجه، و پایهٔ مات */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 46%),
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--glass-base);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow:
    inset 0 1px 0 var(--glass-rim),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    var(--glass-shadow);
  transform: translateY(-8px) scale(0.96);
  opacity: 0;
  transform-origin: top center;
  transition: opacity 170ms ease, transform 260ms var(--spring);
}
.gmenu.is-up {
  transform-origin: bottom center;
  transform: translateY(8px) scale(0.96);
}
.gmenu.is-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* درخششی که هنگام باز شدن یک‌بار از روی شیشه رد می‌شود */
.gmenu::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.13) 46%, transparent 62%);
  background-size: 260% 100%;
  background-position: 130% 0;
}
.gmenu.is-in::after {
  transition: background-position 900ms ease-out;
  background-position: -40% 0;
}

.gmenu__item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 11px;
  /* روشن‌تر از --text-2 معمولی: منو روی هر زمینه‌ای شناور می‌شود، پس متنش
     باید بدترین حالتِ پس‌زمینه را هم بالای آستانهٔ خوانایی رد کند */
  color: color-mix(in srgb, var(--text) 62%, var(--text-2));
  font-size: var(--fs-base);
  text-align: start;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.gmenu__item:hover,
.gmenu__item.is-cursor {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
  color: var(--text);
}
.gmenu__item:active {
  transform: scale(0.985);
}
.gmenu__item.is-on {
  color: var(--accent);
  font-weight: 600;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 34%, transparent);
}
/* میلهٔ باریک کنار گزینهٔ فعال — بدون خواندن متن هم پیداست */
.gmenu__item.is-on::before {
  content: '';
  position: absolute;
  inset-inline-start: 4px;
  top: 50%;
  translate: 0 -50%;
  width: 3px;
  height: 16px;
  border-radius: 3px;
  background: var(--accent);
}
.gmenu__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gmenu__tick {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--accent);
}
.gmenu--combo .gmenu__item {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.gmenu::-webkit-scrollbar {
  width: 9px;
}
.gmenu::-webkit-scrollbar-thumb {
  background: rgba(140, 145, 165, 0.4);
  border-radius: 9px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.gmenu::-webkit-scrollbar-thumb:hover {
  background: rgba(140, 145, 165, 0.6);
  background-clip: content-box;
}

/* ------------------------------ دکمهٔ منو ------------------------------ */

.xsel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  /* فلشِ پس‌زمینه‌ایِ input--select حذف می‌شود؛ اینجا فلش واقعی داریم */
  background-image: none;
  padding-inline-start: 12px;
}
.xsel:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-bg);
  outline: none;
}
.xsel.is-open {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  background: var(--panel);
  box-shadow: 0 0 0 4px var(--accent-bg);
}
.xsel[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.xsel__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.xsel.is-empty .xsel__label::after {
  content: '—';
  color: var(--text-3);
}
.xsel__caret {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--text-3);
  transition: transform 260ms var(--spring), color var(--t-fast);
}
.xsel.is-open .xsel__caret {
  transform: rotate(180deg);
  color: var(--accent);
}

.xcombo {
  display: flex;
  flex-direction: column;
}

/* تقویم هم همان زبان شیشه‌ای را می‌گیرد تا سطوح شناور یکدست باشند */
.cal-pop {
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 46%),
    var(--glass-base);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: inset 0 1px 0 var(--glass-rim), var(--glass-shadow);
}

/* ------------------------ کادر محاسبهٔ زندهٔ پوزیشن ------------------------
   نتیجهٔ محاسبه همان‌جا زیر فیلدها دیده می‌شود تا کاربر قبل از ثبت بداند
   چه چیزی ذخیره می‌شود. */

.calcbox {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-soft);
  background: var(--panel);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.calcbox.is-win {
  background: var(--green-bg);
  border-color: color-mix(in srgb, var(--green) 28%, transparent);
}
.calcbox.is-loss {
  background: var(--red-bg);
  border-color: color-mix(in srgb, var(--red) 28%, transparent);
}
.calcbox__cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.calcbox__lab {
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.calcbox__val {
  font-size: var(--fs-base);
  font-weight: 700;
  white-space: nowrap;
}
.calcbox__val.is-win { color: var(--green); }
.calcbox__val.is-loss { color: var(--red); }
.calcbox__note {
  grid-column: 1 / -1;
  font-size: var(--fs-xs);
  color: var(--text-3);
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}
.calcbox__note.is-warn {
  color: var(--amber);
}
@media (max-width: 700px) {
  .calcbox { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* جدول مشخصات نمادها */
.instr-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}
.instr-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}
.instr-row__head {
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-weight: 600;
}

/* --------------------------- یادداشت روزانه --------------------------- */

/* نشانِ روی خانهٔ تقویم: بی‌سروصدا ولی پیدا */
.jcal__note {
  position: absolute;
  inset-inline-end: 6px;
  top: 6px;
  display: inline-flex;
  color: var(--accent);
  opacity: 0.75;
  pointer-events: none;
}
.jcal__day.has-note {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line-soft));
}
/* دکمهٔ افزودن روی hover نباید با نشان یادداشت قاطی شود */
.jcal__day.has-note .jcal__add {
  inset-inline-end: 7px;
  bottom: 6px;
}
.jcal__lgNote {
  display: inline-flex;
  color: var(--accent);
  opacity: 0.8;
}

.dayx__trades {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dayx__noteBox {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.dayx__noteHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dayx__noteTitle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
}
.dayx__noteTitle .icn {
  color: var(--accent);
  display: inline-flex;
}
.dayx__noteState {
  opacity: 0;
  transition: opacity var(--t-fast);
  color: var(--green);
}
.dayx__noteState.is-on {
  opacity: 1;
}
.dayx__note {
  min-height: 74px;
  line-height: 1.9;
}
