.orders-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.orders-heading h2 { margin: 0; }
.orders-list { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--line); }
.order-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(155px, .85fr) minmax(112px, auto) minmax(310px, 1.65fr);
  gap: 14px;
  align-items: center;
  padding: 14px 3px;
  border-bottom: 1px solid var(--line);
}
.order-row:last-child { border-bottom: 0; padding-bottom: 0; }
.order-identity h3 { font-size: 17px; line-height: 1.24; font-weight: 800; overflow-wrap: anywhere; }
.order-id { padding: 0; border: 0; min-height: 26px; color: #435939; background: transparent; font-size: 12px; font-weight: 780; font-variant-numeric: tabular-nums; }
.order-id:hover { text-decoration: underline; text-underline-offset: 3px; }
.order-period { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.order-period strong { color: var(--ink); }
.order-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 6px; }
.order-actions .button { padding-inline: 10px; font-size: 12px; }
.order-state { display: inline-flex; width: fit-content; padding: 4px 8px; border-radius: 5px; font-size: 12px; font-weight: 740; white-space: nowrap; background: #eef2dc; color: #455021; }
.order-state[data-state="confirmed"] { background: #e3ebf5; color: #294766; }
.order-state[data-state="done"] { background: #e1eedc; color: #305633; }
.order-state[data-state="cancelled"] { background: #f5e7e2; color: #852820; }
.order-empty { padding: 16px 0 4px; color: var(--muted); font-size: 14px; }
.order-overview { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px; background: var(--soft); border-radius: 9px; margin-bottom: 14px; }
.order-overview p { width: 100%; color: var(--muted); font-size: 14px; }

.calendar-trigger { background: #e7eee2; border-color: #c5d2c0; color: #263e2b; }
.calendar-trigger:hover { background: #d3e5cd; }
.calendar-trigger svg, .month-nav svg, .calendar-heading svg, .order-actions svg, .order-overview svg {
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.calendar-dialog { width: min(1160px, 100% - 28px); background: #f5f7f3; }
.calendar-dialog .dialog-inner { padding: 0; }
.calendar-heading {
  margin: 0;
  padding: 20px clamp(14px, 2.3vw, 32px);
  color: white;
  background: #17281e;
  align-items: center;
}
.calendar-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }
.calendar-identity img { width: 78px; height: 58px; object-fit: cover; border-radius: 8px; flex: none; }
.calendar-heading h2 { font-size: 32px; letter-spacing: -.04em; margin: 0; }
.calendar-heading .calendar-name { margin-top: 4px; color: #d2e2cc; font-size: 15px; overflow-wrap: anywhere; }
.calendar-heading .icon-button { color: white; border-color: #708074; }
.calendar-heading .icon-button:hover { background: #33483b; }
.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(245px, .45fr);
  gap: 20px;
  align-items: start;
  padding: clamp(14px, 2.3vw, 32px);
}
.month-view { min-width: 0; }
.month-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 7px; margin-bottom: 12px; }
.month-toolbar h3 { font-size: 27px; font-weight: 860; text-transform: capitalize; line-height: 1.15; letter-spacing: -.035em; }
.month-nav { display: flex; align-items: center; gap: 4px; }
.month-nav .button { padding-inline: 10px; }
.month-nav .icon-button, .calendar-heading .icon-button { display: grid; place-items: center; font-size: 17px; }
.calendar-controls { margin-bottom: 14px; }
.calendar-modes { display: inline-flex; gap: 3px; background: #e7ebe4; border-radius: 9px; padding: 3px; }
.calendar-modes button { min-height: 38px; padding: 5px 13px; border: 0; border-radius: 6px; color: #354638; background: transparent; font-size: 13px; font-weight: 750; }
.calendar-modes button:hover { background: #d7e1d4; }
.calendar-modes button[aria-pressed="true"] { color: white; background: #244131; }
#calendar-hint { margin-top: 7px; color: #48584c; font-size: 13px; }
.weekdays, .month-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.weekdays { margin-bottom: 6px; color: #3d5043; font-size: 11px; font-weight: 790; text-align: center; }
.month-day, .month-empty { border-radius: 8px; }
.month-empty { border: 1px dashed #dce4db; }
.month-day {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: start;
  align-items: center;
  min-width: 0;
  min-height: 76px;
  padding: 6px 7px;
  border: 1px solid var(--day-line);
  background: var(--day-bg);
  color: var(--day-text);
  text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.month-day:hover { border-color: var(--day-text); }
.month-day[aria-pressed="true"] { border-color: #266743; box-shadow: inset 0 0 0 1px #266743; }
.month-day[data-edge="true"] { border-color: #183728; box-shadow: inset 0 0 0 2px #183728; }
.month-day:focus-visible { position: relative; z-index: 1; outline: 3px solid #3b70c5; outline-offset: 1px; }
[data-tone="free"] { --day-bg: #dcf2df; --day-text: #164a2d; --day-line: #a6cdb0; --day-dot: #227444; }
[data-tone="partial"] { --day-bg: #ffedb9; --day-text: #593800; --day-line: #dfb35c; --day-dot: #986007; }
[data-tone="full"] { --day-bg: #ffdedb; --day-text: #762623; --day-line: #e9a49f; --day-dot: #ae382f; }
[data-tone="closed"] { --day-bg: #e4e9ef; --day-text: #283c53; --day-line: #b4c0cd; --day-dot: #455a71; }
.month-day[data-past="true"][data-tone="free"] { --day-bg: #edf0ec; --day-text: #526054; --day-line: #d9dfd7; --day-dot: #78867a; }
.month-day[data-elapsed="true"] .day-dot { visibility: hidden; }
.day-top { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1px; }
.day-number { display: grid; place-items: center; min-width: 21px; height: 21px; font-size: 16px; font-weight: 860; font-variant-numeric: tabular-nums; }
[aria-current="date"] .day-number { border-radius: 5px; background: #173d2a; color: white; }
.day-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--day-dot); }
.day-availability { font-size: 11px; font-weight: 770; line-height: 1.08; overflow-wrap: anywhere; }
.day-count { font-size: 11px; font-weight: 690; font-variant-numeric: tabular-nums; }
.calendar-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 7px 15px; margin: 13px 0 0; padding: 0; }
.calendar-legend li { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 690; color: var(--day-text); }
.calendar-legend li::before { content: ""; width: 8px; height: 8px; background: var(--day-dot); border-radius: 50%; }
.day-panel { background: var(--white); border: 1px solid #c9d5ca; border-radius: 12px; padding: 15px; }
.day-overview { padding-bottom: 11px; border-bottom: 1px solid #dce4db; margin-bottom: 8px; }
.day-panel h3 { font-size: 21px; letter-spacing: -.03em; line-height: 1.2; }
.day-panel h3::first-letter { text-transform: uppercase; }
#day-summary { display: inline-block; border-radius: 6px; padding: 6px 8px; background: var(--day-bg); color: var(--day-text); font-size: 13px; font-weight: 760; margin-top: 7px; }
.day-panel .form-grid { grid-template-columns: 1fr; }
.day-bookings { list-style: none; padding: 0; margin: 8px 0 0; }
.day-bookings li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px; border-top: 1px solid var(--line); padding: 6px 0; font-size: 12px; }
.day-bookings li:first-child { border-top: 0; }
.day-bookings small { display: block; color: var(--muted); }
.day-panel #calendar-form { border-top: 1px solid #dce4db; padding-top: 12px; }
.day-panel .danger { border-color: #e8b9b2; }
.calendar-details-link { display: none; }
@media (max-width: 975px) {
  .order-row { grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) auto; }
  .order-actions { grid-column: 1 / -1; justify-content: start; }
}
@media (max-width: 730px) {
  .calendar-layout { grid-template-columns: 1fr; gap: 14px; }
  .month-day { padding: 4px 5px; min-height: 52px; grid-template-rows: 1fr auto; }
  .day-availability { display: none; }
  .calendar-details-link { display: inline-flex; margin-top: 10px; }
  .calendar-heading h2 { font-size: 27px; }
  .month-toolbar h3 { font-size: 19px; }
  .month-nav .button { font-size: 12px; padding-inline: 7px; }
  .month-nav .icon-button { width: 36px; }
}
@media (max-width: 510px) {
  .order-row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
  .order-state { grid-column: 2; grid-row: 1; }
  .order-period { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 11px; }
  .order-actions .button { min-height: 44px; }
  .calendar-dialog { width: calc(100% - 16px); }
  .calendar-identity img { width: 50px; height: 46px; }
  .calendar-heading h2 { font-size: 22px; }
  .calendar-heading .calendar-name { font-size: 13px; }
  .day-number { font-size: 14px; }
  .day-dot { width: 6px; height: 6px; }
  .day-count { font-size: 10px; }
  .month-days, .weekdays { gap: 3px; }
}

.orders-heading-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.order-source { display: inline-block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.manual-order-dialog .dialog-heading h2 { font-size: clamp(27px, 4vw, 38px); }
.manual-order-dialog .quote { margin-top: 15px; }
