* {
  box-sizing: border-box;
  font-family: "Vazirmatn-Regular", Tahoma, Arial, sans-serif!important;
}
@font-face {
  font-family: "Vazirmatn-Regular";
  src: url("Vazirmatn-Regular.woff2");
}
body {
  margin: 0;
  background: #f7f6f2;
  color: #171717;
}
/* ============================================================
   چیدمان کلی
   ============================================================ */
.app {
  width: 100%;
  max-width: 800px;
  margin: 16px auto;
  padding: 0 12px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
}

.side-panel {
  flex: 0 0 300px;
}

.calendar-panel {
  flex: 1 1 700px;
  max-width: 850px;
}
.calendar-panel {
  flex: 1 1 700px;
  max-width: 850px;
}

.panel {
  background: #fff;
  border: 1px solid #dedede;
  border-radius: 14px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  padding: 5px;
}

/* ============================================================
   بخش‌های تاشو (Collapsible)
   ============================================================ */
.side-section {
  margin-top: 12px;
  border: 1px solid #e4dcc8;
  border-radius: 12px;
  overflow: hidden;
}

.side-section-title {
  width: 100%;
  padding: 13px 12px;
  border: 0;
  cursor: pointer;
  background: linear-gradient(135deg, #fff8e9, #fff1d2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 800;
}

.chevron {
  width: 26px;
  height: 26px;
  border: 2px solid #e0a719;
  color: #c89110;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 500;
}

.toggle-btn[aria-expanded="false"] .chevron {
  transform: rotate(180deg);
}

.collapsible-body {
  overflow: hidden;
  max-height: 3000px;
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.2s;
}

.collapsible-body.closed {
  max-height: 0;
  opacity: 0;
}
/* ============================================================
   هدر تقویم — ۳ ستون (چپ | وسط | راست)
   ============================================================ */
.calendar-header {
  height: 60px;
  border-radius: 11px;
  background: linear-gradient(135deg, #e0a719, #e7ad18);
  color: #fff;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
}

/* گروه‌های چپ و راست */
.header-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* عنوان وسط — بدون جابجایی دکمه‌ها */
#monthTitle {
  margin: 0;
  text-align: center;
  font-size: 21px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;        /* حیاتی — اجازه می‌دهد محتوا در ستون 1fr کوچک شود */
  padding: 0 6px;
}

/* ============================================================
   دکمه‌های ناوبری
   ============================================================ */
.nav-btn {
  flex: 0 0 40px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
  border-radius: 8px;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ============================================================
   دکمه‌های انتخاب ماه / سال
   ============================================================ */
.selectbtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.selectbtn:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: #fff;
}

/* ============================================================
   منوی انتخاب ماه
   ============================================================ */
.month-picker-wrap {
  position: relative;
  display: inline-flex;
}

.month-picker {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1000;
  width: 200px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: 0.18s ease;
  color: #171717;
}

.month-picker.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.month-picker button {
  border: 0;
  background: transparent;
  padding: 8px 5px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  color: #171717;
  cursor: pointer;
  transition: 0.15s ease;
}

.month-picker button:hover {
  background: rgba(224, 167, 25, 0.14);
}

.month-picker button.active {
  background: #e0a719;
  color: #fff;
}

/* ============================================================
   موبایل
   ============================================================ */
@media (max-width: 720px) {
  .calendar-header {
    height: 52px;
    padding: 0 6px;
    gap: 4px;
  }

  .nav-btn {
    flex: 0 0 32px;
    height: 40px;
    font-size: 24px;
  }

  #monthTitle {
    font-size: 15px;
  }

  .selectbtn {
    padding: 5px 8px;
    font-size: 11px;
    height: 30px;
  }

  .header-group {
    gap: 3px;
  }

  .month-picker {
    width: 180px;
  }
}

/* موبایل خیلی باریک */
@media (max-width: 480px) {
  #monthTitle {
    font-size: 13px;
  }

  .selectbtn {
    padding: 5px 6px;
  }
}

.weekdays {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: linear-gradient(135deg, #e0a719, #e9ae1d);
  color: #fff;
  border-radius: 10px;
  overflow: hidden;
}

.weekdays span {
  text-align: center;
  padding: 10px 2px;
  font-weight: 800;
}

/* ============================================================
   گرید روزها — سایز کوچک‌تر شد
   ============================================================ */
.calendar-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day {
  min-height: 62px;      /* از 87px به 62px */
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 5px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fff;
}

.day:hover {
  border-color: #e8c66e;
  background: #fffaf0;
}

.day.other-month {
  color: #aaa;
  background: #fafafa;
}

.day.today {
  border: 2px solid #e0a719;
  background: #fffdf5;
}

.day.friday {
  background: #fff0f1;
}

.day.friday .day-number {
  color: #e51e2a;
}

.day.holiday {
  background: #ffe8ea;
}

.day-number {
  font-size: 21px;       /* از 21px به 17px */
  font-weight: 500;
}

.day.holiday .day-number {
  color: #e51e2a;
}

.secondary {
  display: flex;
  gap: 8px;
  margin-top: 3px;
  font-size: 10px;
  color: #666;
  direction: ltr;
}

/* ============================================================
   دکمه‌های عملیات
   ============================================================ */
.calendar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.today-btn,
.excel-btn {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  font-size: 15px;
  font-family: 'Vazirmatn-Regular';
}

.today-btn {
  background: linear-gradient(135deg, #e0a719, #e7aa15);
}

.excel-btn {
  background: linear-gradient(135deg, #3e8e57, #2f7545);
}

.today-btn:hover,
.excel-btn:hover {
  filter: brightness(0.94);
}

.excel-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* ============================================================
   ساعت
   ============================================================ */
.mini-clock {
  display: grid;
  place-items: center;
  padding-bottom: 10px;
}

.clock-face {
  width: 175px;
  height: 175px;
  border-radius: 50%;
  background: radial-gradient(circle, #2b3033, #070a0b 68%, #000);
  border: 5px solid #171b1c;
  box-shadow: inset 0 0 0 2px #666, 0 4px 12px rgba(0, 0, 0, 0.22);
  color: #15e6e9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: monospace;
}

.clock-top {
  font-size: 12px;
}

.clock-face #clockTime {
  font-size: 29px;
}

.clock-body {
  text-align: center;
  padding: 16px;
}

.clock-date {
  color: #ffc518;
  font-size: 20px;
}
.large-clock {
  direction: ltr;
  font-family: monospace;
  font-size: 30px;
  font-weight: 700;
}

/* ============================================================
   اطلاعات جاری (سال / ماه / میلادی / قمری)
   ============================================================ */
.current-info {
  background: #fffdf7;
  border: 1px solid #eee4c9;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
}

.current-info > div {
  margin-top: 8px;
  font-size: 14px;
}

.year-nav {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  color: #c89110;
  font-size: 20px;
}

.year-nav button {
  border: 2px solid #e0a719;
  color: #c89110;
  background: #fff;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

/* ============================================================
   رویدادها
   ============================================================ */
.event-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  padding: 8px 0;
  line-height: 1.9;
  font-size: 15px;
}

.event-date {
  font-weight: 800;
  white-space: nowrap;
}

.event-row.holiday {
  color: #e51e2a;
}

.event-text {
  color: #333;
}

.side-events-body {
  max-height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 12px 10px;
}

.side-events-body .event-row {
  grid-template-columns: 70px 1fr;
  gap: 6px;
  padding: 6px 0;
  font-size: 12px;
  line-height: 1.7;
}

.side-events-body .event-text {
  color: #333;
}

.side-events-body::-webkit-scrollbar {
  width: 7px;
}

.side-events-body::-webkit-scrollbar-thumb {
  background: #d8b65c;
  border-radius: 10px;
}

.side-events-body::-webkit-scrollbar-track {
  background: #f7f3e8;
}

/* ============================================================
   پرش به سال
   ============================================================ */
.year-jump-box {
  position: absolute;
  left: 30px;
  z-index: 100;
  display: none;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid #d7dce5;
  border-radius: 8px;
  padding: 5px;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.12);
}

.year-jump-box.show {
  display: flex;
}

.year-jump-box input {
  width: 75px;
  height: 32px;
  border: 1px solid #ccd3dd;
  border-radius: 6px;
  text-align: center;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.year-jump-box button {
  height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: #2f7d32;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}

/* ============================================================
   واکنش‌گرایی (Responsive)
   ============================================================ */
@media (max-width: 1100px) {
  .side-panel {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
@media (max-width: 320px) {
  .calendar-actions {
    grid-template-columns: 1fr;
  }

}
@media (max-width: 720px) {
  .app {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 0 8px;
    gap: 10px;
  }

  .calendar-panel {
    order: 1;
    max-width: none;
  }

  .side-panel {
    order: 2;
    flex: none;
    width: 100%;
  }

  .day {
    min-height: 54px;    /* کوچک‌تر در موبایل */
  }

  .day-number {
    font-size: 15px;
  }

  .event-row {
    font-size: 13px;
  }

  .side-events-body {
    max-height: 220px;
  }
}
/* ============================================================
   Toggle فعال/غیرفعال
   ============================================================ */
.rm-toggle {
  display: inline-block;
  position: relative;
  width: 38px;
  height: 20px;
  cursor: pointer;
}

.rm-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.rm-toggle-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 20px;
  transition: background 0.2s;
}

.rm-toggle-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.rm-toggle input:checked + .rm-toggle-slider {
  background: linear-gradient(180deg, #43a047, #2e7d32);
}

.rm-toggle input:checked + .rm-toggle-slider::before {
  transform: translateX(18px);
}

.rm-row-inactive {
  opacity: 0.55;
}

.rm-row-inactive strong {
  text-decoration: line-through;
  color: #888;
}

@media (max-width: 720px) {
  .rm-toggle { width: 34px; height: 18px; }
  .rm-toggle-slider::before { width: 14px; height: 14px; }
  .rm-toggle input:checked + .rm-toggle-slider::before { transform: translateX(16px); }
}
/* ============================================================
   سه‌گانه‌ی تاریخ در مودال
   ============================================================ */
.rm-date-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.rm-date-item {
  background: #fffdf7;
  border: 1px solid #eee4c9;
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.rm-date-label {
  font-size: 11px;
  font-weight: 700;
  color: #b8941e;
  text-transform: uppercase;
}

.rm-date-value {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  direction: ltr;
}

/* ============================================================
   Badge روی روزها
   ============================================================ */
.calendar-grid .day {
  position: relative;   /* برای قرارگیری badge */
}

.rm-day-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: linear-gradient(180deg, #e53935, #c62828);
  color: #fff;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  line-height: 1;
}

.day.other-month .rm-day-badge {
  opacity: 0.5;
}

@media (max-width: 720px) {
  .rm-date-trio {
    grid-template-columns: 1fr;
  }

  .rm-day-badge {
    min-width: 14px;
    height: 14px;
    font-size: 8px;
  }
}