/* ================== استایل پنجره‌های بازشو (Modal) ================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal.show {
  display: flex;
}

.modalbox {
  background: #ffffff;
  max-width: 760px;
  width: 100%;
  border-radius: 16px;
  padding: 26px 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  border: 1px solid #e2e8f0;
  max-height: 92vh;
  overflow-y: auto;
}

.modalbox h2 {
  margin: 0 0 16px;
  font-size: 18px;
  color: #0f172a;
  border-bottom: 2px solid #17345f;
  padding-bottom: 8px;
}

.modalbox h3 {
  font-size: 14.5px;
  color: #17345f;
  margin: 16px 0 10px;
}

/* انتخابگر سرمایه‌گذار در معامله */
.inv-picker {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}

.inv-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 10px;
  align-items: start;
}

.inv-row:last-child {
  margin-bottom: 0;
}

.inv-row button.remove {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  margin-top: 2px;
}

.inv-row button.remove:hover {
  background: #fca5a5;
}

.inv-hint {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

.inv-summary {
  font-size: 12.5px;
  font-weight: 700;
  color: #17345f;
  margin-top: 8px;
  padding: 6px 10px;
  background: #eef4fc;
  border-radius: 6px;
  display: inline-block;
}

/* پیش‌نمایش تقسیم سود */
.profit-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.profit-split .box {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}

.profit-split .box.gold {
  background: #fffbeb;
  border-color: #fde68a;
}

.profit-split .box .lbl {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 2px;
}

.profit-split .box.gold .lbl {
  color: #92400e;
}

.profit-split .box .val {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.profit-split .box.gold .val {
  color: #b45309;
}

.settle-share {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
}

.settle-share .row {
  display: flex;
  justify-content: space-between;
  padding: 6px 4px;
  border-bottom: 1px solid #edf2f7;
  font-size: 13px;
}

.settle-share .row:last-child {
  border-bottom: none;
  font-weight: 700;
  color: #17345f;
}

@media(max-width: 700px) {
  .inv-row {
    grid-template-columns: 1fr;
  }
  .profit-split {
    grid-template-columns: 1fr;
  }
}

/* ================== دیت‌پیکر تقویم شمسی استاندارد و بدون باگ ================== */
.datepicker-popup {
  display: none;
  position: fixed;
  z-index: 999999;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22), 0 2px 10px rgba(15, 23, 42, 0.08);
  width: 320px;
  max-width: calc(100vw - 20px);
  padding: 16px;
  direction: rtl;
  font-family: inherit;
  user-select: none;
  box-sizing: border-box;
}

.datepicker-popup *, .datepicker-popup *::before, .datepicker-popup *::after {
  box-sizing: border-box;
}

.datepicker-popup.show {
  display: block;
  animation: dpPopupShow 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dpPopupShow {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* هدر تقویم شامل تغییر ماه و سال */
.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.dp-nav-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #17345f;
  transition: all 0.15s;
  padding: 0;
  flex-shrink: 0;
  outline: none;
}

.dp-nav-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.dp-nav-btn svg {
  width: 16px;
  height: 16px;
}

.dp-selectors {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
}

.dp-select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 700;
  color: #17345f;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}

.dp-select:focus {
  border-color: #17345f;
}

/* روزهای هفته (ش، ی، د، س، چ، پ، ج) */
.dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  margin-bottom: 8px;
}

.dp-weekdays span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  border-radius: 6px;
  background: #f8fafc;
}

.dp-weekdays span:last-child {
  color: #ef4444; /* جمعه */
  background: #fef2f2;
}

/* شبکه روزهای ماه */
.dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.dp-empty {
  display: block;
  height: 34px;
  visibility: hidden;
}

.dp-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 34px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid transparent;
  color: #1e293b;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin: 0;
  outline: none;
  font-family: inherit;
  transition: all 0.15s;
}

.dp-day:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.dp-day.friday {
  color: #dc2626;
  font-weight: 600;
}

.dp-day.today {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #b45309;
  font-weight: 700;
}

.dp-day.selected {
  background: #17345f !important;
  color: #ffffff !important;
  font-weight: 700;
  border-color: #17345f !important;
  box-shadow: 0 2px 6px rgba(23, 52, 95, 0.35);
}

/* فوتر تقویم */
.dp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.dp-today-btn {
  flex: 1;
  background: #eef4fc;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: background 0.15s;
  outline: none;
}

.dp-today-btn:hover {
  background: #dbeafe;
}

.dp-close-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  outline: none;
}

.dp-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* استایل کادر اینپوت همراه با آیکون تقویم */
.date-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.date-input-wrap input {
  padding-left: 40px !important;
  width: 100%;
  cursor: pointer;
}

.date-input-wrap .btn-date-toggle {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: #17345f;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  opacity: 0.85;
  transition: all 0.15s;
}

.date-input-wrap .btn-date-toggle:hover {
  opacity: 1;
  background: #e2e8f0;
  color: #0f172a;
}

