.calendar-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  margin-bottom:18px;
}

.calendar-head h2{
  margin:0 0 4px;
}

.calendar-nav{
  display:flex;
  gap:8px;
}

.calendar-card{
  padding:18px;
}

.calendar-month-title{
  text-transform:capitalize;
  font-size:20px;
  font-weight:700;
  margin-bottom:16px;
}

.calendar-weekdays{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:8px;
  margin-bottom:8px;
}

.calendar-weekdays div{
  text-align:center;
  font-size:12px;
  font-weight:700;
  opacity:.65;
  padding:8px;
}

.calendar-grid{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:8px;
}

.calendar-day{
  min-height:120px;
  border:1px solid rgba(0,0,0,.08);
  border-radius:12px;
  padding:8px;
  background:rgba(255,255,255,.5);
}

.calendar-empty{
  opacity:.35;
}

.calendar-today{
  outline:2px solid currentColor;
  outline-offset:-2px;
}

.calendar-day-number{
  font-size:13px;
  font-weight:700;
  margin-bottom:7px;
}

.calendar-events{
  display:flex;
  flex-direction:column;
  gap:5px;
}

.calendar-task{
  width:100%;
  border:0;
  border-radius:7px;
  padding:6px 7px;
  text-align:left;
  font-size:11px;
  cursor:pointer;
}

.cal-todo{
  opacity:.88;
}

.cal-progress{
  font-weight:600;
}

.cal-done{
  opacity:.55;
  text-decoration:line-through;
}

.cal-cancelled{
  opacity:.4;
  text-decoration:line-through;
}

@media(max-width:800px){
  .calendar-head{
    align-items:flex-start;
    flex-direction:column;
  }

  .calendar-card{
    overflow-x:auto;
  }

  .calendar-weekdays,
  .calendar-grid{
    min-width:760px;
  }
}

#calendarDescription{
  width:100% !important;
  box-sizing:border-box !important;
  display:block !important;
}

#calendarForm > label{
  display:block;
}


.calendar-nav select{
  min-width:160px;
  height:42px;
  padding:0 12px;
  border-radius:10px;
}

@media(max-width:900px){
  .calendar-nav{
    flex-wrap:wrap;
  }

  .calendar-nav select{
    min-width:180px;
    flex:1;
  }
}


#calendarNew{
  min-width:170px !important;
  height:48px !important;
  padding:0 22px !important;
  white-space:nowrap !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  flex:0 0 auto !important;
  line-height:1 !important;
}


#calendarCustomers,
#calendarQuotes,
#calendarTasks{
  width:100%;
  min-height:130px;
  box-sizing:border-box;
}

#calendarCustomers option,
#calendarQuotes option,
#calendarTasks option{
  padding:7px 8px;
}


.calendar-relation-block{
  display:flex;
  flex-direction:column;
  gap:7px;
}

.calendar-relation-block input[type="search"]{
  width:100%;
  box-sizing:border-box;
}

#calendarCustomer,
#calendarQuotes,
#calendarTasks{
  width:100%;
  box-sizing:border-box;
}

#calendarCustomer{
  min-height:44px;
}

#calendarQuotes,
#calendarTasks{
  min-height:140px;
}

.calendar-relation-block small{
  display:block;
  margin-top:2px;
}


.calendar-relation-summary{
  display:none;
  margin:16px 0;
  padding:14px 16px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:10px;
  background:rgba(0,0,0,.025);
}

.calendar-relation-summary > div{
  margin:5px 0;
  line-height:1.5;
}


.calendar-relation-link{
  border:0 !important;
  background:transparent !important;
  padding:0 !important;
  margin:0 !important;
  min-width:0 !important;
  height:auto !important;
  font:inherit !important;
  font-weight:600 !important;
  text-decoration:underline !important;
  cursor:pointer !important;
}


.calendar-relation-link{
  color:#111827 !important;
}

.calendar-relation-link:hover{
  color:#2563eb !important;
}


#calendarProject{
  width:100%;
  min-height:44px;
  box-sizing:border-box;
}


/* =====================================================
   CALENDAR MOBILE UX V2
   ===================================================== */

@media(max-width:900px){

  #calendar,
  #calendar *{
    box-sizing:border-box;
  }

  .calendar-head{
    width:100% !important;
    max-width:100% !important;
    gap:10px !important;
  }

  .calendar-nav{
    display:grid !important;
    grid-template-columns:1fr !important;
    width:100% !important;
    gap:8px !important;
  }

  .calendar-nav button,
  .calendar-nav select{
    width:100% !important;
    min-height:44px !important;
  }

  .calendar-card{
    width:100% !important;
    max-width:100% !important;
    overflow-x:auto !important;
    -webkit-overflow-scrolling:touch;
  }

  .calendar-weekdays,
  .calendar-grid{
    width:760px !important;
    min-width:760px !important;
    grid-template-columns:repeat(7,minmax(100px,1fr)) !important;
  }

  .calendar-day{
    min-width:100px !important;
  }

  .calendar-events{
    min-width:0 !important;
  }

  .calendar-event,
  .calendar-task{
    width:100% !important;
    max-width:100% !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
  }

  .calendar-month-title{
    position:sticky;
    left:0;
    background:#fff;
    z-index:2;
  }

  .calendar-relation-block{
    width:100% !important;
    max-width:100% !important;
  }

  .calendar-relation-block input[type="search"]{
    width:100% !important;
    max-width:100% !important;

    height:44px !important;
    min-height:44px !important;
    max-height:44px !important;

    font-size:16px !important;
  }

  .calendar-relation-summary{
    width:100% !important;
    max-width:100% !important;
  }

  .calendar-relation-summary > div{
    min-width:0 !important;
    overflow-wrap:anywhere !important;
  }
}


@media(max-width:600px){

  .calendar-weekdays,
  .calendar-grid{
    width:700px !important;
    min-width:700px !important;
  }

  #calendar .modal{
    align-items:flex-end !important;
    padding:0 !important;
  }

  #calendar .modal-card{
    width:100% !important;
    max-width:100% !important;
    max-height:92dvh !important;

    margin:0 !important;

    border-radius:18px 18px 0 0 !important;

    overflow-y:auto !important;
  }
}
