/* ============================================================
   SKLADAPLAN — PLANNER
   ============================================================ */

.planner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  box-sizing: border-box;
  color: #111;
}


/* ============================================================
   HEADER
   ============================================================ */

.planner-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}


.planner-kicker,
.planner-section-kicker {
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8a8a8a;
  margin-bottom: 7px;
}


.planner-header h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -.035em;
}


.planner-header p {
  margin: 9px 0 0;
  color: #777;
  font-size: 14px;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.planner-button {
  appearance: none;
  border: 1px solid #dedede;
  background: #fff;
  color: #111;
  border-radius: 12px;
  min-height: 40px;
  padding: 0 15px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition:
    background .15s ease,
    border-color .15s ease,
    transform .15s ease;
}


.planner-button:hover {
  background: #f7f7f7;
  border-color: #cfcfcf;
}


.planner-button:active {
  transform: scale(.98);
}


.planner-button-primary {
  background: var(--primary, #2563EB);
  border-color: var(--primary, #2563EB);
  color: #fff;
}


.planner-button-primary:hover {
  background: var(--primary-hover, #1D4ED8);
  border-color: var(--primary-hover, #1D4ED8);
}


.planner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}


/* ============================================================
   STATISTICS
   ============================================================ */

.planner-stats {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}


.planner-stat {
  min-height: 90px;
  padding: 17px;
  box-sizing: border-box;
  border: 1px solid #e6e6e6;
  border-radius: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}


.planner-stat-label {
  font-size: 12px;
  color: #888;
}


.planner-stat strong {
  font-size: 27px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: -.03em;
}


/* ============================================================
   CALENDAR SECTION
   ============================================================ */

.planner-calendar-section {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 20px;
}


.planner-calendar-header {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-bottom: 1px solid #e9e9e9;
}


.planner-calendar-header h2 {
  min-width: 180px;
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 620;
  text-transform: capitalize;
  letter-spacing: -.02em;
}


.planner-month-button {
  width: 36px;
  height: 36px;
  border: 1px solid #e4e4e4;
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
  color: #333;
}


.planner-month-button:hover {
  background: #f6f6f6;
}


/* ============================================================
   WEEKDAYS
   ============================================================ */

.planner-weekdays {
  display: grid;
  grid-template-columns:
    repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid #e9e9e9;
}


.planner-weekday {
  padding: 11px 8px;
  text-align: center;
  color: #999;
  font-size: 11px;
}


/* ============================================================
   DAYS
   ============================================================ */

.planner-days {
  display: grid;
  grid-template-columns:
    repeat(7, minmax(0, 1fr));
}


.planner-day {
  position: relative;
  min-height: 76px;
  padding: 9px;
  border: 0;
  border-right: 1px solid #ededed;
  border-bottom: 1px solid #ededed;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
}


.planner-day:nth-child(7n) {
  border-right: 0;
}


.planner-day:hover {
  background: #fafafa;
}


.planner-day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  color: #333;
}


.planner-day-muted {
  color: #bbb;
}


.planner-day-muted
.planner-day-number {
  color: #bdbdbd;
}


.planner-day-today
.planner-day-number {
  background: var(--primary, #0f766e);
  color: #fff;
}


.planner-day-selected {
  box-shadow:
    inset 0 0 0 2px var(--primary, #0f766e);
}


.planner-day-events {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 9px;
  display: flex;
  gap: 5px;
  align-items: center;
}


.planner-event-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: 10px;
  font-size: 10px;
  background: #f0f0f0;
  color: #555;
}


.planner-event-dot.shipment {
  background: var(--primary, #0f766e);
  color: #fff;
}


.planner-event-dot.task {
  background: #e8e8e8;
  color: #444;
}


/* ============================================================
   SELECTED DAY
   ============================================================ */

.planner-day-panel {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 20px;
  padding: 20px;
}


.planner-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}


.planner-section-header h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 630;
  letter-spacing: -.025em;
}


.planner-empty {
  padding: 28px 10px;
  color: #999;
  font-size: 14px;
  text-align: center;
  border: 1px dashed #ddd;
  border-radius: 14px;
}


/* ============================================================
   LIST
   ============================================================ */

.planner-list-section {
  margin-top: 20px;
}


.planner-list-section:first-child {
  margin-top: 0;
}


.planner-list-title {
  margin-bottom: 9px;
  color: #888;
  font-size: 12px;
  font-weight: 600;
}


.planner-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


/* ============================================================
   CARD
   ============================================================ */

.planner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 14px;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  background: #fff;
}


.planner-card-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}


.planner-card-time {
  width: 48px;
  flex: 0 0 48px;
  color: #777;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}


.planner-card-content {
  min-width: 0;
}


.planner-card-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 590;
}


.planner-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 5px;
  color: #999;
  font-size: 11px;
}


.planner-card-side {
  display: flex;
  align-items: center;
  gap: 12px;
}


.planner-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  background: #f3f3f3;
  color: #666;
  font-size: 11px;
  white-space: nowrap;
}


.planner-card-buttons {
  display: flex;
  gap: 4px;
}


.planner-icon-button {
  width: 31px;
  height: 31px;
  padding: 0;
  border: 1px solid #e3e3e3;
  background: #fff;
  color: #444;
  border-radius: 9px;
  cursor: pointer;
  font-size: 15px;
}


.planner-icon-button:hover {
  background: #f5f5f5;
}


.planner-icon-button.planner-danger {
  color: #999;
}


/* ============================================================
   MODAL
   ============================================================ */

.planner-modal-overlay {
  position: fixed;
  z-index: 99999;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, .38);
}


.planner-modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: 22px;
  padding: 22px;
  box-sizing: border-box;
  box-shadow:
    0 25px 70px rgba(0, 0, 0, .18);
}


.planner-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}


.planner-modal-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -.03em;
}


.planner-modal-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: #f3f3f3;
  border-radius: 50%;
  cursor: pointer;
  font-size: 21px;
  color: #555;
}


/* ============================================================
   FORM
   ============================================================ */

.planner-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}


.planner-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}


.planner-form label > span {
  font-size: 12px;
  color: #777;
}


.planner-form input,
.planner-form select,
.planner-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #dedede;
  border-radius: 11px;
  background: #fff;
  color: #111;
  padding: 11px 12px;
  font: inherit;
  font-size: 13px;
  outline: none;
}


.planner-form textarea {
  resize: vertical;
  min-height: 90px;
}


.planner-form input:focus,
.planner-form select:focus,
.planner-form textarea:focus {
  border-color: #999;
  box-shadow:
    0 0 0 3px rgba(0, 0, 0, .05);
}


.planner-form-grid {
  display: grid;
  grid-template-columns:
    1fr 1fr;
  gap: 10px;
}


.planner-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 5px;
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 700px) {

  .planner {
    padding: 16px;
  }


  .planner-header {
    align-items: stretch;
    flex-direction: column;
    gap: 15px;
  }


  .planner-header h1 {
    font-size: 29px;
  }


  .planner-header
  .planner-button {
    align-self: flex-start;
  }


  .planner-stats {
    grid-template-columns:
      1fr 1fr 1fr;
    gap: 7px;
  }


  .planner-stat {
    min-height: 76px;
    padding: 12px;
    border-radius: 13px;
  }


  .planner-stat-label {
    font-size: 10px;
    line-height: 1.2;
  }


  .planner-stat strong {
    font-size: 22px;
  }


  .planner-calendar-section {
    border-radius: 16px;
  }


  .planner-calendar-header {
    height: 57px;
    gap: 10px;
  }


  .planner-calendar-header h2 {
    min-width: 145px;
    font-size: 15px;
  }


  .planner-weekday {
    padding: 9px 2px;
    font-size: 10px;
  }


  .planner-day {
    min-height: 58px;
    padding: 5px;
  }


  .planner-day-number {
    width: 25px;
    height: 25px;
    font-size: 12px;
  }


  .planner-day-events {
    left: 5px;
    right: 5px;
    bottom: 5px;
  }


  .planner-event-dot {
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-size: 9px;
  }


  .planner-day-panel {
    padding: 15px;
    border-radius: 16px;
  }


  .planner-section-header {
    flex-direction: column;
    gap: 13px;
  }


  .planner-section-header h2 {
    font-size: 18px;
  }


  .planner-card {
    align-items: flex-start;
    padding: 12px;
    gap: 10px;
  }


  .planner-card-main {
    gap: 8px;
  }


  .planner-card-time {
    width: 38px;
    flex-basis: 38px;
    font-size: 11px;
  }


  .planner-card-title {
    font-size: 13px;
  }


  .planner-card-meta {
    font-size: 10px;
  }


  .planner-card-side {
    flex-direction: column;
    align-items: flex-end;
    gap: 7px;
  }


  .planner-status {
    font-size: 9px;
    min-height: 23px;
    padding: 0 7px;
  }


  .planner-icon-button {
    width: 28px;
    height: 28px;
  }


  .planner-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }


  .planner-modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
    padding: 20px 16px;
  }


  .planner-form-grid {
    grid-template-columns:
      1fr 1fr;
  }

}


@media (max-width: 420px) {

  .planner {
    padding: 12px;
  }


  .planner-stats {
    gap: 5px;
  }


  .planner-stat {
    padding: 10px;
  }


  .planner-stat-label {
    font-size: 9px;
  }


  .planner-stat strong {
    font-size: 19px;
  }


  .planner-day {
    min-height: 52px;
  }


  .planner-day-number {
    width: 23px;
    height: 23px;
  }


  .planner-form-grid {
    grid-template-columns:
      1fr;
  }

}


/* ============================================================
   ПАНЕЛЬ УПРАВЛЕНИЯ КАЛЕНДАРЁМ

   Заголовок страницы живёт в topbar, поэтому внутри
   страницы остаётся только компактная панель.
   ============================================================ */

.planner-header-compact {
  justify-content: flex-end;
  padding-bottom: 0;
  border-bottom: 0;
}


/* ---- чекбокс в форме задачи ---- */

.planner-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.planner-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary, #0f766e);
  cursor: pointer;
}

.planner-check span {
  font-size: 13px;
}


/* ---- иконки внутри кнопок карточки ---- */

.planner-icon-button .icon {
  width: 16px;
  height: 16px;
}

.planner-icon-button.is-active {
  color: #d99a00;
}


/* ---- маркеры дня в календаре ---- */

.planner-event-dot {
  gap: 3px;
}

.planner-event-dot .icon {
  width: 11px;
  height: 11px;
  stroke-width: 2;
}


/* ---- задача из раздела «Задачи» ---- */

.planner-card-external {
  border-style: dashed;
}

.planner-card-external .planner-card-time .icon {
  width: 16px;
  height: 16px;
}

.planner-card-title-done {
  text-decoration: line-through;
  color: #999;
}

.planner-list-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.planner-button-small {
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
}


/* ---- просроченная задача ---- */

.planner-overdue {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: #b42318;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* ============================================================
   SKLADAPLAN — CALENDAR DAY ALIGNMENT
   Цифра дня всегда в левом верхнем углу ячейки
   ============================================================ */

.planner-day {
  display: flex !important;
  flex-direction: column !important;

  align-items: flex-start !important;
  justify-content: flex-start !important;

  text-align: left !important;
}

.planner-day-number {
  margin: 0 !important;
  flex: 0 0 auto !important;
}

/* ============================================================
   PLANNER — ICON BUTTON ALIGNMENT
   ============================================================ */

.planner-icon-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 38px !important;
  height: 38px !important;

  padding: 0 !important;
  margin: 0 !important;

  line-height: 0 !important;
  text-align: center !important;
}

.planner-icon-button .icon {
  display: block !important;

  width: 18px !important;
  height: 18px !important;

  margin: 0 !important;
  padding: 0 !important;

  flex: 0 0 18px !important;
}
