/* ===== Slide-over drawer for CRUD forms (Figma 447:3108 — 474px right panel) ===== */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(16, 40, 66, .35);
  display: flex; justify-content: flex-end;
  animation: drawer-fade .2s ease;
}
@keyframes drawer-fade { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  width: 474px; max-width: 100vw; height: 100%;
  background: var(--surface);
  box-shadow: -16px 0 48px rgba(16, 40, 66, .14);
  display: flex; flex-direction: column;
  padding: 36px 40px 32px;
  overflow-y: auto;
  animation: drawer-slide .26s cubic-bezier(.4, 0, .2, 1);
}
@keyframes drawer-slide { from { transform: translateX(100%); } to { transform: translateX(0); } }

.drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 16px; margin-bottom: 22px;
  border-bottom: 1px solid var(--border-soft);
}
.drawer__title { font-size: 20px; font-weight: 600; color: var(--navy); margin: 0; }
.drawer__close {
  background: none; border: 0; cursor: pointer; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px; margin: -4px -4px -4px 0; border-radius: 6px;
}
.drawer__close:hover { background: #f4f6f5; color: var(--navy); }

.drawer__body { display: flex; flex-direction: column; }

.drawer__section { margin-bottom: 22px; }
.drawer__section-title { font-size: 16px; font-weight: 600; color: var(--green); margin: 0 0 14px; }

.drawer__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.drawer__field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.drawer__field--wide { grid-column: 1 / -1; }
.drawer__field > label { font-size: 13px; color: var(--text); }
.drawer__field .input { height: var(--field-h); width: 100%; }
.drawer__field .form-errors, .drawer__field ul { color: #b42318; font-size: 12px; margin: 2px 0 0; padding: 0; list-style: none; }

/* selects + date inputs render with the design chevron / calendar, like .form-field */
.drawer__field select.input {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%23898b94' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center;
}
.drawer__field input[type=date].input {
  appearance: none; -webkit-appearance: none; padding-left: 40px; padding-right: 36px;
  background-repeat: no-repeat; background-position: left 14px center, right 14px center;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2382bf9e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%23898b94' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.drawer__field input[type=date].input::-webkit-calendar-picker-indicator { opacity: 0; cursor: pointer; }

/* Reminder-settings checklist (Preparer drawer) */
.drawer__checks { display: grid; gap: 12px; }
.drawer__check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); cursor: pointer; }
.drawer__check input { width: 18px; height: 18px; accent-color: var(--green); margin: 0; border-radius: 4px; }

/* Searchable multi-select (multi_select_controller.js) — replaces a bare <select multiple> */
.ms { position: relative; display: flex; flex-direction: column; gap: 8px; }
.ms__toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  text-align: left; cursor: pointer; color: var(--text);
}
.ms__toggle[aria-expanded=true] { border-color: var(--green); }
.ms__caret { color: var(--text-muted); flex: none; }
.ms__panel {
  position: absolute; top: calc(var(--field-h) + 4px); left: 0; right: 0; z-index: 5;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 10px;
}
.drawer__field .ms__search { height: 38px; margin-bottom: 8px; }
.ms__list { max-height: 220px; overflow-y: auto; display: grid; gap: 2px; }
.ms__opt {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px;
  font-size: 14px; border-radius: var(--radius-sm); cursor: pointer;
}
.ms__opt:hover { background: var(--bg); }
.ms__opt input { width: 17px; height: 17px; accent-color: var(--green); margin: 0; flex: none; }
.ms__empty { margin: 6px 2px; font-size: 13px; color: var(--text-muted); }
.ms__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ms__chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px;
  background: var(--bg); border-radius: 999px; font-size: 13px; color: var(--text);
}
.ms__chip-x {
  border: 0; background: none; color: var(--text-muted); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0 2px;
}
.ms__chip-x:hover { color: var(--orange); }

.drawer__foot { margin-top: auto; padding-top: 18px; }
.drawer__submit { width: 100%; }

@media (max-width: 560px) {
  .drawer { width: 100vw; padding: 24px 20px; }
  .drawer__grid { grid-template-columns: 1fr; }
}
