/* Shared daily application request dialog */
.grid-request-dialog {
  --monthly-accent: #2563eb;
  --monthly-error: #be123c;
  --monthly-ink: #111827;
  --monthly-page-accent: #218777;
  background: #ffffff;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 28px 82px rgba(15, 23, 42, 0.28);
  color: var(--monthly-ink);
  max-width: 600px;
  overflow: hidden;
  padding: 0;
  width: min(600px, calc(100vw - 32px));
}

.grid-request-dialog::backdrop {
  backdrop-filter: blur(2px);
  background: rgba(15, 23, 42, 0.46);
}

.grid-request-dialog.is-top-locked {
  bottom: auto;
  margin-bottom: 0;
  margin-top: 0;
  top: var(--grid-request-dialog-top, 0px);
}

.grid-request-dialog form {
  display: flex;
  flex-direction: column;
  max-height: min(720px, calc(100vh - 40px));
}

.grid-request-dialog [hidden] {
  display: none !important;
}

.grid-request-dialog-header,
.grid-request-dialog-footer {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}

.grid-request-dialog-header {
  background: #eef6f3;
  border-bottom: 1px solid #d3e4df;
  border-radius: 8px 8px 0 0;
  padding: 16px 18px 16px 30px;
  position: relative;
}

.grid-request-dialog-header::before {
  background: var(--monthly-page-accent);
  border-radius: 999px;
  bottom: 14px;
  content: "";
  left: 14px;
  position: absolute;
  top: 14px;
  width: 4px;
}

.grid-request-dialog-title-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  width: 100%;
}

.grid-request-header-kind {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  justify-self: start;
  max-width: 690px;
  min-width: 0;
  width: 100%;
}

.grid-request-header-kind > span {
  align-items: center;
  color: #173f38;
  display: flex;
  font-size: 18px;
  font-weight: 900;
  justify-content: flex-start;
  line-height: 1.2;
  min-height: 36px;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
}

.grid-request-dialog-close {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: #31544f;
  cursor: pointer;
  display: inline-flex;
  font-size: 22px;
  font-weight: 400;
  height: 34px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 34px;
}

.grid-request-dialog-close:hover,
.grid-request-dialog-close:focus {
  background: #dcece7;
  outline: none;
}

.grid-request-dialog-body {
  background: #f8fafc;
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 14px 16px 16px;
}

.grid-request-dialog-content,
.grid-request-editor,
.grid-request-existing-list,
.grid-request-existing-detail-list,
.grid-request-time-leave-range-list {
  display: grid;
}

.grid-request-dialog-content {
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}

.grid-request-existing {
  align-content: start;
  background: #ffffff;
  border: 1px solid #dde7ef;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 12px;
}

.grid-request-editor {
  align-content: start;
  gap: 0;
}

.grid-request-section-heading {
  display: grid;
  gap: 3px;
}

.grid-request-existing h3 {
  color: #1f3d38;
  font-size: 14px;
  font-weight: 900;
  margin: 0;
}

.grid-request-section-heading p {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
}

.grid-request-existing-list,
.grid-request-existing-detail-list,
.grid-request-time-leave-range-list {
  gap: 8px;
}

.grid-request-empty {
  background: #f8fbfc;
  border: 1px dashed #d8e2ee;
  border-radius: 6px;
  color: #667085;
  display: grid;
  gap: 4px;
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  min-height: 86px;
  place-content: center;
  padding: 12px;
  text-align: center;
}

.grid-request-empty strong {
  color: #344054;
  font-size: 13px;
}

.grid-request-existing-item {
  background: #ffffff;
  border: 1px solid #d8e2ee;
  border-radius: 6px;
  display: grid;
  gap: 5px;
  padding: 10px;
}

.grid-request-existing-item-header {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.grid-request-existing-item.is-inactive {
  opacity: 0.62;
}

.grid-request-existing-item.is-selected {
  background: #f0fdfa;
  border-color: #5eead4;
  box-shadow: inset 3px 0 0 #0f766e;
}

.grid-request-existing-item strong {
  color: #1f2937;
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grid-request-existing-detail {
  align-items: baseline;
  display: grid;
  gap: 6px;
  grid-template-columns: 66px minmax(0, 1fr);
  margin: 0;
}

.grid-request-existing-detail strong {
  color: #475467;
  font-size: 11px;
  font-weight: 900;
}

.grid-request-existing-detail span {
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
}

.grid-request-existing-item small,
.grid-request-existing-item p {
  color: #667085;
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
}

.grid-request-existing-reason {
  background: #f8fafc;
  border-radius: 5px;
  padding: 7px 8px;
}

.grid-request-existing-location {
  color: #344054;
  font-weight: 800;
}

.grid-request-existing-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.grid-request-existing-action-button {
  appearance: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  min-height: 28px;
  padding: 7px 12px;
}

.grid-request-existing-withdraw-button {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
}

.grid-request-existing-withdraw-button:hover,
.grid-request-existing-withdraw-button:focus {
  background: #ffe4e6;
  border-color: #fda4af;
  outline: none;
}

.grid-request-existing-status {
  border-radius: 999px;
  color: #475467;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  justify-content: center;
  justify-self: start;
  line-height: 1;
  padding: 5px 8px;
}

.grid-request-existing-status.is-submitted,
.grid-request-existing-status.is-pm_approved,
.grid-request-existing-status.is-mixed {
  background: #fff7ed;
  color: #9a3412;
}

.grid-request-existing-status.is-approved {
  background: #ecfdf3;
  color: #15803d;
}

.grid-request-existing-status.is-rejected,
.grid-request-existing-status.is-canceled {
  background: #f2f4f7;
  color: #667085;
}

.grid-request-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.grid-request-field {
  display: grid;
  gap: 6px;
}

.grid-request-grid > .grid-request-field {
  grid-column: span 2;
}

.grid-request-grid > .grid-request-project-field {
  grid-column: span 4;
}

.grid-request-grid > .grid-request-paid-leave-balance {
  grid-column: 1 / -1;
}

.grid-request-grid > .grid-request-companion-checkbox {
  grid-column: 1 / -1;
}

.grid-request-grid > .grid-request-field-wide,
.grid-request-grid > .grid-request-companion-panel,
.grid-request-grid > .grid-request-time-leave-ranges {
  grid-column: 1 / -1;
}

#gridRequestForm[data-request-kind="paid_leave_time"] .grid-request-grid > .grid-request-time-leave-ranges {
  grid-column: span 4;
}

#gridRequestForm[data-request-kind="holiday_substitution"][data-companion-time-leave="true"] .grid-request-grid > .grid-request-companion-checkbox {
  grid-column: span 2;
  order: 1;
}

#gridRequestForm[data-request-kind="holiday_substitution"][data-companion-time-leave="true"] .grid-request-grid > .grid-request-time-leave-ranges {
  align-self: end;
  grid-column: span 4;
  order: 2;
}

.grid-request-grid > [data-grid-request-field="workDate"] {
  align-self: start;
}

.grid-request-field span,
.grid-request-field > label {
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.grid-request-paid-leave-balance {
  align-items: center;
  align-self: stretch;
  background: #f8fbfc;
  border: 1px solid #d9e6ef;
  border-radius: 7px;
  display: flex;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
}

.grid-request-paid-leave-balance-body {
  align-items: center;
  color: #101828;
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  font-size: 13px;
  font-weight: 800;
  gap: 6px;
  line-height: 1.4;
  min-width: 0;
}

.grid-request-paid-leave-balance strong {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  white-space: nowrap;
}

.grid-request-paid-leave-balance small {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grid-request-paid-leave-balance > span {
  color: #344054;
  flex: 0 0 auto;
  font-size: 13px;
  line-height: 1.4;
}

.grid-request-companion-panel {
  background: #f8fbfc;
  border: 1px solid #e2ebf2;
  border-radius: 7px;
  gap: 8px;
  padding: 9px;
}

.grid-request-time-leave-ranges {
  background: transparent;
  border: 0;
  border-radius: 0;
  gap: 8px;
  padding: 0;
}

.grid-request-kind-toggle {
  display: contents;
}

.grid-request-kind-toggle-button {
  appearance: none;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #344054;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  min-width: 0;
  min-height: 36px;
  padding: 7px 8px;
  text-align: center;
}

.grid-request-kind-toggle-button:hover,
.grid-request-kind-toggle-button:focus {
  border-color: #7dd3fc;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
  outline: none;
}

.grid-request-kind-toggle-button.is-active {
  background: #ecfeff;
  border-color: #22d3ee;
  color: #155e75;
}

.grid-request-kind-toggle-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.grid-request-field input,
.grid-request-field select,
.grid-request-field textarea {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #111827;
  font: inherit;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

.grid-request-field input::placeholder,
.grid-request-field textarea::placeholder {
  color: #98a2b3;
}

.grid-request-field textarea {
  min-height: 92px;
  resize: vertical;
}

.grid-request-field input:focus,
.grid-request-field select:focus,
.grid-request-field textarea:focus {
  border-color: var(--monthly-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  outline: none;
}

.grid-request-field input:disabled,
.grid-request-field select:disabled,
.grid-request-field textarea:disabled {
  background: #f8fafc;
  border-color: #d8dee8;
  color: #475467;
  cursor: not-allowed;
  opacity: 1;
}

.grid-request-field input.is-invalid-date {
  border-color: #f43f5e;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.12);
}

.grid-request-project-field {
  position: relative;
}

.grid-request-companion-checkbox {
  align-self: end;
}

.grid-request-companion-checkbox-spacer {
  min-height: 14px;
}

.grid-request-companion-check {
  align-items: center;
  color: #1f2937;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 900;
  gap: 8px;
  min-height: 38px;
}

.grid-request-companion-check input[type="checkbox"] {
  accent-color: var(--monthly-accent);
  border: 0;
  flex: 0 0 16px;
  min-height: 16px;
  padding: 0;
  width: 16px;
}

.grid-request-companion-check input[type="checkbox"]:focus {
  box-shadow: none;
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.grid-request-companion-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.7fr) minmax(0, 0.7fr);
}

.grid-request-time-leave-range-header,
.grid-request-time-leave-range {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px 34px;
}

.grid-request-time-leave-range-header {
  align-items: center;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
  min-height: 0;
}

.grid-request-time-leave-range-list {
  gap: 6px;
}

.grid-request-time-leave-range-header .grid-request-time-leave-action-spacer {
  min-height: 0;
}

.grid-request-time-leave-add,
.grid-request-time-leave-remove {
  align-items: center;
  align-self: center;
  background: #667085;
  border: 1px solid #667085;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  min-height: 32px;
  min-width: 32px;
  padding: 0;
  width: 32px;
}

.grid-request-time-leave-icon {
  display: block;
  height: 16px;
  pointer-events: none;
  width: 16px;
}

.grid-request-time-leave-action-spacer {
  align-self: center;
  display: block;
  min-height: 32px;
  width: 32px;
}

.grid-request-time-leave-remove:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.grid-request-time-leave-field {
  display: grid;
  gap: 5px;
}

.grid-request-project-quick-list {
  background: #f8fbfc;
  border: 1px solid #e2ebf2;
  border-radius: 7px;
  display: grid;
  gap: 7px;
  padding: 8px;
}

.grid-request-project-quick-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.grid-request-project-quick-heading span {
  color: #475467;
  font-size: 12px;
  font-weight: 900;
}

.grid-request-project-quick-heading small {
  color: #667085;
  font-size: 11px;
  font-weight: 800;
}

.grid-request-project-quick-buttons {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  max-height: 126px;
  overflow: auto;
  padding-right: 2px;
}

.grid-request-project-quick-button {
  align-items: center;
  appearance: none;
  background: #ffffff;
  border: 1px solid #d8e2ee;
  border-radius: 6px;
  color: #111827;
  cursor: pointer;
  display: grid;
  gap: 2px;
  min-height: 42px;
  padding: 7px 9px;
  text-align: left;
}

.grid-request-project-quick-button:hover,
.grid-request-project-quick-button:focus {
  background: #eff6ff;
  border-color: #93c5fd;
  outline: none;
}

.grid-request-project-quick-button.is-selected {
  background: #ecfdf3;
  border-color: #86efac;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.12);
}

.grid-request-project-quick-button strong {
  color: #0f766e;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.grid-request-project-quick-button span {
  color: #475467;
  font-size: 11px;
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grid-request-project-quick-empty {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  margin: 0;
}

.grid-request-project-results {
  background: #ffffff;
  border: 1px solid #d8e2ee;
  border-radius: 6px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
  display: grid;
  gap: 2px;
  left: 0;
  max-height: 210px;
  overflow: auto;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 70;
}

.grid-request-project-result {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: #111827;
  cursor: pointer;
  display: grid;
  gap: 8px;
  grid-template-columns: 92px minmax(0, 1fr);
  min-height: 30px;
  padding: 6px 8px;
  text-align: left;
}

.grid-request-project-result:hover {
  background: #eff6ff;
}

.grid-request-project-result strong,
.grid-request-project-result span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grid-request-dialog-footer {
  background: #ffffff;
  border-top: 1px solid #d8e1e7;
  border-radius: 0 0 8px 8px;
  padding: 12px 16px;
}

.grid-request-dialog-statuses {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.grid-request-dialog-date-badge,
.grid-request-dialog-footer .status {
  align-items: center;
  border: 1px solid #d8e1e7;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  margin: 0;
  min-height: 28px;
  padding: 0 10px;
}

.grid-request-dialog-date-badge {
  background: #ecfdf5;
  border-color: #b7e3dc;
  color: #0f766e;
}

.grid-request-dialog-footer .status {
  background: #eef3f6;
  color: #657682;
}

.grid-request-dialog-footer .status.error {
  background: #fff0ed;
  border-color: #e0aaa2;
  color: var(--monthly-error);
  font-weight: 800;
}

.grid-request-dialog-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.grid-request-dialog-actions button {
  min-height: 36px;
}

.grid-request-dialog-actions button[type="submit"] {
  background: #2c7892;
  border: 1px solid #25677d;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  min-height: 38px;
  min-width: 112px;
  padding: 0 18px;
}

.grid-request-dialog-actions .grid-request-withdraw-button {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 6px;
  color: #be123c;
  cursor: pointer;
  font-weight: 900;
  min-height: 38px;
  min-width: 112px;
  padding: 0 18px;
}

.grid-request-dialog-actions .secondary-button {
  min-height: 38px;
  min-width: 112px;
  padding: 0 18px;
}

.grid-request-dialog-actions button[type="submit"]:hover {
  background: #24677d;
}

.grid-request-dialog-actions .grid-request-withdraw-button:hover,
.grid-request-dialog-actions .grid-request-withdraw-button:focus {
  background: #ffe4e6;
  border-color: #fda4af;
  outline: none;
}

.grid-request-dialog-actions button[type="submit"]:disabled {
  cursor: wait;
  opacity: 0.64;
}

.grid-request-dialog-actions .grid-request-withdraw-button:disabled {
  cursor: wait;
  opacity: 0.64;
}

@media (max-width: 760px) {
  .grid-request-dialog {
    width: min(100vw - 18px, 600px);
  }

  .grid-request-dialog-header,
  .grid-request-dialog-footer,
  .grid-request-dialog-body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .grid-request-dialog-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .grid-request-dialog-header {
    align-items: flex-start;
    padding-left: 24px;
  }

  .grid-request-dialog-title-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .grid-request-header-kind {
    align-items: stretch;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-request-dialog-statuses {
    width: 100%;
  }

  .grid-request-dialog-date-badge,
  .grid-request-dialog-footer .status {
    justify-content: center;
  }

  .grid-request-companion-grid,
  .grid-request-grid {
    grid-template-columns: 1fr;
  }

  .grid-request-grid > .grid-request-field,
  .grid-request-grid > .grid-request-companion-checkbox,
  .grid-request-grid > .grid-request-companion-panel,
  .grid-request-grid > .grid-request-time-leave-ranges {
    grid-column: 1 / -1;
  }

  #gridRequestForm[data-request-kind="paid_leave_time"] .grid-request-grid > .grid-request-time-leave-ranges {
    grid-column: 1 / -1;
  }

  #gridRequestForm[data-request-kind="holiday_substitution"][data-companion-time-leave="true"] .grid-request-grid > .grid-request-companion-checkbox,
  #gridRequestForm[data-request-kind="holiday_substitution"][data-companion-time-leave="true"] .grid-request-grid > .grid-request-time-leave-ranges {
    grid-column: 1 / -1;
    order: 0;
  }
}
