:root {
  color-scheme: light;
  --page-background: #f6f8fb;
  --surface: #ffffff;
  --text: #263238;
  --muted: #455a64;
  --border: #d9dee7;
  --sidebar: #263238;
  --sidebar-active: #455a64;
  --confirmed-bg: #D6ECD9;
  --confirmed-border: #4E8F64;
  --confirmed-text: #183F27;
  --pre-reservation-bg: #FBE7A9;
  --pre-reservation-border: #B48620;
  --pre-reservation-text: #563F08;
  --history-bg: #eef2f6;
  --history-text: #455a64;
  --history-border: #b8c1cc;
  --awaiting-bg: #fff6d9;
  --awaiting-border: #d9b44a;
  --awaiting-text: #6b5410;
  --action-secondary-bg: #ffffff;
  --action-secondary-text: #37474f;
  --agenda-nav-button-width: 41px;
  --agenda-nav-button-height: 32px;
  --agenda-nav-button-radius: 6px;
  --agenda-nav-gap: 12px;
  --agenda-nav-mobile-button-width: 32px;
  --fc-border-color: var(--border);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: transparent;
  --fc-today-bg-color: var(--history-bg);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--page-background);
  color: var(--text);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  flex: 0 0 240px;
  min-height: 100vh;
  padding: 24px 20px;
  background: var(--sidebar);
  color: #ffffff;
}

.sidebar__brand {
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 16px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  text-decoration: none;
}

.sidebar__link--active { background: var(--sidebar-active); font-weight: 700; }

.app-back-link {
  display: inline-flex;
  width: max-content;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: 600 14px/20px Inter, Arial, Helvetica, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.app-back-link__arrow {
  font-size: 16px;
  line-height: 20px;
}

.app-back-link:hover {
  background: rgb(217 222 231 / 42%);
  color: var(--text);
}

.app-back-link:focus-visible {
  outline: 2px solid #78909c;
  outline-offset: 2px;
}

.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  background: var(--sidebar);
  color: #ffffff;
}

.mobile-header__brand { font-size: 16px; font-weight: 700; }

.mobile-header__menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}

.mobile-header__menu span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background: #ffffff;
  box-shadow: 0 -5px 0 #ffffff, 0 5px 0 #ffffff;
}

.calendar-hint {
  display: none;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

.page-shell {
  flex: 1 1 auto;
  min-width: 0;
  margin: 4px 6px 0 8px;
  position: relative;
}

#calendar { min-height: calc(100vh - 8px); }

.fc { --fc-small-font-size: 12px; font-size: 13px; }

.fc .fc-toolbar.fc-header-toolbar {
  min-height: 77px;
  margin: 0 0 12px;
  padding: 20px 16px 20px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.fc .fc-toolbar-title {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.fc .fc-button {
  height: 32px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--history-bg);
  color: var(--history-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
  text-transform: none;
}

.fc .fc-button:hover,
.fc .fc-button:focus,
.fc .fc-button:active,
.fc .fc-button-primary:not(:disabled).fc-button-active {
  border-color: var(--border);
  background: #e4eaf0;
  color: var(--text);
  box-shadow: none;
}

#calendar button[aria-label="Mês Anterior"],
#calendar button[aria-label="Próximo Mês"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--agenda-nav-button-width);
  height: var(--agenda-nav-button-height);
  padding: 0;
  border-radius: var(--agenda-nav-button-radius);
  font-size: 0;
  line-height: 1;
}

#calendar button[aria-label="Mês Anterior"] svg,
#calendar button[aria-label="Próximo Mês"] svg { display: none; }

#calendar button[aria-label="Mês Anterior"]::before,
#calendar button[aria-label="Próximo Mês"]::before,
#day-view-prev::before,
#day-view-next::before {
  display: block;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

#calendar button[aria-label="Mês Anterior"]::before,
#day-view-prev::before { content: "<"; }

#calendar button[aria-label="Próximo Mês"]::before,
#day-view-next::before { content: ">"; }

@media (min-width: 640px) {
  #calendar > div:first-child > div:first-child > div:has(> button[aria-label="Mês Anterior"]) {
    gap: var(--agenda-nav-gap);
  }
}

.fc .fc-toolbar-chunk { display: flex; align-items: center; gap: 12px; }
.fc .fc-toolbar-chunk:nth-child(1) { order: 1; }
.fc .fc-toolbar-chunk:nth-child(2) { order: 2; margin-left: 4px; }
.fc .fc-toolbar-chunk:nth-child(3) { order: 3; }

.fc .fc-daygrid-header { border: 0; }
.fc .fc-col-header-cell { height: 24px; border: 0; background: transparent; }
.fc .fc-col-header-cell-cushion {
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 24px;
  text-decoration: none;
}

.fc .fc-daygrid-body { border: 0; }
.fc .fc-daygrid-day { height: 136px; border: 0; background: transparent; }
.fc .fc-daygrid-day-frame {
  min-height: 136px;
  margin: 0 2px 4px 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

.fc .fc-daygrid-day-top { flex-direction: row; }
.fc .fc-daygrid-day-number {
  padding: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  text-decoration: none;
}

.fc .day-cell--other .fc-daygrid-day-frame { opacity: 0.65; }
.fc .fc-day-today .fc-daygrid-day-frame { border-width: 2px; background: var(--history-bg); }
.fc .fc-daygrid-day-events { margin: 4px 8px 0; }
.fc .fc-daygrid-event {
  min-height: 22px;
  margin: 0 0 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 12px;
}
.fc .fc-event-time, .fc .fc-event-title { font-weight: 700; }
.fc .fc-daygrid-event .fc-event-main,
.fc .fc-daygrid-event .fc-event-time,
.fc .fc-daygrid-event .fc-event-title { color: var(--fc-event-contrast-color) !important; }
.fc .fc-more-link {
  display: block;
  padding: 1px 8px;
  color: var(--history-text);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
}
.fc .fc-popover { border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 8px 24px rgb(38 50 56 / 14%); }
.fc .fc-popover-header { background: var(--history-bg); color: var(--history-text); }

.status-confirmado { --fc-event-contrast-color: var(--confirmed-text); background-color: var(--confirmed-bg); border-color: var(--confirmed-border); color: var(--confirmed-text); }
.status-pre_reserva { --fc-event-contrast-color: var(--pre-reservation-text); background-color: var(--pre-reservation-bg); border-color: var(--pre-reservation-border); color: var(--pre-reservation-text); }
body > [role="dialog"][data-date] :is(.status-confirmado, .status-pre_reserva) > div { color: inherit; }

/* A versão local do tema v7 usa classes compiladas; estes hooks semânticos permanecem estáveis. */
#calendar > div:first-child {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 77px;
  margin: 0 0 12px;
  padding: 20px 16px 20px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

#calendar > div:first-child > div:nth-child(2) { justify-self: start; margin-left: 12px; }
#calendar > div:first-child > div:nth-child(1),
#calendar > div:first-child > div:nth-child(2),
#calendar > div:first-child > div:nth-child(3) { display: flex; align-items: center; gap: 12px; }

#calendar button[aria-label="Mês ▼"] { width: 64px; padding: 8px 10px; white-space: nowrap; }
#calendar button[aria-label="+ Novo evento"] {
  position: absolute;
  top: 22.5px;
  left: 56.16%;
  width: 116px;
  border-color: transparent;
  background: var(--sidebar);
  color: #ffffff;
}
#calendar button[aria-label="Pré-reserva"] {
  height: 22px;
  padding: 4px 12px;
  border-color: var(--pre-reservation-border);
  background: var(--pre-reservation-bg);
  color: var(--pre-reservation-text);
}
#calendar button[aria-label="Confirmado"] {
  height: 22px;
  padding: 4px 12px;
  border-color: var(--confirmed-border);
  background: var(--confirmed-bg);
  color: var(--confirmed-text);
}
#calendar button[aria-label="Histórico ›"] {
  position: relative;
  margin-left: 12px;
}
#calendar button[aria-label="Histórico ›"]::before {
  position: absolute;
  top: 4px;
  left: -13px;
  width: 1px;
  height: 24px;
  background: var(--border);
  content: "";
}

#calendar [role="heading"] {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

#calendar button {
  height: 32px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--history-bg);
  color: var(--history-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: none;
}

#calendar [role="columnheader"] {
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

#calendar [role="columnheader"] > div { height: 24px; line-height: 24px; }

#calendar [role="gridcell"] {
  height: 136px;
  min-height: 136px;
  margin: 0 2px 4px 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
}

#calendar [role="gridcell"] > div:first-child { padding: 0; }
#calendar [role="gridcell"] [aria-hidden="true"] { color: var(--text); font-size: 13px; font-weight: 700; }
#calendar [role="gridcell"].day-cell--other { opacity: 0.65; }
#calendar [role="gridcell"].day-cell--selected { border-width: 2px; background: var(--history-bg); }
#calendar [role="gridcell"] { cursor: pointer; }
#calendar [role="gridcell"].day-cell--other [aria-hidden="true"] { color: var(--muted); }
#calendar [role="gridcell"] .status-confirmado { --fc-event-contrast-color: var(--confirmed-text) !important; }
#calendar [role="gridcell"] .status-pre_reserva { --fc-event-contrast-color: var(--pre-reservation-text) !important; }
#calendar [role="gridcell"] .status-confirmado > div,
#calendar [role="gridcell"] .status-pre_reserva > div { color: var(--fc-event-contrast-color) !important; }
#calendar [role="gridcell"] [role="button"][aria-haspopup="dialog"] {
  display: block;
  margin-top: 0;
  padding: 1px 8px;
  border: 1px solid #b8c1cc;
  border-radius: 6px;
  background: var(--history-bg);
  color: var(--history-text);
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
}

noscript { display: block; margin-top: 16px; color: #b42318; }

@media (max-width: 639px) {
  .sidebar.sidebar--mobile-open {
    position: fixed;
    z-index: 50;
    top: 56px;
    bottom: 0;
    left: 0;
    display: flex;
    width: 240px;
    min-height: 0;
    box-shadow: 8px 0 24px rgb(26 38 46 / 18%);
  }
}

.day-panel {
  position: absolute;
  z-index: 20;
  top: 221px;
  right: 12%;
  display: flex;
  width: 500px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(26 38 46 / 18%);
}

.day-panel[hidden] { display: none; }

.day-panel__header {
  display: flex;
  align-items: center;
  min-height: 32px;
  gap: 12px;
}

.day-panel__header h2 {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.day-panel__close,
.day-panel__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--history-bg);
  color: var(--history-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.day-panel__close {
  width: 32px;
  padding: 8px;
  font-size: 16px;
}

.day-panel__events {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.day-panel__event {
  display: flex;
  align-items: center;
  min-height: 34px;
  gap: 10px;
  border-bottom: 1px solid #edf0f3;
}

.day-panel__event:last-child { border-bottom: 0; }

.day-panel__event-name {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.day-panel__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 4px 12px;
  border: 1px solid;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.day-panel__status.status-confirmado { border-color: var(--confirmed-border); background: var(--confirmed-bg); color: var(--confirmed-text); }
.day-panel__status.status-pre_reserva { border-color: var(--pre-reservation-border); background: var(--pre-reservation-bg); color: var(--pre-reservation-text); }
.day-panel__empty { margin: 0; color: var(--muted); font-size: 13px; }

.day-panel__alerts { display: flex; flex-direction: column; gap: 0; }
.day-panel__alert {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #f4a259;
  border-radius: 6px;
  background: #fff4e5;
  color: #8a4b08;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.day-panel__actions-title { display: none; }

.day-panel__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.day-panel__button--primary { align-self: flex-start; border-color: transparent; background: var(--sidebar); color: #ffffff; }
.day-panel__note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.3; }

.event-modal-open { overflow: hidden; }

.event-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.event-modal[hidden] { display: none; }

.event-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(38 50 56 / 45%);
}

.event-modal__dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgb(26 38 46 / 24%);
}

.event-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  gap: 12px;
  margin-bottom: 16px;
}
.event-modal__header h2 { flex: 1 1 auto; min-width: 0; }
.event-modal__header h2 { margin: 0; color: var(--text); font-size: 18px; line-height: 1.2; }
.event-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--history-bg);
  color: var(--history-text);
  font: inherit;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}
.event-modal__close:hover,
.event-modal__close:focus-visible { border-color: #b8c1cc; background: #e4eaf0; }
.event-modal__close:focus-visible { outline: 2px solid rgb(120 144 156 / 24%); outline-offset: 1px; }
.event-item-edit-modal-open { overflow: hidden; }
.event-item-edit-modal { position: fixed; z-index: 130; inset: 0; display: grid; place-items: center; padding: 24px; }
.event-item-edit-modal[hidden] { display: none; }
.event-item-edit-modal__backdrop { position: absolute; inset: 0; background: rgb(9 18 32 / 42%); }
.event-item-edit-modal__dialog { position: relative; display: flex; width: min(520px, 100%); height: min(420px, calc(100vh - 32px)); max-height: calc(100vh - 32px); flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 10px 28px rgb(0 0 0 / 16%); }
.event-item-edit-modal__header { position: relative; display: flex; min-height: 117px; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 32px; border-bottom: 1px solid var(--border); }
.event-item-edit-modal__header h2 { margin: 0 0 8px; color: var(--text); font-size: 26px; font-weight: 600; line-height: 1.2; }
.event-item-edit-modal__header p { margin: 0; color: var(--muted); font-size: 17px; font-weight: 500; line-height: 1.35; }
.event-item-edit-modal__close { display: inline-flex; width: 32px; height: 32px; flex: 0 0 32px; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--history-bg); color: var(--history-text); font: 500 18px/1 Inter, Arial, Helvetica, sans-serif; cursor: pointer; }
.event-item-edit-modal__close:hover,
.event-item-edit-modal__close:focus-visible { border-color: #b8c1cc; background: #e4eaf0; outline: 2px solid rgb(120 144 156 / 24%); outline-offset: 1px; }
.event-item-edit-modal__body { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; gap: 4px; padding: 24px 32px; }
.event-item-edit-modal__context,
.event-item-edit-modal__controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.event-item-edit-modal__context { min-height: 52px; }
.event-item-edit-modal__availability { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 14px; line-height: 20px; }
.event-item-edit-modal__availability span { min-width: 0; }
.event-item-edit-modal__availability strong { color: var(--text); font-size: 14px; font-weight: 600; }
.event-item-edit-modal__monitor { min-width: 0; margin: 0; padding: 0; border: 0; }
.event-item-edit-modal__monitor legend,
.event-item-edit-modal__quantity label,
.event-item-edit-modal__value span { display: block; margin: 0 0 4px; padding: 0; color: var(--text); font-size: 12px; font-weight: 700; line-height: 16px; }
.event-item-edit-modal__binary-choice { display: flex; gap: 8px; }
.event-item-edit-modal__choice { display: inline-flex; width: 72px; height: 32px; align-items: center; justify-content: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: 500 12px/16px Inter, Arial, Helvetica, sans-serif; cursor: pointer; }
.event-item-edit-modal__choice--selected { border-color: var(--text); background: var(--history-bg); }
.event-item-edit-modal__choice:hover,
.event-item-edit-modal__choice:focus-visible { border-color: #78909c; outline: 2px solid rgb(120 144 156 / 24%); outline-offset: 1px; }
.event-item-edit-modal__controls { min-height: 70px; margin-top: 4px; }
.event-item-edit-modal__quantity,
.event-item-edit-modal__value { min-width: 0; }
.event-item-edit-modal__stepper { display: flex; height: 28px; gap: 4px; align-items: center; }
.event-item-edit-modal__stepper button,
.event-item-edit-modal__stepper input { height: 28px; border: 1px solid var(--border); border-radius: 6px; background: var(--history-bg); color: var(--text); font: 500 14px/1 Inter, Arial, Helvetica, sans-serif; text-align: center; }
.event-item-edit-modal__stepper button { width: 28px; padding: 0; cursor: pointer; }
.event-item-edit-modal__stepper input { width: 36px; padding: 4px; background: var(--surface); }
.event-item-edit-modal__stepper button:disabled { color: #66727d; cursor: not-allowed; opacity: 0.55; }
.event-item-edit-modal__stepper button:hover:not(:disabled),
.event-item-edit-modal__stepper button:focus-visible,
.event-item-edit-modal__stepper input:focus-visible,
.event-item-edit-modal__value input:focus-visible { border-color: #78909c; outline: 2px solid rgb(120 144 156 / 24%); outline-offset: 1px; }
.event-item-edit-modal__value input { width: 100%; height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--muted); font: 400 12px/1.2 Inter, Arial, Helvetica, sans-serif; text-align: right; }
.event-item-edit-modal__total { position: relative; min-height: 44px; margin-top: 2px; color: var(--muted); font-size: 14px; line-height: 20px; }
.event-item-edit-modal__total > span { display: block; }
.event-item-edit-modal__total strong { position: absolute; top: 0; right: 0; color: var(--text); font-size: 14px; font-weight: 600; }
.event-item-edit-modal__total small { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; }
.event-item-edit-modal__body > .event-form__error { margin-top: auto; }
.event-item-edit-modal__footer { display: flex; min-height: 80px; align-items: center; justify-content: flex-end; gap: 12px; padding: 24px 32px; border-top: 1px solid var(--border); }
.event-item-edit-modal__footer .day-panel__button--primary { align-self: auto; border-color: transparent; background: var(--sidebar); color: #ffffff; }
.event-item-remove-modal-open { overflow: hidden; }
.event-item-remove-modal { position: fixed; z-index: 140; inset: 0; display: grid; place-items: center; padding: 24px; }
.event-item-remove-modal[hidden] { display: none; }
.event-item-remove-modal__backdrop { position: absolute; inset: 0; background: rgb(9 18 32 / 42%); }
.event-item-remove-modal__dialog { position: relative; display: flex; width: min(560px, 100%); max-height: calc(100vh - 48px); flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 10px 28px rgb(0 0 0 / 16%); }
.event-item-remove-modal__header { display: flex; min-height: 54px; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 8px; }
.event-item-remove-modal__header h2 { margin: 0; color: var(--text); font-size: 22px; font-weight: 600; line-height: 26px; }
.event-item-remove-modal__close { display: inline-flex; width: 32px; height: 32px; flex: 0 0 32px; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--history-bg); color: var(--history-text); font: 500 18px/1 Inter, Arial, Helvetica, sans-serif; cursor: pointer; }
.event-item-remove-modal__close:hover,
.event-item-remove-modal__close:focus-visible { border-color: #b8c1cc; background: #e4eaf0; outline: 2px solid rgb(120 144 156 / 24%); outline-offset: 1px; }
.event-item-remove-modal__body { display: flex; min-height: 0; flex-direction: column; gap: 8px; padding: 8px 24px 12px; overflow-y: auto; }
.event-item-remove-modal__description { margin: 0; color: var(--text); font-size: 14px; line-height: 20px; white-space: pre-line; }
.event-item-remove-modal__warning { margin: 0; padding: 8px 10px; border: 1px solid #f4a259; border-radius: 6px; background: #fff4e5; color: #8a4b08; font-size: 12px; font-weight: 600; line-height: 18px; }
.event-item-remove-modal__footer { display: flex; min-height: 64px; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 24px; border-top: 1px solid var(--border); }
.event-item-remove-modal__confirm { border-color: #d92d20; background: #fff4f2; color: #b42318; }
.event-item-remove-modal__confirm:hover,
.event-item-remove-modal__confirm:focus-visible { border-color: #b42318; background: #fee4e2; outline: 2px solid rgb(180 35 24 / 20%); outline-offset: 1px; }
.event-form { display: flex; flex-direction: column; gap: 14px; }
.event-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.event-form__field { display: flex; flex-direction: column; gap: 6px; color: var(--text); font-size: 12px; font-weight: 700; }

.event-form__field input,
.event-form__field select,
.event-form__field textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

.event-form__field textarea {
  min-height: 84px;
  resize: vertical;
}

.event-form__field input:focus,
.event-form__field select:focus,
.event-form__field textarea:focus { border-color: #78909c; outline: 2px solid rgb(120 144 156 / 24%); outline-offset: 1px; }
.event-form__field [aria-invalid="true"] { border-color: #b42318; }
.event-form__error { margin: 0; color: #b42318; font-size: 12px; font-weight: 700; }
.event-contract-section { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--history-bg); }
.event-contract-section__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.event-contract-section__header h3 { margin: 0; color: var(--text); font-size: 13px; line-height: 18px; }
.event-contract-section__status { display: inline-flex; min-height: 22px; align-items: center; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 11px; font-weight: 700; line-height: 14px; }
.event-contract-section__help { margin: 0; color: var(--muted); font-size: 12px; line-height: 18px; }
.event-contract-section .day-panel__button { align-self: flex-start; }
.event-contract-section__actions { display: flex; flex-direction: column; gap: 10px; }
.event-contract-section__action { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.event-contract-section__action .day-panel__button { max-width: 100%; }
.event-form__dirty-status { margin: 0; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 18px; }
.event-form__dirty-status--dirty { color: var(--text); }
.event-form__section { display: flex; flex-direction: column; gap: 14px; min-width: 0; margin: 0; padding: 0; border: 0; }
.event-form__section legend { padding: 0; color: var(--text); font-size: 12px; font-weight: 700; }
.event-financial-section { gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--history-bg); }
.event-financial-section__grid { gap: 12px; }
.event-financial-section__grid .event-form__field { min-width: 0; }
.event-financial-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding-top: 4px; }
.event-financial-summary__row { min-width: 0; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.event-financial-summary__row span { display: block; overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 500; line-height: 14px; text-overflow: ellipsis; white-space: nowrap; }
.event-financial-summary__row strong { display: block; margin-top: 2px; color: var(--text); font-size: 12px; line-height: 16px; }
.event-form__items-list { min-width: 0; }
.event-form__items-empty { margin: 0; color: var(--muted); font-size: 12px; font-weight: 400; }
.event-form__items-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 6px; }
.event-form__items-table { width: 100%; min-width: 0; border-collapse: collapse; table-layout: fixed; }
.event-form__items-col--toy { width: 23%; }
.event-form__items-col--quantity { width: 7%; }
.event-form__items-col--availability { width: 16%; }
.event-form__items-col--monitor { width: 9%; }
.event-form__items-col--unit-value { width: 12%; }
.event-form__items-col--total { width: 12%; }
.event-form__items-col--actions { width: 21%; }
.event-form__items-table th,
.event-form__items-table td { min-height: 44px; padding: 8px 6px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 11px; line-height: 16px; text-align: left; vertical-align: middle; }
.event-form__items-table th { background: var(--history-bg); font-weight: 500; white-space: nowrap; }
.event-form__items-table tbody tr:last-child td { border-bottom: 0; }
.event-form__items-table th:first-child,
.event-form__items-table td:first-child { padding-left: 12px; }
.event-form__items-table th:nth-child(2),
.event-form__items-table th:nth-child(4),
.event-form__items-table td:nth-child(2),
.event-form__items-table td:nth-child(4) { text-align: center; }
.event-form__items-table th:nth-child(5),
.event-form__items-table th:nth-child(6),
.event-form__items-table td:nth-child(5),
.event-form__items-table td:nth-child(6) { text-align: right; }
.event-form__item-name { display: block; overflow: hidden; font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.event-form__item-status { display: inline-flex; min-height: 22px; align-items: center; justify-content: center; padding: 4px 7px; border: 1px solid; border-radius: 6px; font-size: 10px; font-weight: 700; line-height: 12px; white-space: nowrap; }
.event-form__item-status--available { border-color: #76b58c; background: #e8f5ed; color: #245c38; }
.event-form__item-status--attention { border-color: #f4a259; background: #fff4e5; color: #8a4b08; }
.event-form__item-status--maintenance,
.event-form__item-status--blocked { border-color: #f4a259; background: #fff4e5; color: #8a4b08; }
.event-form__item-status--not-applicable { border-color: var(--border); background: var(--history-bg); color: var(--muted); }
.event-form__item-actions { display: flex; align-items: center; justify-content: center; gap: 4px; }
.event-form__item-action { min-height: 28px; padding: 6px 4px; border: 1px solid var(--border); border-radius: 6px; background: var(--history-bg); color: var(--history-text); font: 700 9px/1 Inter, Arial, Helvetica, sans-serif; white-space: nowrap; cursor: pointer; }
.event-form__item-action:hover:not(:disabled),
.event-form__item-action:focus-visible { border-color: #b8c1cc; outline: 2px solid rgb(120 144 156 / 24%); outline-offset: 1px; }
.event-form__item-action:disabled { background: #eef2f6; color: #66727d; cursor: not-allowed; opacity: 1; }
.event-form__item-summary-details { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.event-form__actions { display: flex; justify-content: flex-end; gap: 8px; }
.event-form__delete { border-color: #d92d20; background: #fff4f2; color: #b42318; }
#event-form-delete { margin-right: auto; }
.event-items-selector-open { overflow: hidden; }
.event-items-selector { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; padding: 24px; }
.event-items-selector[hidden] { display: none; }
.event-items-selector__backdrop { position: absolute; inset: 0; background: rgb(38 50 56 / 45%); }
.event-items-selector__dialog { position: relative; display: flex; width: min(800px, 100%); height: min(800px, calc(100vh - 48px)); max-height: calc(100vh - 48px); flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 32px rgb(26 38 46 / 24%); }
.event-items-selector__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 27px 31px 16px; }
.event-items-selector__header h2 { margin: 0; color: #0f172a; font-size: 30px; line-height: 38px; }
.event-items-selector__header p { margin: 0; color: #475569; font-size: 15px; line-height: 22px; }
.event-items-selector__close { display: inline-flex; width: 32px; height: 32px; flex: 0 0 32px; align-items: center; justify-content: center; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--history-bg); color: var(--history-text); font-family: inherit; font-size: 18px; font-weight: 500; line-height: 1; cursor: pointer; }
.event-items-selector__close:hover,
.event-items-selector__close:focus-visible { border-color: #b8c1cc; background: #e4eaf0; outline: 2px solid rgb(120 144 156 / 24%); outline-offset: 1px; }
.event-items-selector__body { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; gap: 16px; padding: 0 31px 16px; }
.event-items-selector__search { display: flex; flex-direction: column; gap: 8px; color: var(--text); font-size: 12px; font-weight: 700; }
.event-items-selector__search input { width: 100%; height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-family: inherit; font-size: 12px; font-weight: 400; line-height: 1.2; }
.event-items-selector__search input:focus { border-color: #78909c; outline: 2px solid rgb(120 144 156 / 24%); outline-offset: 1px; }
.event-items-selector__filters { display: flex; flex-wrap: wrap; gap: 10px; }
.event-items-selector__filter { min-height: 32px; padding: 8px 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--history-bg); color: var(--history-text); font-family: inherit; font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer; }
.event-items-selector__filter--active { background: var(--surface); color: var(--text); }
.event-items-selector__filter:hover,
.event-items-selector__filter:focus-visible { border-color: #b8c1cc; outline: 2px solid rgb(120 144 156 / 24%); outline-offset: 1px; }
.event-items-selector__table-wrap { min-height: 0; flex: 1 1 auto; overflow: auto; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.event-items-selector__table { width: 100%; min-width: 732px; border-collapse: collapse; table-layout: fixed; }
.event-items-selector__col-toy { width: 30%; }
.event-items-selector__col-available { width: 10%; }
.event-items-selector__col-status { width: 20%; }
.event-items-selector__col-monitor { width: 9%; }
.event-items-selector__col-value { width: 15%; }
.event-items-selector__col-quantity { width: 16%; }
.event-items-selector__table th,
.event-items-selector__table td { min-height: 44px; padding: 8px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 12px; line-height: 20px; text-align: left; vertical-align: middle; }
.event-items-selector__table th { background: var(--history-bg); font-weight: 500; white-space: nowrap; }
.event-items-selector__table th:first-child,
.event-items-selector__table td:first-child { padding-left: 16px; }
.event-items-selector__table th:nth-child(2),
.event-items-selector__table th:nth-child(4),
.event-items-selector__table th:nth-child(6),
.event-items-selector__table td:nth-child(2),
.event-items-selector__table td:nth-child(4),
.event-items-selector__table td:nth-child(6) { text-align: center; }
.event-items-selector__table th:nth-child(5),
.event-items-selector__table td:nth-child(5) { text-align: right; }
.event-items-selector__toy { overflow: hidden; font-size: 14px !important; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.event-items-selector__available,
.event-items-selector__monitor,
.event-items-selector__value { font-size: 14px !important; font-weight: 500; }
.event-items-selector__status { display: inline-flex; min-height: 22px; align-items: center; justify-content: center; padding: 4px 12px; border: 1px solid; border-radius: 6px; font-size: 12px; font-weight: 700; line-height: 14px; white-space: nowrap; }
.event-items-selector__status--available { border-color: #7abf8b; background: #eaf7ed; color: #23643a; }
.event-items-selector__status--attention { border-color: #d9b44a; background: #fff6d9; color: #6b5410; }
.event-items-selector__status--maintenance,
.event-items-selector__status--blocked { border-color: #f4a259; background: #fff4e5; color: #8a4b08; }
.event-items-selector__quantity { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.event-items-selector__quantity-button,
.event-items-selector__quantity-value { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 6px; background: var(--history-bg); color: var(--text); font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1; }
.event-items-selector__quantity-value { width: 36px; background: var(--surface); }
.event-items-selector__quantity-button { padding: 0; cursor: pointer; }
.event-items-selector__quantity-button:disabled { background: #eef2f6; color: #66727d; cursor: not-allowed; opacity: 1; }
.event-items-selector__quantity-button:hover:not(:disabled),
.event-items-selector__quantity-button:focus-visible { border-color: #b8c1cc; outline: 2px solid rgb(120 144 156 / 24%); outline-offset: 1px; }
.event-items-selector__empty { padding: 28px !important; color: var(--muted) !important; text-align: center !important; }
.event-items-selector__error { margin: -4px 0 0; color: #b42318; font-size: 12px; font-weight: 500; line-height: 18px; }
.event-items-selector__footer { display: flex; min-height: 110px; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 31px; border-top: 1px solid var(--border); }
.event-items-selector__footer p { margin: 0; color: #334155; font-size: 14px; font-weight: 500; line-height: 20px; }
.event-items-selector__actions { display: flex; align-items: center; gap: 12px; }
.event-items-selector__actions .day-panel__button--primary { align-self: auto; }
.delete-confirmation { z-index: 110; }
.delete-confirmation__dialog { width: min(440px, 100%); }
.delete-confirmation__body { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; color: var(--text); font-size: 13px; }
.delete-confirmation__body p { margin: 0; }
.delete-confirmation__event { font-size: 14px; font-weight: 700; }

@media (max-width: 639px) {
  .app-shell { display: block; min-height: calc(100vh - 56px); }
  .sidebar { display: none; }
  .mobile-header { display: flex; }
  .page-shell { margin: 0; padding: 8px; }

  #calendar { row-gap: 0; }

  #calendar > div:first-child {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    min-height: 136px;
    margin: 0 0 8px;
    padding: 12px;
  }

  #calendar > div:first-child > div { margin: 0; }
  #calendar > div:first-child > div:nth-child(2) { margin-left: 0; }
  #calendar > div:first-child > div:nth-child(1),
  #calendar > div:first-child > div:nth-child(2),
  #calendar > div:first-child > div:nth-child(3) { gap: 8px; }

  #calendar button { background: var(--action-secondary-bg); color: var(--action-secondary-text); }
  #calendar button[aria-label="Mês Anterior"],
  #calendar button[aria-label="Próximo Mês"] { width: var(--agenda-nav-mobile-button-width); }
  #calendar button[aria-label="+ Novo evento"] { top: 12px; right: 12px; left: auto; }

  #calendar [role="columnheader"] { height: 22px; margin-bottom: 6px; }
  #calendar [role="columnheader"] > div { height: 22px; line-height: 22px; }

  #calendar > div:nth-child(2) {
    position: relative;
    height: 546px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    aspect-ratio: auto !important;
  }

  #calendar div[role="grid"] { top: 10px !important; right: 10px !important; bottom: 28px !important; left: 10px !important; }

  .calendar-hint { display: block; margin: auto 10px 6px; }

  #calendar [role="gridcell"] { height: 78px; min-height: 78px; margin: 0 2px 2px 0; padding: 4px; }

  #calendar [role="gridcell"] .fc-QU > div { min-height: 0 !important; }

  #calendar [role="gridcell"] .fc-So { display: none !important; }

  #calendar [role="gridcell"] [role="button"][aria-haspopup="dialog"] { display: none !important; }

  .mobile-day-markers {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-content: flex-start;
    gap: 4px;
    margin: auto 4px 20px;
  }

  .mobile-day-marker { width: 6px; height: 6px; border-radius: 50%; }
  .mobile-day-marker.status-confirmado { background-color: var(--confirmed-border); }
  .mobile-day-marker.status-pre_reserva { background-color: var(--pre-reservation-border); }

  .mobile-day-marker-more {
    color: var(--history-text);
    font-size: 10px;
    font-weight: 700;
    line-height: 12px;
  }

  .day-panel {
    position: fixed;
    top: 8px;
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    gap: 0;
    padding: 0 16px 20px;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 0 0 8px #d7dade, 0 0 0 150vmax #d7dade;
  }

  .day-panel::after {
    flex: 0 0 auto;
    margin-top: 98px;
    border-top: 1px solid #edf0f3;
    content: "";
  }

  .day-panel__header { padding-top: 16px; }

  .day-panel__header h2 { font-size: 17px; line-height: 22px; }

  .day-panel__close { height: 32px; min-height: 32px; padding: 0; }

  .day-panel__events { margin-top: 11px; }

  .day-panel__event {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px 70px;
    min-height: 54px;
    padding-right: 8px;
    gap: 8px;
  }

  .day-panel__event:last-child { border-bottom: 1px solid #edf0f3; }

  .day-panel__event-name { font-size: 13px; line-height: 18px; }

  .day-panel__event .day-panel__button { justify-self: stretch; min-height: 30px; }

  .day-panel__status { justify-self: stretch; height: 24px; }

  .day-panel__alerts { margin-top: 16px; gap: 10px; }

  .day-panel__alerts:empty { margin-top: 0; }

  .day-panel__alert { min-height: 58px; padding: 10px 12px; line-height: 1.5; }

  .day-panel__actions-title {
    display: block;
    margin: 18px 0 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 24px;
  }

  .day-panel__actions { margin-top: 8px; }

  .day-panel__actions .day-panel__button { padding: 8px; }

  #day-panel-new-event { min-width: 190px; min-height: 36px; margin-top: 16px; }

  .day-panel__note { display: none; }
  .event-modal { padding: 8px; }
  .event-modal__dialog { max-height: calc(100vh - 16px); padding: 16px; }
  .event-form__grid { grid-template-columns: 1fr; }
  .event-financial-section { padding: 10px; }
  .event-financial-summary { grid-template-columns: 1fr 1fr; }
  .event-financial-summary__row:last-child { grid-column: 1 / -1; }
  .event-form__items-table-wrap { overflow: visible; }
  .event-form__items-table { min-width: 0; }
  .event-form__items-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .event-form__items-table,
  .event-form__items-table tbody,
  .event-form__items-table tr,
  .event-form__items-table td { display: block; }
  .event-form__items-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px; border-bottom: 1px solid var(--border); }
  .event-form__items-table tbody tr:last-child { border-bottom: 0; }
  .event-form__items-table td { display: flex; min-height: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 0; border: 0; text-align: right; }
  .event-form__items-table td::before { flex: 0 0 auto; color: var(--muted); content: attr(data-label); font-size: 10px; font-weight: 500; text-align: left; }
  .event-form__items-table td:first-child { grid-column: 1 / -1; display: block; padding: 0 0 4px; }
  .event-form__items-table td:first-child::before { display: none; }
  .event-form__items-table td:nth-child(2),
  .event-form__items-table td:nth-child(4),
  .event-form__items-table td:nth-child(5),
  .event-form__items-table td:nth-child(6) { text-align: right; }
  .event-form__items-table td:nth-child(7) { grid-column: 1 / -1; display: block; padding-top: 8px; border-top: 1px solid #edf0f3; }
  .event-form__items-table td:nth-child(7)::before { display: inline-block; margin-right: 12px; }
  .event-form__item-actions { display: inline-flex; }
  .event-form__item-summary-details { display: none; }
  .event-item-edit-modal { padding: 8px; }
  .event-item-edit-modal__dialog { width: 100%; height: auto; max-height: calc(100vh - 16px); border-radius: 12px; }
  .event-item-edit-modal__header { min-height: 0; padding: 20px 16px 16px; }
  .event-item-edit-modal__header h2 { font-size: 24px; }
  .event-item-edit-modal__header p { font-size: 15px; }
  .event-item-edit-modal__body { gap: 12px; padding: 16px; overflow-y: auto; }
  .event-item-edit-modal__context,
  .event-item-edit-modal__controls { grid-template-columns: 1fr; gap: 12px; }
  .event-item-edit-modal__context { min-height: 0; }
  .event-item-edit-modal__availability { min-height: 32px; }
  .event-item-edit-modal__controls { margin-top: 0; }
  .event-item-edit-modal__footer { min-height: 72px; padding: 16px; }
  .event-item-edit-modal__footer .day-panel__button { min-width: 0; padding-right: 10px; padding-left: 10px; }
  .event-item-remove-modal { padding: 8px; }
  .event-item-remove-modal__dialog { width: 100%; max-height: calc(100vh - 16px); border-radius: 12px; }
  .event-item-remove-modal__header { min-height: 0; padding: 16px 16px 8px; }
  .event-item-remove-modal__header h2 { font-size: 20px; line-height: 24px; }
  .event-item-remove-modal__body { padding: 8px 16px 12px; }
  .event-item-remove-modal__footer { min-height: 64px; padding: 12px 16px; }
  .event-item-remove-modal__footer .day-panel__button { min-width: 0; padding-right: 10px; padding-left: 10px; }
  .event-form__actions { width: 100%; flex-wrap: wrap; }
  #event-form-cancel,
  #event-form-submit { flex: 1 1 0; min-width: 0; }
  #event-form-delete { flex: 0 0 100%; margin-right: 0; }
  .event-items-selector { padding: 8px; }
  .event-items-selector__dialog { height: calc(100vh - 16px); max-height: calc(100vh - 16px); border-radius: 8px; }
  .event-items-selector__header { padding: 20px 16px 12px; }
  .event-items-selector__header h2 { font-size: 24px; line-height: 30px; }
  .event-items-selector__header p { font-size: 13px; line-height: 18px; }
  .event-items-selector__body { gap: 12px; padding: 0 16px 12px; }
  .event-items-selector__footer { min-height: 0; align-items: stretch; flex-direction: column; padding: 16px; }
  .event-items-selector__actions { width: 100%; }
  .event-items-selector__actions .day-panel__button { min-width: 0; flex: 1 1 0; padding-right: 8px; padding-left: 8px; }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .fc .fc-toolbar.fc-header-toolbar,
  #calendar > div:first-child {
    position: relative;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-rows: 32px 32px;
    min-height: 104px;
    padding: 16px 16px 16px 20px;
    column-gap: 12px;
    row-gap: 8px;
    align-items: center;
  }

  #calendar > div:first-child > div:nth-child(1),
  #calendar > div:first-child > div:nth-child(2),
  #calendar > div:first-child > div:nth-child(3) { gap: 4px; }

  .fc .fc-toolbar-chunk:nth-child(1),
  #calendar > div:first-child > div:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0;
  }

  .fc .fc-toolbar-chunk:nth-child(2),
  #calendar > div:first-child > div:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    margin-left: 0;
    margin-bottom: 0;
  }

  .fc .fc-toolbar-chunk:nth-child(3),
  #calendar > div:first-child > div:nth-child(3) {
    display: contents;
  }

  #calendar button[aria-label="+ Novo evento"] {
    position: static;
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
    width: 100px;
    padding-right: 8px;
    padding-left: 8px;
    margin-left: 0;
  }

  #calendar button[aria-label="Pré-reserva"] {
    position: absolute;
    right: 227px;
    bottom: 16px;
  }

  #calendar button[aria-label="Confirmado"] {
    position: absolute;
    right: 121px;
    bottom: 16px;
  }

  #calendar button[aria-label="Histórico ›"] {
    position: absolute;
    right: 16px;
    bottom: 16px;
    margin-left: 0;
  }

  .fc .fc-toolbar-title,
  #calendar [role="heading"] { font-size: 20px; }
}
